I just downloaded "FFmpeg git-070b0e1 32-bit Static (Latest)" from http://ffmpeg.zeranoe.com/builds/. I extracted the files on my Vista machine and then updated my PATH to point to presets
and bin
folders.
The first command I ran was this:
ffmpeg -i C:/a.avi -vcodec libtheora -qscale 6 -acodec libvorbis -ab 128k -vf scale="480:-1" C:/a.ogv
I got this error:
Please use -q:a or -q:v, -qscale is ambiguous
[NULL @ 0200F800] Unable to find a suitable output format for 'C:/a.ogv''
C:/a.ogv': Invalid argument
The second command I ran was this:
ffmpeg -i C:/a.avi -vcodec libx264 -preset slow -profile main -crf 20 -acodec libfaac -ab 128k -vf scale="480:-1" C:/a.mp4
I got this error: Unknown encoder 'libfaac'
Questions:
I'm trying to convert an input video (I don't know what the MIME type is) and output it as ogv and mp4 so I can play it on a website. Of course, I'm looking for highest possible quality at the lowest possible file size. I've pieced my commands from what I can find on the net. Am I on the right track? What can I do to improve?
I do not use Windows, therefore I can not give any suggestions for your file name issues.
As for your first question regarding using x264 you are on a good start although I would eliminate -profile main
it is most likely not required. Also replace scale="480:-1"
with scale="trunc(oh*a*2)/2:480"
to prevent an odd sized output; otherwise you may end up with an error: [libx264] height not divisible by 2
. Basic recommendation for this encoder is to use the highest -crf
value that gives and acceptable quality and the slowest -preset
you have patience for. See FFmpeg: The ultimate Video and Audio Manipulation Tool and
FFmpeg and x264 Encoding Guide for more examples.
The Zeranoe builds do not include support for libfaac. Including it would make the ffmpeg binary non-redistributable. Alternative AAC encoders supported in the Zeranoe builds are -c:a libvo_aacenc
and the native FFmpeg AAC encoder -c:a aac -strict experimental
.
An alternative to using libtheora for Theora in ogv is libvpx for VP8 in webm. I have little experience with this encoder so I can not give you any recommendations.
Note that ffmpeg usage questions are better suited for superuser.com.
ogv output from avi input worked fine ...
rob@ Videos$ ffmpeg -i ../Downloads/Nikon_Coolpix_S3000.AVI -f ogg testm.ogv
ffmpeg version git-2012-08-29-85c8303 Copyright (c) 2000-2012 the FFmpeg developers
built on Aug 29 2012 08:59:14 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration: --enable-gpl --enable-libfaac --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3
libavutil 51. 70.100 / 51. 70.100
libavcodec 54. 54.100 / 54. 54.100
libavformat 54. 25.104 / 54. 25.104
libavdevice 54. 2.100 / 54. 2.100
libavfilter 3. 14.100 / 3. 14.100
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
[avi @ 0x2457260] sample size (1) != block align (2)
[avi @ 0x2457260] non-interleaved AVI
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, avi, from '../Downloads/Nikon_Coolpix_S3000.AVI':
Metadata:
encoder :
maker : NIKON
model : COOLPIX S3000
creation_time : 2010-11-29 21:32:23
Duration: 00:00:02.49, start: 0.000000, bitrate: 3168 kb/s
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p, 320x240, 30 tbr, 30 tbn, 30 tbc
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s
Output #0, ogg, to 'testm.ogv':
Metadata:
model : COOLPIX S3000
maker : NIKON
encoder : Lavf54.25.104
Stream #0:0: Video: theora, yuv422p, 320x240, q=2-31, 200 kb/s, 30 tbn, 30 tbc
Stream #0:1: Audio: flac, 22050 Hz, mono, s16, 128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg -> libtheora)
Stream #0:1 -> #0:1 (pcm_s16le -> flac)
Press [q] to stop, [?] for help
frame= 75 fps=0.0 q=0.0 Lsize= 134kB time=00:00:02.50 bitrate= 438.3kbits/s
video:68kB audio:61kB subtitle:0 global headers:3kB muxing overhead 0.925484%
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With