Angus
23rd January 2007, 06:01
Hi guys,
Have read some of the below posts on using mencoder and also for converting to mpeg 2 using ffmpeg, but its a bit over my head.
I have a CENTOS box with around 1,000 videos in a directory - all different sizes from 1Mb to 100Mb.
Id like a simple solution that can basically convert all these files into something that will convert them to an ipod format.
I have both mencoder and ffmpeg installed on my box but just not sure of the differences between them.
I have tried the following code that I struggled through the manual with but its very hit and miss. Seems only to convert every second file ... and badly at that.
Any help / tips would be greatly appreciated :)
The following are basically variations to try and deal with the conversions ...
Should try and detect if video is widescreen - if it is use second one.
ffmpeg -i input.avi -f mp4 -vcodec mpeg4 -maxrate 2000 -b 1500 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ar 44100 -ab 128 -s 320×180 -aspect 16:9 output.mp4
ffmpeg -i * -f mp4 -vcodec mpeg4 -maxrate 2000 -b 1500 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ar 44100 -ab 128 -s 320×240 -aspect 4:3 *.mp4
ls -1 | perl -ne 'chomp; print `ffmpeg -i $_ -f mp4 -vcodec mpeg4 -maxrate 2000 -b 1500 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ar 44100 -ab 128 -s 320×240 -aspect 4:3 $_.mp4`;'
ffmpeg -i %1 -f mp4 -vcodec mpeg4 -maxrate 2000 -b 1500 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ar 44100 -ab 128 -s 320×240 -aspect 4:3 %1.mp4
ffmpeg -i in.avi -f mp4 -vcodec mpeg4 -maxrate 1000 -b 700 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ab 192 -s 320x240 -aspect 4:3 out.mp4
find . -size +5000k -and -size -10000k -exec cp {} /ipod \;
find . -exec ffmpeg -i {} -f mp4 -vcodec mpeg4 -maxrate 2000 -b 1500 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ar 44100 -ab 128 -s 320×240 -aspect 4:3 converted/{}.mp4 \;
Have read some of the below posts on using mencoder and also for converting to mpeg 2 using ffmpeg, but its a bit over my head.
I have a CENTOS box with around 1,000 videos in a directory - all different sizes from 1Mb to 100Mb.
Id like a simple solution that can basically convert all these files into something that will convert them to an ipod format.
I have both mencoder and ffmpeg installed on my box but just not sure of the differences between them.
I have tried the following code that I struggled through the manual with but its very hit and miss. Seems only to convert every second file ... and badly at that.
Any help / tips would be greatly appreciated :)
The following are basically variations to try and deal with the conversions ...
Should try and detect if video is widescreen - if it is use second one.
ffmpeg -i input.avi -f mp4 -vcodec mpeg4 -maxrate 2000 -b 1500 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ar 44100 -ab 128 -s 320×180 -aspect 16:9 output.mp4
ffmpeg -i * -f mp4 -vcodec mpeg4 -maxrate 2000 -b 1500 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ar 44100 -ab 128 -s 320×240 -aspect 4:3 *.mp4
ls -1 | perl -ne 'chomp; print `ffmpeg -i $_ -f mp4 -vcodec mpeg4 -maxrate 2000 -b 1500 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ar 44100 -ab 128 -s 320×240 -aspect 4:3 $_.mp4`;'
ffmpeg -i %1 -f mp4 -vcodec mpeg4 -maxrate 2000 -b 1500 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ar 44100 -ab 128 -s 320×240 -aspect 4:3 %1.mp4
ffmpeg -i in.avi -f mp4 -vcodec mpeg4 -maxrate 1000 -b 700 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ab 192 -s 320x240 -aspect 4:3 out.mp4
find . -size +5000k -and -size -10000k -exec cp {} /ipod \;
find . -exec ffmpeg -i {} -f mp4 -vcodec mpeg4 -maxrate 2000 -b 1500 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ar 44100 -ab 128 -s 320×240 -aspect 4:3 converted/{}.mp4 \;