mp4 encode 1 frame out of sync

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

mp4 encode 1 frame out of sync

speedyrazor
Hi, I am encoding a Quicktime Prores file to mp4 using the below settings. In the resulting file, the audio is 1 frame out of sync, audio comes in 1 frame early, cutting off the first frame and adding 1 silent frame to the end (see attached screen grab)."F:\ffmpeg copy\ffmpeg-20160115-git-b58cfa6-win32-static\ffmpeg-20160115-git-b58cfa6-win32-static\bin\ffmpeg.exe" -i small_test.mov -c:v libx264 -crf 23 -preset medium -vsync 1 -pix_fmt yuv420p -c:a aac -strict -2 -b:a 128k -y"\\10.0.1.103\Studio Canal 1_1\KEVS_TEMP\small_test.mp4" -report
And here is the output:"F:\ffmpeg copy\ffmpeg-20160115-git-b58cfa6-win32-static\ffmpeg-20160115-git-b58cfa6-win32-static\bin\ffmpeg.exe" -i small_test.mov -c:v libx264 -crf 23 -preset medium -vsync 1 -pix_fmt yuv420p -c:a aac -strict -2 -b:a 128k -y"\\10.0.1.103\Studio Canal 1_1\KEVS_TEMP\small_test.mp4" -report
ffmpeg started on 2016-01-15 at 12:54:22
Report written to "ffmpeg-20160115-125422.log"
ffmpeg version N-77870-gb58cfa6 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 13.100 / 55. 13.100
  libavcodec     57. 22.100 / 57. 22.100
  libavformat    57. 21.101 / 57. 21.101
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 24.100 /  6. 24.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0029ea60] ignoring 'frma' atom of 'in24', stream format is 'in24'
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'small_test.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2016-01-15 11:40:41
    com.apple.finalcutstudio.media.uuid: 3BA55888-679C-4D73-8159-6EBA831BB0EC
    com.apple.quicktime.player.movie.audio.gain: 1.000000
    com.apple.quicktime.player.movie.audio.treble: 0.000000
    com.apple.quicktime.player.movie.audio.bass: 0.000000
    com.apple.quicktime.player.movie.audio.balance: 0.000000
    com.apple.quicktime.player.movie.audio.pitchshift: 0.000000
    com.apple.quicktime.player.movie.audio.mute:
    com.apple.quicktime.player.movie.visual.brightness: 0.000000
    com.apple.quicktime.player.movie.visual.color: 1.000000
    com.apple.quicktime.player.movie.visual.tint: 0.000000
    com.apple.quicktime.player.movie.visual.contrast: 1.000000
    com.apple.quicktime.player.version: 7.6.6 (7.6.6)
    com.apple.quicktime.version: 7.7.3 (2943) 0x7738000 (Mac OS X, 10.11.2, 15C50)
    timecode        : 00:00:00:00
  Duration: 00:00:05.01, start: 0.000000, bitrate: 183947 kb/s
    Stream #0:0(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s (default)
    Metadata:
      creation_time   : 2016-01-15 11:40:41
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      creation_time   : 2016-01-15 11:40:41
      handler_name    : Apple Alias Data Handler
      timecode        : 00:00:00:00
    Stream #0:2(eng): Video: prores (apch / 0x68637061), yuv422p10le(bt709), 1920x1080, 174712 kb/s, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 23976 tbn, 23976 tbc (default)
    Metadata:
      creation_time   : 2016-01-15 11:44:53
      handler_name    : Apple Alias Data Handler
      encoder         : Apple ProRes 422 HQ
      timecode        : 00:00:00:00
[libx264 @ 00a1b0e0] using SAR=1/1
[libx264 @ 00a1b0e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX LZCNT
[libx264 @ 00a1b0e0] profile High, level 4.0
[libx264 @ 00a1b0e0] 264 - core 148 r2638 7599210 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '\\10.0.1.103\Studio Canal 1_1\KEVS_TEMP\small_test.mp4':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    timecode        : 00:00:00:00
    com.apple.finalcutstudio.media.uuid: 3BA55888-679C-4D73-8159-6EBA831BB0EC
    com.apple.quicktime.player.movie.audio.gain: 1.000000
    com.apple.quicktime.player.movie.audio.treble: 0.000000
    com.apple.quicktime.player.movie.audio.bass: 0.000000
    com.apple.quicktime.player.movie.audio.balance: 0.000000
    com.apple.quicktime.player.movie.audio.pitchshift: 0.000000
    com.apple.quicktime.player.movie.audio.mute:
    com.apple.quicktime.player.movie.visual.brightness: 0.000000
    com.apple.quicktime.player.movie.visual.color: 1.000000
    com.apple.quicktime.player.movie.visual.tint: 0.000000
    com.apple.quicktime.player.movie.visual.contrast: 1.000000
    com.apple.quicktime.player.version: 7.6.6 (7.6.6)
    com.apple.quicktime.version: 7.7.3 (2943) 0x7738000 (Mac OS X, 10.11.2, 15C50)
    encoder         : Lavf57.21.101
    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 23.98 fps, 11988 tbn, 23.98 tbc (default)
    Metadata:
      creation_time   : 2016-01-15 11:44:53
      handler_name    : Apple Alias Data Handler
      timecode        : 00:00:00:00
      encoder         : Lavc57.22.100 libx264
    Side data:
      unknown side data type 10 (24 bytes)
    Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp (24 bit), 128 kb/s (default)
    Metadata:
      creation_time   : 2016-01-15 11:40:41
      handler_name    : Apple Alias Data Handler
      encoder         : Lavc57.22.100 aac
Stream mapping:
  Stream #0:2 -> #0:0 (prores (native) -> h264 (libx264))
  Stream #0:0 -> #0:1 (pcm_s24le (native) -> aac (native))
Press [q] to stop, [?] for help
frame=    7 fps=0.0 q=0.0 size=       0kB time=00:00:00.93 bitrate=   0.4kbits/s
frame=   15 fps=0.0 q=0.0 size=       0kB time=00:00:01.45 bitrate=   0.3kbits/s
frame=   24 fps= 16 q=0.0 size=       0kB time=00:00:01.47 bitrate=   0.3kbits/s
frame=   33 fps= 16 q=0.0 size=       0kB time=00:00:01.94 bitrate=   0.2kbits/s
frame=   41 fps= 16 q=0.0 size=       0kB time=00:00:02.45 bitrate=   0.2kbits/s
frame=   43 fps= 13 q=28.0 size=      66kB time=00:00:02.45 bitrate= 219.2kbits/
frame=   47 fps= 12 q=28.0 size=     131kB time=00:00:02.45 bitrate= 438.3kbits/
frame=   50 fps= 12 q=28.0 size=     176kB time=00:00:02.94 bitrate= 488.6kbits/
frame=   54 fps= 11 q=28.0 size=     247kB time=00:00:02.94 bitrate= 687.9kbits/
frame=   57 fps= 10 q=28.0 size=     314kB time=00:00:02.94 bitrate= 873.9kbits/
frame=   60 fps= 10 q=28.0 size=     365kB time=00:00:02.94 bitrate=1017.0kbits/
frame=   63 fps=9.6 q=28.0 size=     422kB time=00:00:03.45 bitrate= 999.6kbits/
frame=   67 fps=9.3 q=28.0 size=     501kB time=00:00:03.45 bitrate=1188.6kbits/
frame=   71 fps=9.0 q=28.0 size=     584kB time=00:00:03.45 bitrate=1383.2kbits/
frame=   74 fps=8.7 q=28.0 size=     638kB time=00:00:03.94 bitrate=1323.5kbits/
frame=   78 fps=8.6 q=28.0 size=     739kB time=00:00:03.94 bitrate=1534.9kbits/
frame=   82 fps=8.6 q=28.0 size=     774kB time=00:00:03.94 bitrate=1607.4kbits/
frame=   86 fps=8.5 q=28.0 size=     804kB time=00:00:04.43 bitrate=1483.9kbits/
frame=   90 fps=8.4 q=28.0 size=     834kB time=00:00:04.43 bitrate=1539.2kbits/
frame=   94 fps=8.4 q=28.0 size=     867kB time=00:00:04.43 bitrate=1600.8kbits/
frame=   98 fps=8.3 q=28.0 size=     892kB time=00:00:04.94 bitrate=1476.2kbits/
frame=  103 fps=8.3 q=25.0 size=    1038kB time=00:00:04.94 bitrate=1718.4kbits/
frame=  107 fps=8.2 q=28.0 size=    1097kB time=00:00:04.94 bitrate=1815.6kbits/
frame=  110 fps=8.1 q=28.0 size=    1142kB time=00:00:04.94 bitrate=1891.0kbits/
frame=  113 fps=8.0 q=28.0 size=    1181kB time=00:00:04.94 bitrate=1955.4kbits/
frame=  117 fps=7.9 q=28.0 size=    1224kB time=00:00:04.94 bitrate=2026.7kbits/
frame=  120 fps=7.8 q=28.0 size=    1262kB time=00:00:04.94 bitrate=2089.3kbits/
frame=  120 fps=6.5 q=28.0 Lsize=    1731kB time=00:00:05.01 bitrate=2828.2kbits/s speed=0.272x
video:1648kB audio:78kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.272244%
[libx264 @ 00a1b0e0] frame I:4     Avg QP:18.33  size: 98366
[libx264 @ 00a1b0e0] frame P:41    Avg QP:22.74  size: 21005
[libx264 @ 00a1b0e0] frame B:75    Avg QP:24.30  size:  5759
[libx264 @ 00a1b0e0] consecutive B-frames:  5.0% 30.0% 15.0% 50.0%
[libx264 @ 00a1b0e0] mb I  I16..4: 30.8% 57.7% 11.5%
[libx264 @ 00a1b0e0] mb P  I16..4:  0.6%  1.4%  0.6%  P16..4: 23.3%  6.5%  5.5% 0.0%  0.0%    skip:62.1%
[libx264 @ 00a1b0e0] mb B  I16..4:  0.1%  0.2%  0.0%  B16..8: 21.4%  1.3%  0.2% direct: 1.9%  skip:75.0%  L0:38.5% L1:55.9% BI: 5.6%
[libx264 @ 00a1b0e0] 8x8 transform intra:57.4% inter:79.3%
[libx264 @ 00a1b0e0] coded y,uvDC,uvAC intra: 50.3% 52.7% 28.2% inter: 8.0% 8.7% 0.1%
[libx264 @ 00a1b0e0] i16 v,h,dc,p: 53% 26%  6% 15%
[libx264 @ 00a1b0e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 26% 22%  4%  5%  6%  6% 5%  6%
[libx264 @ 00a1b0e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 29% 11%  4%  6%  6%  6% 5%  5%
[libx264 @ 00a1b0e0] i8c dc,h,v,p: 59% 22% 15%  4%
[libx264 @ 00a1b0e0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 00a1b0e0] ref P L0: 61.9% 12.7% 18.1%  7.4%
[libx264 @ 00a1b0e0] ref B L0: 82.1% 14.6%  3.2%
[libx264 @ 00a1b0e0] ref B L1: 94.2%  5.8%
[libx264 @ 00a1b0e0] kb/s:2695.87
[aac @ 00a1ca60] Qavg: 547.110    
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

Screen Shot 2016-01-15 at 12.55.11.jpg (126K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: mp4 encode 1 frame out of sync

Carl Eugen Hoyos
Kevin Wells <kevwells <at> hotmail.co.uk> writes:

> Hi, I am encoding a Quicktime Prores file to mp4
> using the below settings. In the resulting file,
> the audio is 1 frame out of sync, audio comes in
> 1 frame early

How do you test this issue?

Is it only reproducible with x264 or also with
-vcodec mpeg4 -qscale 2?

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: mp4 encode 1 frame out of sync

speedyrazor
In reply to this post by speedyrazor

From: [hidden email]
To: [hidden email]
Subject: mp4 encode 1 frame out of sync
Date: Fri, 15 Jan 2016 13:09:54 +0000

Hi, I am encoding a Quicktime Prores file to mp4 using the below settings. In the resulting file, the audio is 1 frame out of sync, audio comes in 1 frame early, cutting off the first frame and adding 1 silent frame to the end (see attached screen grab)."F:\ffmpeg copy\ffmpeg-20160115-git-b58cfa6-win32-static\ffmpeg-20160115-git-b58cfa6-win32-static\bin\ffmpeg.exe" -i small_test.mov -c:v libx264 -crf 23 -preset medium -vsync 1 -pix_fmt yuv420p -c:a aac -strict -2 -b:a 128k -y"\\10.0.1.103\Studio Canal 1_1\KEVS_TEMP\small_test.mp4" -report
And here is the output:"F:\ffmpeg copy\ffmpeg-20160115-git-b58cfa6-win32-static\ffmpeg-20160115-git-b58cfa6-win32-static\bin\ffmpeg.exe" -i small_test.mov -c:v libx264 -crf 23 -preset medium -vsync 1 -pix_fmt yuv420p -c:a aac -strict -2 -b:a 128k -y"\\10.0.1.103\Studio Canal 1_1\KEVS_TEMP\small_test.mp4" -report
ffmpeg started on 2016-01-15 at 12:54:22
Report written to "ffmpeg-20160115-125422.log"
ffmpeg version N-77870-gb58cfa6 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 13.100 / 55. 13.100
  libavcodec     57. 22.100 / 57. 22.100
  libavformat    57. 21.101 / 57. 21.101
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 24.100 /  6. 24.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0029ea60] ignoring 'frma' atom of 'in24', stream format is 'in24'
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'small_test.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2016-01-15 11:40:41
    com.apple.finalcutstudio.media.uuid: 3BA55888-679C-4D73-8159-6EBA831BB0EC
    com.apple.quicktime.player.movie.audio.gain: 1.000000
    com.apple.quicktime.player.movie.audio.treble: 0.000000
    com.apple.quicktime.player.movie.audio.bass: 0.000000
    com.apple.quicktime.player.movie.audio.balance: 0.000000
    com.apple.quicktime.player.movie.audio.pitchshift: 0.000000
    com.apple.quicktime.player.movie.audio.mute:
    com.apple.quicktime.player.movie.visual.brightness: 0.000000
    com.apple.quicktime.player.movie.visual.color: 1.000000
    com.apple.quicktime.player.movie.visual.tint: 0.000000
    com.apple.quicktime.player.movie.visual.contrast: 1.000000
    com.apple.quicktime.player.version: 7.6.6 (7.6.6)
    com.apple.quicktime.version: 7.7.3 (2943) 0x7738000 (Mac OS X, 10.11.2, 15C50)
    timecode        : 00:00:00:00
  Duration: 00:00:05.01, start: 0.000000, bitrate: 183947 kb/s
    Stream #0:0(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s (default)
    Metadata:
      creation_time   : 2016-01-15 11:40:41
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      creation_time   : 2016-01-15 11:40:41
      handler_name    : Apple Alias Data Handler
      timecode        : 00:00:00:00
    Stream #0:2(eng): Video: prores (apch / 0x68637061), yuv422p10le(bt709), 1920x1080, 174712 kb/s, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 23976 tbn, 23976 tbc (default)
    Metadata:
      creation_time   : 2016-01-15 11:44:53
      handler_name    : Apple Alias Data Handler
      encoder         : Apple ProRes 422 HQ
      timecode        : 00:00:00:00
[libx264 @ 00a1b0e0] using SAR=1/1
[libx264 @ 00a1b0e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX LZCNT
[libx264 @ 00a1b0e0] profile High, level 4.0
[libx264 @ 00a1b0e0] 264 - core 148 r2638 7599210 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '\\10.0.1.103\Studio Canal 1_1\KEVS_TEMP\small_test.mp4':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    timecode        : 00:00:00:00
    com.apple.finalcutstudio.media.uuid: 3BA55888-679C-4D73-8159-6EBA831BB0EC
    com.apple.quicktime.player.movie.audio.gain: 1.000000
    com.apple.quicktime.player.movie.audio.treble: 0.000000

From: cehoyos at ag.or.at
To: [hidden email]
Subject: mp4 encode 1 frame out of sync
How do you test this issue?
Is it only reproducible with x264 or also with
-vcodec mpeg4 -qscale 2?

Carl Eugen--------------------------Sorry, about the formatting, I had to cobble this email together.I am testing this by opening the original file and the ffmpeg encoded file in Final Cut Pro and viewing them on the timeline.I tested with -vcodec mpeg4 -qscale 2, and got the same result, I have attached the a screen grab of that encode. As you can see I have had to shift the ffmpeg encoded audio by 1 frame to get it back into sync.Kind regards.
         
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

ffmpeg_screen_grab.jpg (112K) Download Attachment