[FFmpeg-user] Combining yuvj422p and yuvj420p

Cecil Westerhof Cecil at decebal.nl
Mon Aug 11 07:36:49 CEST 2014


Op Sunday 10 Aug 2014 16:56 CEST schreef Carl Eugen Hoyos:

> Cecil Westerhof <Cecil <at> decebal.nl> writes:
>
>> I want to combine pictures from two different sources 
>> in a slide-show.
>
> Please provide your command line and the complete, uncut 
> console output.
> The warning you see should not affect the output so I 
> don't understand what your problem is.

The commandline is:
    ffmpeg   -y \
             -i "/home/cecil/Pictures/bin/3.mp3" \
             -f image2 \
             -r 1 \
             -i "tempFrames/testing%03d.jpg" \
             -pix_fmt yuvj422p \
             -f avi \
             -vcodec mpeg4 \
             -metadata artist="Cecil Westerhof" \
             -metadata genre="" \
             -metadata title="testing" \
             -t "51" \
             -q 3 \
             "generated/testing.avi" 2>>"/home/cecil/Pictures/bin/tmp/testing.log"

There are 50 files in tempFrames. The first 25 (with are five
different pictures) are in yuvj422p, the second 25 (which are also 5
different pictures) are in yuvj420p.

In the logfile I get:
    ffmpeg version 2.1.1 Copyright (c) 2000-2013 the FFmpeg developers
      built on Dec 17 2013 19:47:47 with gcc 4.7 (SUSE Linux)
      configuration: --shlibdir=/usr/lib64 --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --enable-shared --disable-static --enable-debug --disable-stripping --extra-cflags='-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fPIC -I/usr/include/gsm' --enable-gpl --enable-x11grab --enable-version3 --enable-pthreads --enable-avfilter --enable-libpulse --enable-libvpx --enable-libopus --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libxvid --enable-libx264 --enable-libschroedinger --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-postproc --enable-libdc1394 --enable-librtmp --enable-libfreetype --enable-avresample --enable-libtwolame --enable-libvo-aacenc --enable-gnutls
      libavutil      52. 48.101 / 52. 48.101
      libavcodec     55. 39.101 / 55. 39.101
      libavformat    55. 19.104 / 55. 19.104
      libavdevice    55.  5.100 / 55.  5.100
      libavfilter     3. 90.100 /  3. 90.100
      libavresample   1.  1.  0 /  1.  1.  0
      libswscale      2.  5.101 /  2.  5.101
      libswresample   0. 17.104 /  0. 17.104
      libpostproc    52.  3.100 / 52.  3.100
    Input #0, mp3, from '/home/cecil/Pictures/bin/3.mp3':
      Metadata:
        title           : Clouds
        genre           : Classical
        artist          : Huma-Huma
        album           : YouTube Audio Library
        encoder         : Lavf55.19.104
      Duration: 00:04:03.04, start: 0.000000, bitrate: 128 kb/s
        Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
    Input #1, image2, from 'tempFrames/testing%03d.jpg':
      Duration: 00:00:50.00, start: 0.000000, bitrate: N/A
        Stream #1:0: Video: mjpeg, yuvj422p(pc), 1280x720 [SAR 180:180 DAR 16:9], 1 fps, 1 tbr, 1 tbn, 1 tbc
    Incompatible pixel format 'yuvj422p' for codec 'mpeg4', auto-selecting format 'yuv420p'
    [swscaler @ 0x1376080] deprecated pixel format used, make sure you did set range correctly
    Output #0, avi, to 'generated/testing.avi':
      Metadata:
        IPRD            : YouTube Audio Library
        IART            : Cecil Westerhof
        INAM            : testing
        ISFT            : Lavf55.19.104
        Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 1 tbn, 1 tbc
        Stream #0:1: Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16p
    Stream mapping:
      Stream #1:0 -> #0:0 (mjpeg -> mpeg4)
      Stream #0:0 -> #0:1 (mp3 -> libmp3lame)
    Press [q] to stop, [?] for help
    frame=   14 fps=0.0 q=3.0 size=    1640kB time=00:00:14.00 bitrate= 959.8kbits/s    
    Input stream #1:0 frame changed from size:1280x720 fmt:yuvj422p to size:1280x720 fmt:yuvj420p
    [swscaler @ 0x1376020] deprecated pixel format used, make sure you did set range correctly
    frame=   25 fps= 25 q=3.0 size=    2493kB time=00:00:25.00 bitrate= 816.8kbits/s dup=0 drop=14    
    frame=   26 fps= 17 q=3.0 size=    2760kB time=00:00:41.16 bitrate= 549.2kbits/s dup=0 drop=24    
    frame=   26 fps= 15 q=3.0 Lsize=    3272kB time=00:00:51.01 bitrate= 525.4kbits/s dup=0 drop=24    
    video:2296kB audio:920kB subtitle:0 global headers:0kB muxing overhead 1.774162%

I get an video that plays for 51 seconds. The first 5 pictures are
displayed correctly, but after picture five instead of the first
picture of the second sequence, the last picture is shown. So the
first four pictures of the second sequence are not shown.

By the way, when playing the video with smplayer, it thinks the video
is 26 seconds long. The info from ffmpeg about the video is:
    Input #0, avi, from 'generated/testing.avi':
      Metadata:
        artist          : Cecil Westerhof
        title           : testing
        album           : YouTube Audio Library
        encoder         : Lavf55.19.104
      Duration: 00:00:51.02, start: 0.000000, bitrate: 525 kb/s
        Stream #0:0: Video: mpeg4 (Simple Profile) (FMP4 / 0x34504D46), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1 fps, 1 tbr, 1 tbn, 1 tbc
        Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16p, 143 kb/s

Again, the first 25 files have the format:
    Stream #0:0: Video: mjpeg, yuvj422p(pc), 1280x720 [SAR 180:180 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
the second 25 have the format (which generates the problem):
    Stream #0:0: Video: mjpeg, yuvj420p(pc), 1280x720 [SAR 72:72 DAR 16:9], 25 tbr, 25 tbn, 25 tbc


-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof


More information about the ffmpeg-user mailing list