New submission from Robert Krüger <[email protected]>:

I have uploaded two files to the directory wrong-ts-avchd, one 1080p at 25
frames per second stored as progressive segmented frames and one 720p at 50
frames per second. Decoding both with libavcodec yields strange timestamps which
seem to disagree with what is actually stored as PTS in the PES headers.

I hacked some debug output in which I'm attaching here with comments:

1080p psf:

ffmpeg -i 1080p-25-psf.mts -vframes 5 -f mov -y /dev/null
FFmpeg version SVN-r26061, Copyright (c) 2000-2010 the FFmpeg developers
  built on Dec 20 2010 16:05:44 with gcc 4.2.1 (Apple Inc. build 5646) (dot 1)
  configuration:
  libavutil     50.35. 0 / 50.35. 0
  libavcore      0.16. 0 /  0.16. 0
  libavcodec    52.100. 0 / 52.100. 0
  libavformat   52.88. 0 / 52.88. 0
  libavdevice   52. 2. 2 / 52. 2. 2
  libavfilter    1.69. 0 /  1.69. 0
  libswscale     0.12. 0 /  0.12. 0

Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1)
-> 50.00 (50/1)
Input #0, mpegts, from '1080p-25-psf.mts':
  Duration: 00:00:05.18, start: 0.378856, bitrate: 19361 kb/s
  Program 1
    Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 50
fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
Starting with vspeed 0.000000
[buffer @ 0x100c02ca0] w:1920 h:1080 pixfmt:yuv420p
Output #0, mov, to '/dev/null':
  Metadata:
    encoder         : Lavf52.88.0
    Stream #0.0: Video: mpeg4, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=2-31,
200 kb/s, 50 tbn, 50 tbc
    Stream #0.1: Audio: aac, 48000 Hz, stereo, s16, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
[mpegts @ 0x10100b000] pes [0] pts 34097
[mpegts @ 0x10100b000] pes [1] pts 34097
start compute_pkt_fields pkt [1] pts 34097, dts 34097, size 768
end compute_pkt_fields pkt [1] pts 34097, dts 34097, size 768
after av_read_frame pkt [1] pts 34097, dts 34097, size 768
next audio pts 32000, pts 0
[mpegts @ 0x10100b000] pes [1] pts 36977
start compute_pkt_fields pkt [1] pts 36977, dts 36977, size 768
end compute_pkt_fields pkt [1] pts 36977, dts 36977, size 768
after av_read_frame pkt [1] pts 36977, dts 36977, size 768
next audio pts 64000, pts 32000
[mpegts @ 0x10100b000] pes [0] pts 37697
[h264 @ 0x101014200] ct_type:2 pic_struct:1
start compute_pkt_fields pkt [0] pts 34097, dts 34097, size 104928
end compute_pkt_fields pkt [0] pts 221297, dts 221297, size 104928
after av_read_frame pkt [0] pts 221297, dts 221297, size 104928
[h264 @ 0x101014200] ct_type:2 pic_struct:1
[h264 @ 0x101014200] slice type I
[mpegts @ 0x10100b000] pes [1] pts 39857
start compute_pkt_fields pkt [1] pts 39857, dts 39857, size 768
end compute_pkt_fields pkt [1] pts 39857, dts 39857, size 768
after av_read_frame pkt [1] pts 39857, dts 39857, size 768
next audio pts 96000, pts 64000
[mpegts @ 0x10100b000] pes [0] pts 41297
[h264 @ 0x101014200] ct_type:2 pic_struct:2
start compute_pkt_fields pkt [0] pts 0, dts 0, size 37121
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamps suddenly become zero here although
pts looks ok in PES
end compute_pkt_fields pkt [0] pts 223097, dts 223097, size 37121
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ and now really weird values are set and
continue from here on
after av_read_frame pkt [0] pts 223097, dts 223097, size 37121
[h264 @ 0x101014200] ct_type:2 pic_struct:2
[h264 @ 0x101014200] slice type P
frame pts 0, guessed pts 2080000, type P
frame=    5 fps=  0 q=5.2 Lsize=       0kB time=0.10 bitrate=   0.0kbits/s
dup=103 drop=0
video:170kB audio:0kB global headers:0kB muxing overhead -100.000000%

720p:

ffmpeg -i 720p-50.mts -vframes 5 -f mov -y /dev/null
FFmpeg version SVN-r26061, Copyright (c) 2000-2010 the FFmpeg developers
  built on Dec 20 2010 16:05:44 with gcc 4.2.1 (Apple Inc. build 5646) (dot 1)
  configuration:
  libavutil     50.35. 0 / 50.35. 0
  libavcore      0.16. 0 /  0.16. 0
  libavcodec    52.100. 0 / 52.100. 0
  libavformat   52.88. 0 / 52.88. 0
  libavdevice   52. 2. 2 / 52. 2. 2
  libavfilter    1.69. 0 /  1.69. 0
  libswscale     0.12. 0 /  0.12. 0
Input #0, mpegts, from '720p-50.mts':
  Duration: 00:00:05.18, start: 0.377589, bitrate: 2038 kb/s
  Program 1
    Stream #0.0[0x1011]: Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 50
fps, 50 tbr, 90k tbn, 100 tbc
    Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
Starting with vspeed 0.000000
[buffer @ 0x100c02c90] w:1280 h:720 pixfmt:yuv420p
Output #0, mov, to '/dev/null':
  Metadata:
    encoder         : Lavf52.88.0
    Stream #0.0: Video: mpeg4, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], q=2-31, 200
kb/s, 50 tbn, 50 tbc
    Stream #0.1: Audio: aac, 48000 Hz, stereo, s16, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
[mpegts @ 0x10100b000] pes [0] pts 33983
[mpegts @ 0x10100b000] pes [1] pts 33983
start compute_pkt_fields pkt [1] pts 33983, dts 33983, size 768
end compute_pkt_fields pkt [1] pts 33983, dts 33983, size 768
after av_read_frame pkt [1] pts 33983, dts 33983, size 768
next audio pts 32000, pts 0
[mpegts @ 0x10100b000] pes [0] pts 35783
[mpegts @ 0x10100b000] pes [1] pts 36863
start compute_pkt_fields pkt [1] pts 36863, dts 36863, size 768
end compute_pkt_fields pkt [1] pts 36863, dts 36863, size 768
after av_read_frame pkt [1] pts 36863, dts 36863, size 768
next audio pts 64000, pts 32000
[mpegts @ 0x10100b000] pes [0] pts 37583
[h264 @ 0x101014200] ct_type:1 pic_struct:0
start compute_pkt_fields pkt [0] pts 33983, dts 33983, size 108381
end compute_pkt_fields pkt [0] pts 455183, dts 455183, size 108381
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ now really weird values are set and continue
from here on
after av_read_frame pkt [0] pts 455183, dts 455183, size 108381
[h264 @ 0x101014200] ct_type:1 pic_struct:0
[h264 @ 0x101014200] slice type I
frame pts 0, guessed pts 4680000, type I
frame=    5 fps=  0 q=3.5 Lsize=       0kB time=0.06 bitrate=   0.0kbits/s
dup=233 drop=0
video:98kB audio:0kB global headers:0kB muxing overhead -100.000000%

----------
messages: 13001
priority: normal
status: new
substatus: new
title: Wrong timestamps calculated for AVCHD files from Panasonic GH1 Camera
type: bug

________________________________________________
FFmpeg issue tracker <[email protected]>
<https://roundup.ffmpeg.org/issue2437>
________________________________________________

Reply via email to