[FFmpeg-user] formula for transcoding to ogv, shrinking an mkv
James Miller
gajs-f0el at dea.spamcon.org
Fri Jan 18 16:37:51 CET 2013
Attempting to implement Carl's suggestions, I tried this as a first pass:
ffmpeg -y -i infile.mkv -pass 1 -acodec libvorbis -ab 48k -ac 2 -vcodec
libtheora -b 100k -threads 0 outfile.ogv and got the following output:
ffmpeg version 0.8.4-4:0.8.4-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the
Libav developers
built on Nov 6 2012 16:50:25 with gcc 4.6.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a
future release. Please use avconv instead.
[matroska,webm @ 0x92b9220] Estimating duration from bitrate, this may be
inaccurate
Input #0, matroska,webm, from 'infile.mkv':
Metadata:
ENCODER : Lavf54.29.104
Duration: 00:48:52.19, start: 0.000000, bitrate: N/A
Stream #0.0: Video: h264 (High 4:4:4 Predictive), yuv444p, 830x615,
PAR 1:1 DAR 166:123, 15 fps, 15 tbr, 1k tbn, 30 tbc (default)
Stream #0.1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
(default)
[buffer @ 0x9375480] w:830 h:615 pixfmt:yuv444p
Output #0, ogg, to 'outfile.ogv':
Metadata:
encoder : Lavf53.21.0
Stream #0.0: Video: libtheora, yuv444p, 830x615 [PAR 1:1 DAR 166:123],
q=2-31, pass 1, 100 kb/s, 15 tbn, 15 tbc (default)
Stream #0.1: Audio: libvorbis, 48000 Hz, 2 channels, s16, 100 kb/s
(default)
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press ctrl-c to stop encoding
[matroska,webm @ 0x92b9220] Read error0kB time=2249.50 bitrate=
0.0kbits/s
frame=33750 fps= 12 q=0.0 Lsize= 36317kB time=2249.99 bitrate=
132.2kbits/s
video:0kB audio:35611kB global headers:7kB muxing overhead 1.961715%
Then I did a second pass with the following command: ffmpeg -y -i
infile.mkv -pass 2 -acodec libvorbis -ab 48k -ac 2 -vcodec libtheora -b
100k -threads 0 outfile.ogv . That resulted in the following output:
ffmpeg version 0.8.4-4:0.8.4-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the
Libav developers
built on Nov 6 2012 16:50:25 with gcc 4.6.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a
future release. Please use avconv instead.
[matroska,webm @ 0x9440220] Estimating duration from bitrate, this may be
inaccurate
Input #0, matroska,webm, from 'infile.mkv':
Metadata:
ENCODER : Lavf54.29.104
Duration: 00:48:52.19, start: 0.000000, bitrate: N/A
Stream #0.0: Video: h264 (High 4:4:4 Predictive), yuv444p, 830x615,
PAR 1:1 DAR 166:123, 15 fps, 15 tbr, 1k tbn, 30 tbc (default)
Stream #0.1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
(default)
[buffer @ 0x94fc480] w:830 h:615 pixfmt:yuv444p
Output #0, ogg, to 'outfile.ogv':
Metadata:
encoder : Lavf53.21.0
Stream #0.0: Video: libtheora, yuv444p, 830x615 [PAR 1:1 DAR 166:123],
q=2-31, pass 2, 100 kb/s, 15 tbn, 15 tbc (default)
Stream #0.1: Audio: libvorbis, 48000 Hz, 2 channels, s16, 100 kb/s
(default)
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press ctrl-c to stop encoding
[matroska,webm @ 0x9440220] Read error7kB time=2249.67 bitrate=
301.6kbits/s
frame=33750 fps= 12 q=0.0 Lsize= 82870kB time=2249.67 bitrate=
301.8kbits/s
video:46159kB audio:35611kB global headers:7kB muxing overhead 1.336090%
The lossless infile.mkv is 491 MB in size, while outfile.ogv winds up
being 81 MB. That outfile, for some reason, is slightly larger than the
file I produced using the 1 pass encoding with the errant -crf option and
no -b option set: that outfile.ogv came in at 73 MB (command line ffmpeg
-i infile.mkv -r 13 -acodec libvorbis -ab 48k -ac 2 -vcodec libtheora
-preset slow -wpredp 0 -crf 22 -threads 0 outfile.ogv). I can't detect any
difference in quality between the two files: both are of acceptable
quality for my uses.
Any further suggestions on things to try or corrections to implement?
Thanks,
James
More information about the ffmpeg-user
mailing list