[FFmpeg-user] mjpeg "quality"

Erik Slagter erik at slagter.name
Mon Mar 4 13:12:58 CET 2013


On 04-03-13 12:45, Carl Eugen Hoyos wrote:

> Running "ls -l test.mkv" will allow you to see the size of 
> the output file, now please test with "qscale 2" and 
> investigate the size of the second output file.
> 
> For future requests:
> Please always post your failing command line together with 
> the complete, uncut console output whenever asking for 
> help here. Please do not post configure output etc. 
> except if asked to.

So here you go:

artemis erik:~LD_LIBRARY_PATH $ ls
total 63M
172K ffmpeg               0 libavdevice.so     896K libavfilter.so.3
  0 libavutil.so     180K libpostproc.so.52      0 libswscale.so
   0 libavcodec.so      76K libavdevice.so.54     0 libavformat.so
200K libavutil.so.52     0 libswresample.so    372K libswscale.so.2
8,2M libavcodec.so.54     0 libavfilter.so     1,6M libavformat.so.54
  0 libpostproc.so   108K libswresample.so.0
51M test.mts
artemis erik:~LD_LIBRARY_PATH $ ffprobe test.mts
Input #0, mpegts, from 'test.mts':
  Duration: 00:00:26.92, start: 0.801622, bitrate: 15704 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448),
yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz,
stereo, fltp, 256 kb/s
    Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] /
0x0090)
artemis erik:~LD_LIBRARY_PATH $ ./ffmpeg -y -i
/var/foto/Todo/video/orig/00000.MTS -an -sn -codec:v mjpeg -q:v 2 -f
matroska test.mkv
ffmpeg version N-50460-g393dcbf Copyright (c) 2000-2013 the FFmpeg
developers
  built on Mar  4 2013 12:54:46 with gcc 4.7.2 (GCC) 20120921 (Red Hat
4.7.2-2)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64
--enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libmp3lame --enable-libx264 --enable-shared --enable-gpl
--enable-version3 --disable-debug --cpu=nocona --enable-frei0r
--enable-libfreetype
  libavutil      52. 17.103 / 52. 17.103
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.102 / 54. 63.102
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 41.100 /  3. 41.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mpegts, from '/var/foto/Todo/video/orig/00000.MTS':
  Duration: 00:00:26.92, start: 0.801622, bitrate: 15704 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448),
yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz,
stereo, fltp, 256 kb/s
    Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] /
0x0090)
Output #0, matroska, to 'test.mkv':
  Metadata:
    encoder         : Lavf54.63.102
    Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj420p, 1920x1080
[SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 1k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mjpeg)
Press [q] to stop, [?] for help
frame=  672 fps= 42 q=0.0 Lsize=  192964kB time=00:00:26.92
bitrate=58720.6kbits/s
video:192936kB audio:0kB subtitle:0 global headers:0kB muxing overhead
0.014176%
artemis erik:~LD_LIBRARY_PATH $ ls test.mkv
189M test.mkv
artemis erik:~LD_LIBRARY_PATH $ ./ffmpeg -y -i
/var/foto/Todo/video/orig/00000.MTS -an -sn -codec:v mjpeg -q:v 32 -f
matroska test.mkv
ffmpeg version N-50460-g393dcbf Copyright (c) 2000-2013 the FFmpeg
developers
  built on Mar  4 2013 12:54:46 with gcc 4.7.2 (GCC) 20120921 (Red Hat
4.7.2-2)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64
--enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libmp3lame --enable-libx264 --enable-shared --enable-gpl
--enable-version3 --disable-debug --cpu=nocona --enable-frei0r
--enable-libfreetype
  libavutil      52. 17.103 / 52. 17.103
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.102 / 54. 63.102
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 41.100 /  3. 41.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mpegts, from '/var/foto/Todo/video/orig/00000.MTS':
  Duration: 00:00:26.92, start: 0.801622, bitrate: 15704 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448),
yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz,
stereo, fltp, 256 kb/s
    Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] /
0x0090)
Output #0, matroska, to 'test.mkv':
  Metadata:
    encoder         : Lavf54.63.102
    Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj420p, 1920x1080
[SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 1k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mjpeg)
Press [q] to stop, [?] for help
frame=  672 fps= 38 q=0.0 Lsize=   39080kB time=00:00:26.92
bitrate=11892.5kbits/s
video:39053kB audio:0kB subtitle:0 global headers:0kB muxing overhead
0.069464%
artemis erik:~LD_LIBRARY_PATH $ ls test.mkv

39M test.mkv

------------------------------------ >-8 -----------------------------

Looks like the file indeed gets smaller, so I suppose it's a minor
cosmetic issue? The "q=" output remains at "0.0" all of the time and the
bitrate output doesn't seem to change very much between different -q
values. When I change the output codec to mpeg2video, the "q=" output
reflects the actually used q value.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3740 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20130304/9f52fc80/attachment.p7s>


More information about the ffmpeg-user mailing list