Opened 13 years ago

Closed 13 years ago

#29 closed defect (fixed)

Regression: Bad A/V sync for Panasonic camera recordings

Reported by: Carl Eugen Hoyos Owned by: Michael Niedermayer
Priority: normal Component: ffmpeg
Version: git Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

samples/mplayer-bugs/bug1898/Panasonic.mts plays fine with ffplay, transcoding with ffmpeg leads to files with "shifted" audio (audio starts early). The conversion succeeds with FFmpeg 0.5.

ffmpeg -i Panasonic.mts -qscale 2 out.avi
FFmpeg version git-N-28715-gd62c531, Copyright (c) 2000-2011 the FFmpeg developers
  built on Mar 30 2011 10:32:40 with gcc 4.5.2
  configuration: --cc=/usr/local/gcc-4.5.2/bin/gcc --enable-gpl
  libavutil    50. 40. 0 / 50. 40. 0
  libavcodec   52.116. 0 / 52.116. 0
  libavformat  52.104. 0 / 52.104. 0
  libavdevice  52.  4. 0 / 52.  4. 0
  libavfilter   1. 76. 0 /  1. 76. 0
  libswscale    0. 13. 0 /  0. 13. 0

Seems stream 0 codec frame rate differs from container frame rate: 119.88 (120000/1001) -> 29.97 (30000/1001)
Input #0, mpegts, from 'Panasonic.mts':
  Duration: 00:00:14.49, start: 0.381078, bitrate: 15251 kb/s
  Program 1
    Stream #0.0[0x1011]: Video: h264 (High), yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 119.88 tbc
    Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
[buffer @ 0x11ff2c0] w:1280 h:720 pixfmt:yuv420p
[setdar @ 0x122c860] a:16/9
[setdar @ 0x122c860] w:1280 h:720 -> dar:16/9 sar:1/1
Output #0, avi, to 'out.avi':
  Metadata:
    ISFT            : Lavf52.104.0
    Stream #0.0: Video: mpeg4, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 29.97 tbn, 29.97 tbc
    Stream #0.1: Audio: mp2, 48000 Hz, stereo, s16, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press ctrl-c to stop encoding
frame=  435 fps= 55 q=2.0 Lsize=   17594kB time=14.54 bitrate=9910.0kbits/s
video:17444kB audio:114kB global headers:0kB muxing overhead 0.205926%

out.avi plays with constant ~2sec desync (video is late).

ffplay plays the original sample fine:

ffplay -autoexit Panasonic.mts
FFplay version git-N-28715-gd62c531, Copyright (c) 2003-2011 the FFmpeg developers
  built on Mar 30 2011 10:32:40 with gcc 4.5.2
  configuration: --cc=/usr/local/gcc-4.5.2/bin/gcc --enable-gpl
  libavutil    50. 40. 0 / 50. 40. 0
  libavcodec   52.116. 0 / 52.116. 0
  libavformat  52.104. 0 / 52.104. 0
  libavdevice  52.  4. 0 / 52.  4. 0
  libavfilter   1. 76. 0 /  1. 76. 0
  libswscale    0. 13. 0 /  0. 13. 0
Input #0, mpegts, from 'Panasonic.mts':
  Duration: 00:00:14.49, start: 0.381078, bitrate: 15251 kb/s
  Program 1
    Stream #0.0[0x1011]: Video: h264 (High), yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 119.88 tbc
    Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
  14.98 A-V:  0.000 s:0.0 aq=    0KB vq=    0KB sq=    0B f=0/0   f=0/0

Change History (1)

comment:1 by Carl Eugen Hoyos, 13 years ago

Resolution: fixed
Status: newclosed

Fixed in latest git HEAD.

Note: See TracTickets for help on using tickets.