Tuesday, August 12, 2014

avi to avc1 mkv. using ffmpeg on linux 2014

----/testing \-------
avi to avc1 mkv. using ffmpeg on linux 2014

mkdir encoded
for f in *.avi; do ./ffmpeg -i "$f" -vf scale=-1:720 -c:v libx264 -crf 18 -preset fast -c:a copy encoded/"${f%.avi}.mkv"; done
----------------
== huge file ==

mkdir encoded
for f in *.avi; do \
ffmpeg -i "$f" -vf scale=-1:720 -vcodec libx264 -crf 18 -preset fast -acodec copy encoded/"${f%.avi}.mkv"; done

----------------------
== smaller file===

mkdir encoded
for f in *.avi; do \
ffmpeg -i "$f" -vf scale=720: -vcodec libx264 -crf 18 -preset fast -acodec copy encoded/"${f%.avi}.mkv"; done

-------------/test 360p\-------
mkdir encoded
for f in *.avi; do \
ffmpeg -i "$f" -vf scale=-1:360 -vcodec libx264 -crf 18 -preset superfast -acodec copy encoded/"${f%.avi}.mkv"; done

i haven't played around alot with this code. it's just here for testing

2004 update ffmpeg ,mp4 to libxvid XVID avi

mp4 to libxvid XVID avi

mkdir encoded
for f in *.mp4; do \
ffmpeg -i "$f" -vf scale=720: -vcodec libxvid -vtag XVID -qmin 2 -qmax 4 -b:v 900K -minrate 900K -r 29.97 -async 0 -preset fast -acodec libmp3lame -ab 197k encoded/"${f%.avi}.avi"; done

--------------------------------
xxxxxxxxxxxxxxxxxx
To summarize:

(To set up a CBR process, use -b:v 3500K -minrate 3500K, or leave out the "-minrate " altogether)

8moy204 ffmpeg mpeg4 XVID updates

----------
low quality.
[-qmin 2 -qmax 4]

for f in *.mpeg; do ffmpeg -i "$f" -s 640x360 -vcodec mpeg4 -vtag XVID -qmin 2 -qmax 4 -b:v 986K -r 29.97 -async 0 -acodec libmp3lame -ab 197k encoded/"${f%.avi}.avi"; done

for f in *.mpeg; do ffmpeg -i "$f" -s 640x360 -vcodec mpeg4 -vtag XVID -qmin 2 -qmax 4 -b:v 986K -r 29.97 -async 0 -acodec libmp3lame -ab 197k encoded/"${f%.avi}.avi"; done


-----------------------
higher quality,
-qscale 2
------------------------
Try for example (change in/out files):
Code:
libxvid sucks it is out dated. mpeg4 works better on some videos files for me.
+++++++++++++++++++++++++++++++++++++
anime mode.
for f in *.mpeg; do ffmpeg -i "$f" -vcodec mpeg4 -vtag XVID -qscale 3 -s 640x360 -r 29.97 -b 900K -mbd rd -cmp 2 -subcmp 2 -async 0 -acodec libmp3lame -ab 197k encoded/"${f%.avi}.avi"; done
----------------
live mode.

for f in *.mpeg; do ffmpeg -i "$f" -vcodec mpeg4 -vtag XVID -qscale 2 -s 640x360 -r 29.97 -b 900K -mbd 2 -cmp 3 -async 0 -acodec libmp3lame -ab 197k encoded/"${f%.avi}.avi"; done

for f in *.mpeg; do ffmpeg -i "$f" -vcodec mpeg4 -vtag XVID -qscale 2 -s 640x360 -r 29.97 -b 900K -mbd 2 -cmp 3 -async 0 -acodec libmp3lame -ab 197k encoded/"${f%.avi}.avi"; done
----------------
----------------
edit 11moy2015
24fps:
ffmpeg -i *.mkv \ -vcodec msmpeg4 -b 592K -bufsize 4096K \ -qscale 2 \ -qmin 2 -qmax 4 \ -s 320x208 \ -r 23.975 \ -async 4800 -acodec libmp3lame -ab 160k \ -mbd 2 -precmp 0 -cmp 2 -subcmp 2 new-DIV3--[at512,,ab160K]msmpeg4.AVI
----------------
http://wardcraft.blogspot.com/2007/02/ffmpeg-cmp-2-test-on-dvp642.html


Monday, February 19, 2007
FFMPEG : cmp 2 test on dvp642
WARDCRAFT: I tried a couple more setting on (Phillips dvp640) divx DVD player to see if they would work. --
-- NOTE using ffmpeg: final video will be 352x240 ntsc cif - div3 avi and it will play on this divx DVD player (Phillips dvp640) but the player is junk and will probably brake on me any day . Do a Google search on the player and on Phillips they do not have a good track record. --
--
ffmpeg -i *.avi -vcodec msmpeg4 -ab 128 -b 592 -bufsize 4096 -mbd 2 -precmp 0 -cmp 2 -subcmp 2 -s 320x208 -padtop 16 -padbottom 16 -padleft 16 -padright 16 -t 00:24:04.6 new-DIV3--[at512ab96]msmpeg4.AVI --
-- The video did not scale well on my computer but it did scale well on my TV. - I padded the video so that the divx player on my TV would not cut of the sub tittles. -
- "what is cmp 2"
- Comparison Function for Motion estimation. I tried using cmp and I think it made the video look a little better. -
- cmp 0 = default *
* cmp 2 = handamard = anime ? *
* cmp 3 = dct =? and good for live action I think.*
* -*
* subcomp 2 ? Is good for anime, acording to some video site I read.*
* "subcomp 2 good for anime." -*
* precmp 0 - is the default and fastest . 0 is sufficient for precmp. I don't know why it's just something I read online. -*
* mbd 2*
* mbd 2 = High Quality Macroblock Decision Algorithem. mbd 2 is the same as vhq.*
* -*
* mbd 1 is faster but not the best quality.*
* -*
* THE video I tested on my player was 352x240 ntsc and it looked OK.*
* The final video size ended up at 126MB . -*
* I all so test 640x480 video . playback looked good but my computer is slow 800mhz so I'm not going to code a lot of video at 640x480.
-------------------------------