Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#2696 closed defect (needs_more_info)

Audio/Video sync issues when reducing fps from 59.94 to 29.97

Reported by: Shital Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When I transcode the source video (dejavu_20mb.mp4) which is at 59.97 fps down to 29.97 fps (dejavu_2997.mp4), I can see some lip sync issues indicating that there is some audio/video sync issue.
I don't see any problem when I transcode at the same fps (dejavu_5994.mp4)

How to reproduce:

ffmpeg -i dejavu_20mb.mp4 -r 29.97 dejavu_2997.mp4
ffmpeg version 1.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on May 27 2013 10:30:08 with gcc 3.4.6 (GCC) 20060404 (Red Hat 3.4.6-9)
  configuration: --enable-gpl --enable-version3 --enable-zlib --enable-bzlib --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libmp3lame --enable-libxvid --enable-libx264 --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-libfdk_aac --enable-libvpx --enable-libgsm --extra-libs=-static --enable-nonfree --enable-libfreetype
  libavutil      52. 13.100 / 52. 13.100
  libavcodec     54. 86.100 / 54. 86.100
  libavformat    54. 59.106 / 54. 59.106
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 32.100 /  3. 32.100
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'dejavu_20mb.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2013-06-10 21:03:17
  Duration: 00:02:41.34, start: 0.000000, bitrate: 1039 kb/s
    Stream #0:0(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      creation_time   : 2013-06-10 21:10:02
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720, 8684 kb/s, 59.94 fps, 59.94 tbr, 5994 tbn, 11988 tbc
    Metadata:
      creation_time   : 2013-06-10 21:10:02
      handler_name    : Apple Alias Data Handler
[libx264 @ 0x1cc905e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
[libx264 @ 0x1cc905e0] profile High, level 3.1
[libx264 @ 0x1cc905e0] 264 - core 128 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - 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.00 mixed_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=3 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=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 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 'dejavu_2997.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    encoder         : Lavf54.59.106
    Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x720, q=-1--1, 11988 tbn, 29.97 tbc
    Metadata:
      creation_time   : 2013-06-10 21:10:02
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 139 kb/s
    Metadata:
      creation_time   : 2013-06-10 21:10:02
      handler_name    : Apple Alias Data Handler
Stream mapping:
  Stream #0:1 -> #0:0 (h264 -> libx264)
  Stream #0:0 -> #0:1 (pcm_s16le -> libfdk_aac)
Press [q] to stop, [?] for help
Truncating packet of size 48235 to 21094kB time=00:00:10.45 bitrate=1327.0kbits/s dup=0 drop=305    
[h264 @ 0x1d32f340] AVC: nal size 7357
    Last message repeated 1 times
[h264 @ 0x1d32f340] concealing 2250 DC, 2250 AC, 2250 MV errors in P frame
frame=  314 fps= 19 q=-1.0 Lsize=    2206kB time=00:00:10.51 bitrate=1718.6kbits/s dup=0 drop=308    
video:2014kB audio:180kB subtitle:0 global headers:0kB muxing overhead 0.563787%
[libx264 @ 0x1cc905e0] frame I:3     Avg QP:22.44  size: 52646
[libx264 @ 0x1cc905e0] frame P:95    Avg QP:24.12  size: 13286
[libx264 @ 0x1cc905e0] frame B:216   Avg QP:26.36  size:  2970
[libx264 @ 0x1cc905e0] consecutive B-frames:  7.0%  1.3%  7.6% 84.1%
[libx264 @ 0x1cc905e0] mb I  I16..4: 26.8% 46.5% 26.7%
[libx264 @ 0x1cc905e0] mb P  I16..4:  4.9%  7.4%  1.2%  P16..4: 45.3%  8.6%  5.8%  0.0%  0.0%    skip:26.7%
[libx264 @ 0x1cc905e0] mb B  I16..4:  0.1%  0.1%  0.0%  B16..8: 34.6%  1.6%  0.2%  direct: 1.4%  skip:62.0%  L0:47.3% L1:49.4% BI: 3.3%
[libx264 @ 0x1cc905e0] 8x8 transform intra:52.9% inter:84.7%
[libx264 @ 0x1cc905e0] coded y,uvDC,uvAC intra: 43.8% 51.0% 13.3% inter: 9.3% 23.1% 0.4%
[libx264 @ 0x1cc905e0] i16 v,h,dc,p: 32% 28% 10% 30%
[libx264 @ 0x1cc905e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 14% 29% 18%  4%  4%  3%  4%  6%
[libx264 @ 0x1cc905e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 22% 19% 11%  5%  6%  4%  4%  4%
[libx264 @ 0x1cc905e0] i8c dc,h,v,p: 54% 21% 22%  3%
[libx264 @ 0x1cc905e0] Weighted P-Frames: Y:1.1% UV:1.1%
[libx264 @ 0x1cc905e0] ref P L0: 51.4% 10.5% 28.7%  9.4%  0.0%
[libx264 @ 0x1cc905e0] ref B L0: 68.8% 21.5%  9.8%
[libx264 @ 0x1cc905e0] ref B L1: 83.7% 16.3%
[libx264 @ 0x1cc905e0] kb/s:1574.27

Following transcode does not have this lip sync issue:

ffmpeg -i dejavu_20mb.mp4  dejavu_5994.mp4
ffmpeg version 1.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on May 27 2013 10:30:08 with gcc 3.4.6 (GCC) 20060404 (Red Hat 3.4.6-9)
  configuration: --enable-gpl --enable-version3 --enable-zlib --enable-bzlib --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libmp3lame --enable-libxvid --enable-libx264 --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-libfdk_aac --enable-libvpx --enable-libgsm --extra-libs=-static --enable-nonfree --enable-libfreetype
  libavutil      52. 13.100 / 52. 13.100
  libavcodec     54. 86.100 / 54. 86.100
  libavformat    54. 59.106 / 54. 59.106
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 32.100 /  3. 32.100
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'dejavu_20mb.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2013-06-10 21:03:17
  Duration: 00:02:41.34, start: 0.000000, bitrate: 1039 kb/s
    Stream #0:0(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      creation_time   : 2013-06-10 21:10:02
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720, 8684 kb/s, 59.94 fps, 59.94 tbr, 5994 tbn, 11988 tbc
    Metadata:
      creation_time   : 2013-06-10 21:10:02
      handler_name    : Apple Alias Data Handler
[libx264 @ 0x894d3c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
[libx264 @ 0x894d3c0] profile High, level 3.2
[libx264 @ 0x894d3c0] 264 - core 128 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - 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.00 mixed_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=3 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=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 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 'dejavu_5994.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    encoder         : Lavf54.59.106
    Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x720, q=-1--1, 11988 tbn, 59.94 tbc
    Metadata:
      creation_time   : 2013-06-10 21:10:02
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 139 kb/s
    Metadata:
      creation_time   : 2013-06-10 21:10:02
      handler_name    : Apple Alias Data Handler
Stream mapping:
  Stream #0:1 -> #0:0 (h264 -> libx264)
  Stream #0:0 -> #0:1 (pcm_s16le -> libfdk_aac)
Press [q] to stop, [?] for help
Truncating packet of size 48235 to 21094kB time=00:00:10.45 bitrate=1628.7kbits/s    
[h264 @ 0x8fec440] AVC: nal size 7357
    Last message repeated 1 times
[h264 @ 0x8fec440] concealing 2250 DC, 2250 AC, 2250 MV errors in P frame
frame=  623 fps= 24 q=-1.0 Lsize=    2498kB time=00:00:10.51 bitrate=1945.9kbits/s dup=1 drop=0    
video:2301kB audio:180kB subtitle:0 global headers:0kB muxing overhead 0.696050%
[libx264 @ 0x894d3c0] frame I:5     Avg QP:23.28  size: 39919
[libx264 @ 0x894d3c0] frame P:180   Avg QP:25.53  size:  8264
[libx264 @ 0x894d3c0] frame B:438   Avg QP:28.27  size:  1526
[libx264 @ 0x894d3c0] consecutive B-frames:  5.8%  1.0%  1.4% 91.8%
[libx264 @ 0x894d3c0] mb I  I16..4: 28.0% 54.2% 17.8%
[libx264 @ 0x894d3c0] mb P  I16..4:  3.3%  3.7%  0.6%  P16..4: 40.9%  5.7%  3.7%  0.0%  0.0%    skip:42.1%
[libx264 @ 0x894d3c0] mb B  I16..4:  0.1%  0.0%  0.0%  B16..8: 27.4%  0.5%  0.1%  direct: 0.3%  skip:71.6%  L0:43.7% L1:54.7% BI: 1.5%
[libx264 @ 0x894d3c0] 8x8 transform intra:49.9% inter:86.0%
[libx264 @ 0x894d3c0] coded y,uvDC,uvAC intra: 39.5% 51.3% 12.0% inter: 4.9% 13.7% 0.1%
[libx264 @ 0x894d3c0] i16 v,h,dc,p: 30% 31% 13% 26%
[libx264 @ 0x894d3c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 14% 32% 17%  3%  3%  3%  4%  6%
[libx264 @ 0x894d3c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 24% 19%  9%  5%  5%  4%  4%  3%
[libx264 @ 0x894d3c0] i8c dc,h,v,p: 57% 21% 21%  2%
[libx264 @ 0x894d3c0] Weighted P-Frames: Y:0.6% UV:0.6%
[libx264 @ 0x894d3c0] ref P L0: 52.0% 10.6% 29.1%  8.4%  0.0%
[libx264 @ 0x894d3c0] ref B L0: 65.4% 22.8% 11.8%
[libx264 @ 0x894d3c0] ref B L1: 81.0% 19.0%
[libx264 @ 0x894d3c0] kb/s:1812.97

Change History (15)

comment:1 by Shital, 11 years ago

Original file at 59.94 fps (dejavu 20mb.mp4): http://www.datafilehost.com/download-dc00c97d.html

Transcoded file at 29.97 fps with lip sync issues (dejavu 2997.mp4): http://www.datafilehost.com/download-e6806248.html

Transcoded file at 59.94 fps with no lip sync issues (dejavu 5994.mp4): http://www.datafilehost.com/download-34a44754.html

comment:2 by Shital, 11 years ago

I also transcoded the same video using a commercial transcoder tool (rhozet) and it seems to transcode video to 29.97 without introducing lip sync issues. Transcoded file at : http://www.datafilehost.com/download-0a9f3b1c.html

comment:3 by Carl Eugen Hoyos, 11 years ago

Is this only reproducible if you use an external codec library (libx264 and libfdk) or also with native encoders, ie -vcodec mpeg4 -acodec aac -strict -2 ?

in reply to:  2 comment:4 by Carl Eugen Hoyos, 11 years ago

Replying to smblr75:

I also transcoded the same video using a commercial transcoder tool (rhozet)

Unrelated to this ticket: Could you send us the EULA that is shipped with the Rhozet transcoder tool?

comment:5 by Carl Eugen Hoyos, 11 years ago

I originally missed that you were using a six months old version of FFmpeg: Please test current git head.

comment:6 by Shital, 11 years ago

Thanks for the quick reply. I took the latest ffmpeg and x264 from the version control and rebuilt ffmpeg. I still see the same lip sync issue. Uploaded the file at http://www.datafilehost.com/download-cacda369.html

ffmpeg -i dejavu_orig.mp4 -r 29.97 -s 848x476 -g 15 ff_2997_gop_15.mp4
ffmpeg version N-54152-g730e07f Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun 23 2013 13:27:07 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4)
  configuration: --enable-gpl --enable-version3 --enable-zlib --enable-bzlib --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libmp3lame --enable-libxvid --enable-libx264 --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-libfdk_aac --enable-libvpx --enable-libgsm --enable-nonfree --enable-shared --enable-static
  libavutil      52. 37.101 / 52. 37.101
  libavcodec     55. 16.100 / 55. 16.100
  libavformat    55.  9.100 / 55.  9.100
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 77.101 /  3. 77.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'dejavu_orig.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2013-06-10 21:03:17
  Duration: 00:02:41.34, start: 0.000000, bitrate: 10227 kb/s
    Stream #0:0(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      creation_time   : 2013-06-10 21:10:02
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720, 8684 kb/s, 59.94 fps, 59.94 tbr, 5994 tbn, 11988 tbc
    Metadata:
      creation_time   : 2013-06-10 21:10:02
      handler_name    : Apple Alias Data Handler
[libx264 @ 0x12ab400] using cpu capabilities: MMX2 SSE Cache64 BMI1
[libx264 @ 0x12ab400] profile High, level 3.1
[libx264 @ 0x12ab400] 264 - core 133 r2334M a3ac64b - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - 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.00 mixed_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=6 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=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=15 keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=15 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 'ff_2997_gop_15.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    encoder         : Lavf55.9.100
    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 848x476, q=-1--1, 11988 tbn, 29.97 tbc
    Metadata:
      creation_time   : 2013-06-10 21:10:02
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 139 kb/s
    Metadata:
      creation_time   : 2013-06-10 21:10:02
      handler_name    : Apple Alias Data Handler
Stream mapping:
  Stream #0:1 -> #0:0 (h264 -> libx264)
  Stream #0:0 -> #0:1 (pcm_s16le -> libfdk_aac)
Press [q] to stop, [?] for help
frame= 4838 fps= 42 q=-1.0 Lsize=   23685kB time=00:02:41.36 bitrate=1202.4kbits/s dup=0 drop=4833    
video:20764kB audio:2751kB subtitle:0 global headers:0kB muxing overhead 0.725098%
[libx264 @ 0x12ab400] frame I:331   Avg QP:19.79  size: 42081
[libx264 @ 0x12ab400] frame P:1844  Avg QP:24.27  size:  3090
[libx264 @ 0x12ab400] frame B:2663  Avg QP:26.69  size:   614
[libx264 @ 0x12ab400] consecutive B-frames: 22.1% 10.9%  7.5% 59.4%
[libx264 @ 0x12ab400] mb I  I16..4: 12.1% 53.8% 34.1%
[libx264 @ 0x12ab400] mb P  I16..4:  1.8%  3.1%  1.0%  P16..4: 19.5%  5.4%  3.4%  0.0%  0.0%    skip:65.8%
[libx264 @ 0x12ab400] mb B  I16..4:  0.1%  0.0%  0.0%  B16..8: 20.4%  1.1%  0.2%  direct: 0.3%  skip:77.9%  L0:42.7% L1:53.7% BI: 3.7%
[libx264 @ 0x12ab400] 8x8 transform intra:53.2% inter:76.5%
[libx264 @ 0x12ab400] coded y,uvDC,uvAC intra: 71.1% 47.7% 29.2% inter: 4.1% 4.7% 0.4%
[libx264 @ 0x12ab400] i16 v,h,dc,p: 29% 39%  4% 28%
[libx264 @ 0x12ab400] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 12% 25%  8%  9%  7% 10%  6%  6%
[libx264 @ 0x12ab400] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 23% 12%  5%  8%  7%  8%  5%  5%
[libx264 @ 0x12ab400] i8c dc,h,v,p: 61% 18% 17%  4%
[libx264 @ 0x12ab400] Weighted P-Frames: Y:1.6% UV:1.2%
[libx264 @ 0x12ab400] ref P L0: 68.4% 11.2% 13.2%  7.1%  0.0%
[libx264 @ 0x12ab400] ref B L0: 81.2% 14.6%  4.3%
[libx264 @ 0x12ab400] ref B L1: 92.6%  7.4%
[libx264 @ 0x12ab400] kb/s:1053.66

Note: I also increased IFrame rate to 1 every 1/2 second (to match the source video).

Also tried mpeg4 instead of h264 as recommended but still see the same issue. Uploaded at http://www.datafilehost.com/download-81b0bed0.html

ffmpeg -i dejavu_orig.mp4 -r 29.97 -s 848x476 -g 15 -vcodec mpeg4 -acodec aac -strict -2 -b:v 1500k  mpeg4_2997_gop_15.mp4
ffmpeg version N-54152-g730e07f Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun 23 2013 13:27:07 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4)
  configuration: --enable-gpl --enable-version3 --enable-zlib --enable-bzlib --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libmp3lame --enable-libxvid --enable-libx264 --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-libfdk_aac --enable-libvpx --enable-libgsm --enable-nonfree --enable-shared --enable-static
  libavutil      52. 37.101 / 52. 37.101
  libavcodec     55. 16.100 / 55. 16.100
  libavformat    55.  9.100 / 55.  9.100
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 77.101 /  3. 77.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'dejavu_orig.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2013-06-10 21:03:17
  Duration: 00:02:41.34, start: 0.000000, bitrate: 10227 kb/s
    Stream #0:0(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      creation_time   : 2013-06-10 21:10:02
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720, 8684 kb/s, 59.94 fps, 59.94 tbr, 5994 tbn, 11988 tbc
    Metadata:
      creation_time   : 2013-06-10 21:10:02
      handler_name    : Apple Alias Data Handler
File 'mpeg4_2997_gop_15.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'mpeg4_2997_gop_15.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    encoder         : Lavf55.9.100
    Stream #0:0(eng): Video: mpeg4 ( [0][0][0] / 0x0020), yuv420p, 848x476, q=2-31, 1500 kb/s, 11988 tbn, 29.97 tbc
    Metadata:
      creation_time   : 2013-06-10 21:10:02
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      creation_time   : 2013-06-10 21:10:02
      handler_name    : Apple Alias Data Handler
Stream mapping:
  Stream #0:1 -> #0:0 (h264 -> mpeg4)
  Stream #0:0 -> #0:1 (pcm_s16le -> aac)
Press [q] to stop, [?] for help
frame= 4838 fps= 42 q=2.0 Lsize=   32180kB time=00:02:41.42 bitrate=1633.0kbits/s dup=0 drop=4833    
video:29510kB audio:2532kB subtitle:0 global headers:0kB muxing overhead 0.431357%

I will try to get rhozet EULA for you.

comment:7 by Carl Eugen Hoyos, 11 years ago

Could you test -vf fps=30000/1001 instead of -r 29.97 ?

comment:8 by Shital, 11 years ago

Hi,

No luck even with -vf fps=30000/1001 .

I tried dumping the frame info using -vf showinfo for original file, file transcoded by commercial tool and by ffmpeg and I notice that pts_time values are matching for original file and that transcoded by the commercial tool (after accounting for half the frame rate) but are way different for the file transcoded by ffmpeg (done using "-r" as well as "-vf fps" filter).

Can these pts_time values have anything to do with lip sync?

For original file:

[Parsed_showinfo_0 @ 0x7f80f4000000] n:0 pts:0 pts_time:0 pos:96048 fmt:yuv420p sar:0/1 s:1280x720 i:P iskey:1 type:I checksum:E8521F12 plane_checksum:[A610DA85 CA295426 5542F049]
[Parsed_showinfo_0 @ 0x7f80f4000000] n:1 pts:100 pts_time:0.0166834 pos:236237 fmt:yuv420p sar:0/1 s:1280x720 i:P iskey:0 type:B checksum:2418FB7F plane_checksum:[E07940E2 CA8ABD98 3BE8FCF6]
[Parsed_showinfo_0 @ 0x7f80f4000000] n:2 pts:200 pts_time:0.0333667 pos:198911 fmt:yuv420p sar:0/1 s:1280x720 i:P iskey:0 type:P checksum:8BCA650D plane_checksum:[B4EF311D AF0D1547 04591EA9]
[Parsed_showinfo_0 @ 0x7f80f4000000] n:3 pts:300 pts_time:0.0500501 pos:287825 fmt:yuv420p sar:0/1 s:1280x720 i:P iskey:0 type:B checksum:C535B0DC plane_checksum:[C894C0DB 0C168605 6E9469ED]
[Parsed_showinfo_0 @ 0x7f80f4000000] n:4 pts:400 pts_time:0.0667334 pos:249505 fmt:yuv420p sar:0/1 s:1280x720 i:P iskey:0 type:P checksum:B8C4DB76 plane_checksum:[0B97B7D5 3EF1D1D2 81FB51C0]
[Parsed_showinfo_0 @ 0x7f80f4000000] n:5 pts:500 pts_time:0.0834168 pos:348637 fmt:yuv420p sar:0/1 s:1280x720 i:P iskey:0 type:B checksum:CAF682BC plane_checksum:[2D217112 E19707F5 9C5F09B5]
[Parsed_showinfo_0 @ 0x7f80f4000000] n:6 pts:600 pts_time:0.1001 pos:301085 fmt:yuv420p sar:0/1 s:1280x720 i:P iskey:0 type:P checksum:60C0075A plane_checksum:[0989712C 091F6572 9C5E30AD]
[Parsed_showinfo_0 @ 0x7f80f4000000] n:7 pts:700 pts_time:0.116783 pos:404735 fmt:yuv420p sar:0/1 s:1280x720 i:P iskey:0 type:B checksum:57EEA902 plane_checksum:[883A4E26 3C14FF5B A65D5B72]
[Parsed_showinfo_0 @ 0x7f80f4000000] n:8 pts:800 pts_time:0.133467 pos:365284 fmt:yuv420p sar:0/1 s:1280x720 i:P iskey:0 type:P checksum:788843D0 plane_checksum:[7079E4AD 10482E8B 11203089]
[Parsed_showinfo_0 @ 0x7f80f4000000] n:9 pts:900 pts_time:0.15015 pos:452033 fmt:yuv420p sar:0/1 s:1280x720 i:P iskey:0 type:B checksum:18DA2AF4 plane_checksum:[A57B133B 42FE9D58 A04B7A52]
[Parsed_showinfo_0 @ 0x7f80f4000000] n:10 pts:1000 pts_time:0.166834 pos:414007 fmt:yuv420p sar:0/1 s:1280x720 i:P iskey:0 type:P checksum:30FC3627 plane_checksum:[50EFFD78 DE5FEF41 FE9E4950]
[Parsed_showinfo_0 @ 0x7f80f4000000] n:11 pts:1100 pts_time:0.183517 pos:504937 fmt:yuv420p sar:0/1 s:1280x720 i:P iskey:0 type:B checksum:C72FCEC8 plane_checksum:[341A002B 8F665CB9 1B2B71E4]
[Parsed_showinfo_0 @ 0x7f80f4000000] n:12 pts:1200 pts_time:0.2002 pos:464439 fmt:yuv420p sar:0/1 s:1280x720 i:P iskey:0 type:P checksum:73E85B98 plane_checksum:[4DF6EAE1 5B70687F F4960829]
[Parsed_showinfo_0 @ 0x7f80f4000000] n:13 pts:1300 pts_time:0.216884 pos:565310 fmt:yuv420p sar:0/1 s:1280x720 i:P iskey:0 type:B checksum:33B406ED plane_checksum:[B835172D A91DEC8C F05F0325]
[Parsed_showinfo_0 @ 0x7f80f4000000] n:14 pts:1400 pts_time:0.233567 pos:516867 fmt:yuv420p sar:0/1 s:1280x720 i:P iskey:0 type:P checksum:0BD53B6E plane_checksum:[2B76DBE1 AB5C578A 5FE807F4]
[Parsed_showinfo_0 @ 0x7f80f4000000] n:15 pts:1500 pts_time:0.25025 pos:616035 fmt:yuv420p sar:0/1 s:1280x720 i:P iskey:0 type:B checksum:284FEDEE plane_checksum:[D914D4D5 64DDB5B7 C12E6353]

For file transcoded by commercial tool:

[Parsed_showinfo_0 @ 0x7fa02a800000] n:0 pts:1001 pts_time:0.0333667 pos:86444 fmt:yuv420p sar:1/1 s:848x476 i:P iskey:1 type:I checksum:ACFEEF47 plane_checksum:[25A89856 E7E31D0A D3CB39E7]
[Parsed_showinfo_0 @ 0x7fa02a800000] n:1 pts:2002 pts_time:0.0667333 pos:176421 fmt:yuv420p sar:1/1 s:848x476 i:P iskey:0 type:B checksum:802E7E55 plane_checksum:[1A87FFCA 011D19F6 B44E6486]
[Parsed_showinfo_0 @ 0x7fa02a800000] n:2 pts:3003 pts_time:0.1001 pos:184140 fmt:yuv420p sar:1/1 s:848x476 i:P iskey:0 type:B checksum:50B3BB9A plane_checksum:[93F34B45 FAA0FE77 BB5671CF]
[Parsed_showinfo_0 @ 0x7fa02a800000] n:3 pts:4004 pts_time:0.133467 pos:152598 fmt:yuv420p sar:1/1 s:848x476 i:P iskey:0 type:P checksum:D6A13390 plane_checksum:[8FA197F4 8CC43139 DBEC6A54]
[Parsed_showinfo_0 @ 0x7fa02a800000] n:4 pts:5005 pts_time:0.166833 pos:209761 fmt:yuv420p sar:1/1 s:848x476 i:P iskey:0 type:B checksum:C2C8C660 plane_checksum:[E5304449 5CD41986 8B7B6891]
[Parsed_showinfo_0 @ 0x7fa02a800000] n:5 pts:6006 pts_time:0.2002 pos:216643 fmt:yuv420p sar:1/1 s:848x476 i:P iskey:0 type:B checksum:51F6CE39 plane_checksum:[07C263F6 F897FF06 81ED6B2E]
[Parsed_showinfo_0 @ 0x7fa02a800000] n:6 pts:7007 pts_time:0.233567 pos:190165 fmt:yuv420p sar:1/1 s:848x476 i:P iskey:0 type:P checksum:ADBCFE41 plane_checksum:[7F90846F DD852A8F 2BF34F43]
[Parsed_showinfo_0 @ 0x7fa02a800000] n:7 pts:8008 pts_time:0.266933 pos:242653 fmt:yuv420p sar:1/1 s:848x476 i:P iskey:0 type:B checksum:FAB462B0 plane_checksum:[E1E8E88E F6502638 0EB053DB]
[Parsed_showinfo_0 @ 0x7fa02a800000] n:8 pts:9009 pts_time:0.3003 pos:251192 fmt:yuv420p sar:1/1 s:848x476 i:P iskey:0 type:B checksum:816DFA38 plane_checksum:[8116C3BF 1345FA68 A8A13C02]
[Parsed_showinfo_0 @ 0x7fa02a800000] n:9 pts:10010 pts_time:0.333667 pos:222769 fmt:yuv420p sar:1/1 s:848x476 i:P iskey:0 type:P checksum:DFA3AF69 plane_checksum:[F31F2624 BA5C3414 F36B5531]
[Parsed_showinfo_0 @ 0x7fa02a800000] n:10 pts:11011 pts_time:0.367033 pos:279728 fmt:yuv420p sar:1/1 s:848x476 i:P iskey:0 type:B checksum:3F7C4442 plane_checksum:[D433B1C6 A7622A3E 6420682F]
[Parsed_showinfo_0 @ 0x7fa02a800000] n:11 pts:12012 pts_time:0.4004 pos:286150 fmt:yuv420p sar:1/1 s:848x476 i:P iskey:0 type:B checksum:1E02A74C plane_checksum:[E5CE4B34 F11AF1A8 C2726A61]
[Parsed_showinfo_0 @ 0x7fa02a800000] n:12 pts:13013 pts_time:0.433767 pos:259506 fmt:yuv420p sar:1/1 s:848x476 i:P iskey:0 type:P checksum:9FA571E6 plane_checksum:[BB4AAC81 E1D93B31 40FA8A25]
[Parsed_showinfo_0 @ 0x7fa02a800000] n:13 pts:14014 pts_time:0.467133 pos:310609 fmt:yuv420p sar:1/1 s:848x476 i:P iskey:0 type:B checksum:B185EACF plane_checksum:[22B339CB 376734B3 3FFA7C51]
[Parsed_showinfo_0 @ 0x7fa02a800000] n:14 pts:15015 pts_time:0.5005 pos:319567 fmt:yuv420p sar:1/1 s:848x476 i:P iskey:0 type:B checksum:B326EACF plane_checksum:[A685588A 90BE2F93 109362B2]
[Parsed_showinfo_0 @ 0x7fa02a800000] n:15 pts:16016 pts_time:0.533867 pos:292426 fmt:yuv420p sar:1/1 s:848x476 i:P iskey:0 type:P checksum:06CE09C5 plane_checksum:[4EC06716 4B4B627B C93A4025]

For file transcoded by ffmpeg (using -vf fps=30000/1001)

[Parsed_showinfo_0 @ 0x7fa1fc000000] n:0 pts:640 pts_time:0.0213333 pos:48 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:1 type:I checksum:9FD53BFB plane_checksum:[F6D59E33 8399C0C5 8C5ADCE5]
[Parsed_showinfo_0 @ 0x7fa1fc000000] n:1 pts:1641 pts_time:0.0547 pos:34989 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:A14D54EB plane_checksum:[9277B76B BF6D9B64 FFD9020D]
[Parsed_showinfo_0 @ 0x7fa1fc000000] n:2 pts:2642 pts_time:0.0880667 pos:33814 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:D686E4E1 plane_checksum:[AC440924 132FD617 56F605A6]
[Parsed_showinfo_0 @ 0x7fa1fc000000] n:3 pts:3643 pts_time:0.121433 pos:35803 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:9BB65CBB plane_checksum:[5287B2AE 645AA9D3 22E6002B]
[Parsed_showinfo_0 @ 0x7fa1fc000000] n:4 pts:4644 pts_time:0.1548 pos:29460 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:P checksum:09F70124 plane_checksum:[7790831A 050D87F3 F1C2F5F9]
[Parsed_showinfo_0 @ 0x7fa1fc000000] n:5 pts:5645 pts_time:0.188167 pos:44006 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:938C2DFD plane_checksum:[047440CA 6799DA5E 0FD212C6]
[Parsed_showinfo_0 @ 0x7fa1fc000000] n:6 pts:6646 pts_time:0.221533 pos:42450 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:F235841A plane_checksum:[C2DDBEFC 55A9BA95 EE670A7A]
[Parsed_showinfo_0 @ 0x7fa1fc000000] n:7 pts:7647 pts_time:0.2549 pos:45090 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:881E3ADB plane_checksum:[D1EE9626 7DDCA4AF C519FFE8]
[Parsed_showinfo_0 @ 0x7fa1fc000000] n:8 pts:8648 pts_time:0.288267 pos:36743 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:P checksum:DD431013 plane_checksum:[E99A50E1 CE16CE2E 9452F0E6]
[Parsed_showinfo_0 @ 0x7fa1fc000000] n:9 pts:9649 pts_time:0.321633 pos:54343 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:4E5DCCE3 plane_checksum:[805F149D FEBDBF6C B553F8CB]
[Parsed_showinfo_0 @ 0x7fa1fc000000] n:10 pts:10650 pts_time:0.355 pos:52344 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:7CD9ADFF plane_checksum:[4C750E18 EC36A5F9 3CE8F9DF]
[Parsed_showinfo_0 @ 0x7fa1fc000000] n:11 pts:11651 pts_time:0.388367 pos:55409 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:A1581F90 plane_checksum:[80B141E9 EAB6CE93 C7400F05]
[Parsed_showinfo_0 @ 0x7fa1fc000000] n:12 pts:12652 pts_time:0.421733 pos:46083 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:P checksum:560B4AA4 plane_checksum:[0A99AF17 1C4D98CF 199202AF]
[Parsed_showinfo_0 @ 0x7fa1fc000000] n:13 pts:13653 pts_time:0.4551 pos:64992 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:F1B55224 plane_checksum:[CB688F1A CF0EA9AC F96E194F]
[Parsed_showinfo_0 @ 0x7fa1fc000000] n:14 pts:14654 pts_time:0.488467 pos:63186 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:88896BDB plane_checksum:[A770A37E AEF6D596 5A53F2A9]
[Parsed_showinfo_0 @ 0x7fa1fc000000] n:15 pts:15655 pts_time:0.521833 pos:56962 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:P checksum:36DE0F5F plane_checksum:[82E26D23 37EFD305 D24BCF19]

File transcoded using ffmpeg with "-r 29.97 and -g 15"

[Parsed_showinfo_0 @ 0x7fca23000000] n:0 pts:511 pts_time:0.042626 pos:48 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:1 type:I checksum:70906E16 plane_checksum:[296D5818 6DA47B09 04189AE6]
[Parsed_showinfo_0 @ 0x7fca23000000] n:1 pts:911 pts_time:0.0759927 pos:33216 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:914717BF plane_checksum:[09D21156 1E874C30 069BBA2A]
[Parsed_showinfo_0 @ 0x7fca23000000] n:2 pts:1311 pts_time:0.109359 pos:31416 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:AFA9F56C plane_checksum:[73DEEDB6 1A7856E4 D39FB0C3]
[Parsed_showinfo_0 @ 0x7fca23000000] n:3 pts:1711 pts_time:0.142726 pos:34478 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:C062A063 plane_checksum:[80246F0D BCFF7614 3BADBB33]
[Parsed_showinfo_0 @ 0x7fca23000000] n:4 pts:2111 pts_time:0.176093 pos:28412 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:P checksum:668BCD01 plane_checksum:[F263DB4C E81D3CDA 6045B4CC]
[Parsed_showinfo_0 @ 0x7fca23000000] n:5 pts:2511 pts_time:0.209459 pos:41136 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:E0F66EBB plane_checksum:[EAC04DBF 6E995CE2 CB87C40B]
[Parsed_showinfo_0 @ 0x7fca23000000] n:6 pts:2911 pts_time:0.242826 pos:39837 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:F4C77C18 plane_checksum:[0DE158DA 33C45817 72AECB18]
[Parsed_showinfo_0 @ 0x7fca23000000] n:7 pts:3311 pts_time:0.276193 pos:42546 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:9B1ED998 plane_checksum:[A1F68EF9 03B27BA4 56F9CEEC]
[Parsed_showinfo_0 @ 0x7fca23000000] n:8 pts:3711 pts_time:0.30956 pos:35343 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:P checksum:970B07EB plane_checksum:[7375F115 70B25BF7 7303BAC1]
[Parsed_showinfo_0 @ 0x7fca23000000] n:9 pts:4111 pts_time:0.342926 pos:51356 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:B3AC554E plane_checksum:[6AD52A13 0AB1696B 6D8CC1C1]
[Parsed_showinfo_0 @ 0x7fca23000000] n:10 pts:4511 pts_time:0.376293 pos:49071 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:4C653106 plane_checksum:[2973EA55 D4BB87A6 5633BEED]
[Parsed_showinfo_0 @ 0x7fca23000000] n:11 pts:4911 pts_time:0.40966 pos:52484 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:CD49E77A plane_checksum:[88AAB479 621B73A7 095CBF4B]
[Parsed_showinfo_0 @ 0x7fca23000000] n:12 pts:5311 pts_time:0.443026 pos:43707 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:P checksum:C75D5CDA plane_checksum:[8E3B51A2 24515686 D038B4A3]
[Parsed_showinfo_0 @ 0x7fca23000000] n:13 pts:5711 pts_time:0.476393 pos:56641 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:B checksum:32B9DC01 plane_checksum:[7433957F 2C987AE1 2FEDCB92]
[Parsed_showinfo_0 @ 0x7fca23000000] n:14 pts:6111 pts_time:0.50976 pos:54051 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:0 type:P checksum:43C06403 plane_checksum:[0D204960 2EFA4FC8 CCBBCACC]
[Parsed_showinfo_0 @ 0x7fca23000000] n:15 pts:6511 pts_time:0.543126 pos:58328 fmt:yuv420p sar:0/1 s:848x476 i:P iskey:1 type:I checksum:C4C9F3D7 plane_checksum:[A4BBEB36 952347CE AD58C0C4]

Thanks,

comment:9 by Shital, 11 years ago

Posting file transcoded using -vf fps=30000/1001 : http://www.datafilehost.com/download-6b06f7d8.html

comment:10 by Carl Eugen Hoyos, 11 years ago

What difference is -g 15 supposed to make / what difference does it make?

comment:11 by Carl Eugen Hoyos, 11 years ago

And while this probably will not fix the problem, please use -r 30000/1001 as does the Rhozet transcoder apparently.

comment:12 by Shital, 11 years ago

Ok, I think I have zeroed down on the problem, its only while playing this mp4 file using a flash player (which is the way we surface videos for our users), we see lots of sync issues but these go away (almost) when we use a quicktime player or play the video in chrome. This makes me believe that may be flash player is ignoring some of the header info which is different from the file transcoded by ffmpeg and that transcoded by rhozet.

I could notice two differences, one using ffprobe and other using mediainfo.

1) Difference in start times:
ffmpeg transcoded file :

  Duration: 00:02:41.37, start: 0.021333, bitrate: 663 kb/s

rhozet transcoded file:

  Duration: 00:02:41.40, start: 0.000000, bitrate: 1169 kb/s

2) Difference in Audio delay reported by mediainfo in Audio section
For ffmpeg transcoded file:

Delay relative to video                  : 67ms

In rhozet transcoded file there is no such line about "Delay relative to video"

Can any of the above make a difference when being played by a flash player?

Thanks,

comment:13 by Carl Eugen Hoyos, 11 years ago

Please test -avoid_negative_ts 1

comment:14 by Carl Eugen Hoyos, 10 years ago

Resolution: needs_more_info
Status: newclosed

comment:15 by jameshowe, 10 years ago

Last edited 10 years ago by jameshowe (previous) (diff)
Note: See TracTickets for help on using tickets.