Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques Duplicates first frame when exporting .mp4 from source .mp2 or .mp4

  • Duplicates first frame when exporting .mp4 from source .mp2 or .mp4

    Posted by Thomas Demirian on August 11, 2014 at 9:18 am

    ffmpeg always ads a duplicate frame of the first frame to my clips when I export a .mp4 file from a source .mpeg or mp4. And by doing that it always make the clip one frame longer.

    If I use an uncompressed format as source everything is fine.

    Does anyone have a solution?

    Thomas Demirian replied 11 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Jim Sustacek

    August 12, 2014 at 12:13 pm

    Probably going to need the full ffmpeg command and console output, if not a link to a sample file too.

  • Thomas Demirian

    August 12, 2014 at 12:58 pm

    My source file is 20 seconds. The exported video according to MEDIA INFO is: 20s87ms. The video is 20s40ms and the audio is 20s87ms.

    And when I open the file in Any adobe application it also shows one frame more. And its placed in the beginning. A duplicate of the first frame.

    ffmpeg command

    ffmpeg -y -i x.mp4 -pix_fmt yuv420p -direct-pred auto -aspect 16:9 -s 1024x576 -vcodec libx264 -bufsize 2500k -b:v 2500k -vmaxrate 3000k -vminrate 200k -vprofile baseline -level 3.1 -g 100 -bf 3 -x264opts b-pyramid=0 -coder 0 -movflags faststart -pass 1 -an -f rawvideo /dev/null && \
    ffmpeg -y -i x.mp4 -pix_fmt yuv420p -direct-pred auto -aspect 16:9 -s 1024x576 -vcodec libx264 -bufsize 2500k -b:v 2500k -vmaxrate 3000k -vminrate 200k -vprofile baseline -level 3.1 -g 100 -bf 3 -x264opts b-pyramid=0 -coder 0 -movflags faststart -acodec libvo_aacenc -ar 48000 -b:a 128000 -aprofile aac_low -ac 2 -f mp4 -preset slow -pass 2 \
    high1.mp4

    Console Output

    Last login: Tue Aug 12 14:50:49 on ttys000
    Thomas-MacBook-Pro:~ Thomas$ cd /Users/Thomas/Desktop/Redmine_and_Others/2001_Proxy_for_ecexpress/Download
    Thomas-MacBook-Pro:Download Thomas$ ffmpeg -y -i x.mp4 -pix_fmt yuv420p -direct-pred auto -aspect 16:9 -s 1024x576 -vcodec libx264 -bufsize 2500k -b:v 2500k -vmaxrate 3000k -vminrate 200k -vprofile baseline -level 3.1 -g 100 -bf 3 -x264opts b-pyramid=0 -coder 0 -movflags faststart -pass 1 -an -f rawvideo /dev/null && \
    > ffmpeg -y -i x.mp4 -pix_fmt yuv420p -direct-pred auto -aspect 16:9 -s 1024x576 -vcodec libx264 -bufsize 2500k -b:v 2500k -vmaxrate 3000k -vminrate 200k -vprofile baseline -level 3.1 -g 100 -bf 3 -x264opts b-pyramid=0 -coder 0 -movflags faststart -acodec libvo_aacenc -ar 48000 -b:a 128000 -aprofile aac_low -ac 2 -f mp4 -preset slow -pass 2 \
    > high1.mp4
    ffmpeg version 2.2.4-tessus Copyright (c) 2000-2014 the FFmpeg developers
    built on Jun 29 2014 16:35:46 with clang version 3.3 (tags/RELEASE_33/final)
    configuration: --cc=/opt/local/bin/clang-mp-3.3 --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-libmodplug --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --disable-indev=qtkit --enable-runtime-cpudetect
    libavutil 52. 66.100 / 52. 66.100
    libavcodec 55. 52.102 / 55. 52.102
    libavformat 55. 33.100 / 55. 33.100
    libavdevice 55. 10.100 / 55. 10.100
    libavfilter 4. 2.100 / 4. 2.100
    libswscale 2. 5.102 / 2. 5.102
    libswresample 0. 18.100 / 0. 18.100
    libpostproc 52. 3.100 / 52. 3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'x.mp4':
    Metadata:
    major_brand : mp42
    minor_version : 0
    compatible_brands: mp42mp41
    creation_time : 2014-05-13 19:22:28
    Duration: 00:00:20.05, start: 0.000000, bitrate: 47586 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 47387 kb/s, 25 fps, 25 tbr, 50k tbn, 50 tbc (default)
    Metadata:
    creation_time : 2014-05-13 19:22:28
    handler_name : Alias Data Handler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
    Metadata:
    creation_time : 2014-05-13 19:22:28
    handler_name : Alias Data Handler
    [libx264 @ 0x103000600] using SAR=1/1
    [libx264 @ 0x103000600] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
    [libx264 @ 0x103000600] profile Constrained Baseline, level 3.1
    Output #0, rawvideo, to '/dev/null':
    Metadata:
    major_brand : mp42
    minor_version : 0
    compatible_brands: mp42mp41
    encoder : Lavf55.33.100
    Stream #0:0(eng): Video: h264 (libx264), yuv420p, 1024x576 [SAR 1:1 DAR 16:9], q=-1--1, pass 1, 2500 kb/s, 90k tbn, 25 tbc (default)
    Metadata:
    creation_time : 2014-05-13 19:22:28
    handler_name : Alias Data Handler
    Stream mapping:
    Stream #0:0 -> #0:0 (h264 -> libx264)
    Press [q] to stop, [?] for help
    frame= 501 fps= 65 q=-1.0 Lsize= 6200kB time=00:00:20.04 bitrate=2534.3kbits/s dup=1 drop=0
    video:6200kB audio:0kB subtitle:0 data:0 global headers:0kB muxing overhead 0.000000%
    [libx264 @ 0x103000600] frame I:12 Avg QP:14.41 size: 64532
    [libx264 @ 0x103000600] frame P:489 Avg QP:16.86 size: 11399
    [libx264 @ 0x103000600] mb I I16..4: 38.1% 0.0% 61.9%
    [libx264 @ 0x103000600] mb P I16..4: 16.4% 0.0% 0.0% P16..4: 60.9% 0.0% 0.0% 0.0% 0.0% skip:22.8%
    [libx264 @ 0x103000600] coded y,uvDC,uvAC intra: 30.5% 60.4% 37.1% inter: 25.9% 27.1% 0.9%
    [libx264 @ 0x103000600] i16 v,h,dc,p: 68% 13% 14% 5%
    [libx264 @ 0x103000600] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 14% 14% 9% 8% 10% 6% 10% 6%
    [libx264 @ 0x103000600] i8c dc,h,v,p: 61% 15% 20% 4%
    [libx264 @ 0x103000600] kb/s:2534.32
    ffmpeg version 2.2.4-tessus Copyright (c) 2000-2014 the FFmpeg developers
    built on Jun 29 2014 16:35:46 with clang version 3.3 (tags/RELEASE_33/final)
    configuration: --cc=/opt/local/bin/clang-mp-3.3 --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-libmodplug --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --disable-indev=qtkit --enable-runtime-cpudetect
    libavutil 52. 66.100 / 52. 66.100
    libavcodec 55. 52.102 / 55. 52.102
    libavformat 55. 33.100 / 55. 33.100
    libavdevice 55. 10.100 / 55. 10.100
    libavfilter 4. 2.100 / 4. 2.100
    libswscale 2. 5.102 / 2. 5.102
    libswresample 0. 18.100 / 0. 18.100
    libpostproc 52. 3.100 / 52. 3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'x.mp4':
    Metadata:
    major_brand : mp42
    minor_version : 0
    compatible_brands: mp42mp41
    creation_time : 2014-05-13 19:22:28
    Duration: 00:00:20.05, start: 0.000000, bitrate: 47586 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 47387 kb/s, 25 fps, 25 tbr, 50k tbn, 50 tbc (default)
    Metadata:
    creation_time : 2014-05-13 19:22:28
    handler_name : Alias Data Handler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
    Metadata:
    creation_time : 2014-05-13 19:22:28
    handler_name : Alias Data Handler
    [libx264 @ 0x103094600] using SAR=1/1
    [libx264 @ 0x103094600] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
    [libx264 @ 0x103094600] profile Constrained Baseline, level 3.1
    [libx264 @ 0x103094600] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - https://www.videolan.org/x264.html - options: cabac=0 ref=5 deblock=1:0:0 analyse=0x1:0x111 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=100 keyint_min=10 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=2pass mbtree=1 bitrate=2500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 cplxblur=20.0 qblur=0.5 vbv_maxrate=3000 vbv_bufsize=2500 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'high1.mp4':
    Metadata:
    major_brand : mp42
    minor_version : 0
    compatible_brands: mp42mp41
    encoder : Lavf55.33.100
    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1024x576 [SAR 1:1 DAR 16:9], q=-1--1, pass 2, 2500 kb/s, 12800 tbn, 25 tbc (default)
    Metadata:
    creation_time : 2014-05-13 19:22:28
    handler_name : Alias Data Handler
    Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 128 kb/s (default)
    Metadata:
    creation_time : 2014-05-13 19:22:28
    handler_name : Alias Data Handler
    Stream mapping:
    Stream #0:0 -> #0:0 (h264 -> libx264)
    Stream #0:1 -> #0:1 (aac -> libvo_aacenc)
    Press [q] to stop, [?] for help
    [mp4 @ 0x103094000] Starting second pass: moving the moov atom to the beginning of the file0
    frame= 501 fps= 21 q=-1.0 Lsize= 6437kB time=00:00:20.06 bitrate=2628.2kbits/s dup=1 drop=0
    video:6110kB audio:314kB subtitle:0 data:0 global headers:0kB muxing overhead 0.191460%
    [libx264 @ 0x103094600] frame I:12 Avg QP:14.50 size: 70089
    [libx264 @ 0x103094600] frame P:489 Avg QP:17.35 size: 11073
    [libx264 @ 0x103094600] mb I I16..4: 23.5% 0.0% 76.5%
    [libx264 @ 0x103094600] mb P I16..4: 1.1% 0.0% 0.4% P16..4: 52.7% 19.7% 8.9% 0.0% 0.0% skip:17.2%
    [libx264 @ 0x103094600] coded y,uvDC,uvAC intra: 66.7% 86.1% 73.9% inter: 19.0% 38.2% 2.4%
    [libx264 @ 0x103094600] i16 v,h,dc,p: 64% 11% 9% 16%
    [libx264 @ 0x103094600] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 9% 5% 7% 14% 16% 16% 11% 14% 8%
    [libx264 @ 0x103094600] i8c dc,h,v,p: 56% 15% 19% 10%
    [libx264 @ 0x103094600] ref P L0: 59.0% 18.7% 12.3% 5.3% 4.7%
    [libx264 @ 0x103094600] kb/s:2497.35
    Thomas-MacBook-Pro:Download Thomas$

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy