convert avi (or mpg or mkv or m2ts) to MP4 to save disk space


To convert avi files to mp4 use the ffmpeg command, you may need to install it.

    sudo apt-get install ffmpeg   #  debian-ubunutu distros - LINUX MINT MATE recommended

avi files are roughly 43% larger than the same file as mp4 - this may vary greatly on the content and quality.


after converting avi, mpg, mkv and m2ts videos to MP4, the following reductions were seen:

    m2ts-mp4	23%
    avi-mp4	    43%
    mkv-mp4	    49%
    mpg-mp4	    70%
---------------------------------------

COMMAND:

 ffmpeg -i FILE.avi FILE.mp4  


---------------------------------------
FFMPEG steps to convert avi to mp4
---------------------------------------
  1) list avi into file; edit using vim (or vi)

  2) replace lines with the following string:
hit  and then this sequence:
:2,$s$.*$ffmpeg -i & &-X.mp4 ; rm -f & $g

  3) then replace -X.mp4 with .mp4

    hit  and then this sequence:
    :%s/.avi-X.mp4/.mp4/g

hit :wq 

  4) run file as script or copy by line
    (chmod 744 filename, 
       then the type filename 
    (IF your path has "." or ~/ )  
    or type "sh ./filename" 

---------------------------------------
NOTE:  Grabbed viminfo details for process above:

cp ~/.vinfo viminfo-to-edit; vi viminfo-to-edit 
(note in .bashrc either alias vi to vim or define editor as vim, seen .bashrc details)

# This viminfo file was generated by Vim 8.1.
# Last Substitute String:
# Command Line History (newest to oldest):
found strings and copied them above... considerable history in ~/.viminfo

viminfo is not always installed by default:
    sudo apt-get -y install vim   # again, LINUX MINT MATE or other debian based distros


# ================================================================================
# ffmpeg --help short string:
#   usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
#           options are complex, simple always works
#   abbreviated and simple usage: ffmpeg -i infile outfile
# ================================================================================

# ffmpeg -i input_X.avi output_X.mp4

# WORKED:  ffmpeg -i 09x00_Special_The_Making_of_Back_To_Earth.avi The_Making_of_Back_to_Earth.mp4
#                                  243,677,198  (232.39mb)  -->  102,953,111 (98.18mb)
# ================================================================================

NOTICE FILE DIFFERNCE (renamed file), 233M --> 99M (about 43% smaller with this file):
-rw-r--r--  1 john john 233M Jul 26 19:47 09x00_Special_The_Making_of_Back_To_Earth.avi
-rw-r--r--  1 john john  99M Aug 12 20:49 The_Making_of_Back_to_Earth.mp4



JohnMeister.com Today's Date:




fotomeister:john's favorite fotos


@meistertech youtube channel


Study the Bible on line

Bible Basics: an 8 section guide to understanding the Bible
on line here: HTML version Or view in PDF format.
Available at e-book retailers around the world in multiple formats.
Study Guide:(out of print-2023) The Art of LINUX Sys Admin
john's O'Reilly author info
e-books by john
published e-books by john:
Bible Basics  Full Size Jeep Buyer's Guide Simply Linux: Basics Linux Tackles Microsoft
Mac and Jack - the tail of two kitties Using BASH on Windows 10 Using BASH on Windows 10 - LITE VERSION
Practical Suggestions for Microsoft Windows

Linux Overview
-- bashrc and basics
The vi editor -- Linux notes
Scripting -- Filesystems
OS performance info -- Sys Admin

STUDY the Bible    ...in ONE year
...in Chronological Order
Parallel Bible for Study
Israel National News -- BBC: MidEast
Der Spiegel -- Voice of the Martyrs
News Links -- Jihadwatch.org

these links updated: 2023-01-02
overview of mankind's history
"Promises and Prophets"

Study the Bible.
Study the Bible with English, German and Greek.
verse by verse teachings on MP3
Details of the Passover week

THURSDAY on the cross...

BibleTech: multiple languages in parallel
FULL SIZE JEEP

Buyer's Guide


SJ Jeeps

"Jeep is America's
only real sports car."
-Enzo Ferrari

Mercedes, VW, and other Diesels
Nikon cameras -- and other general tech info

Bibletech.net
NW pollen count
Seattle traffic
Bridge Christian Fellowship mp3 teachings
AMSOIL product guide,
or, AMSOIL web, or 1-800-956-5695,
use customer #283461

Amsoil dealer since 1983

purchase AMSOIL and have it installed locally in Western Washington at the following locations, CALL ahead to have your specific AMSOIL products made available at:

- Northland Diesel 360.676.1970 - Bellingham, WA
- Fleet Services 425-355-4440 -Everett, WA
- and Dalton's 360-386-8571 - Marysville, WA

Or follow the link above/call the toll free number, and have delivered directly.
Please use Customer Number 283461, thank you.



SJ - 1962-1991

XJ - 1984-2001

WJ - 1999-2004

KJ - 2002-2007

WK - 2005-2010

Find the recommended
AMSOIL synthetics
for your Jeep

CJ-10A - 1984-1986

Jeepsters

MJ - 1984-1992

Willys - 1946-1965

Other Jeeps (FC)