Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#3216 closed defect (needs_more_info)

ffprobe and ffmpeg functions return different last frame for same file

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

Description

I met an issue that the output of ffprobe -show_frames seems different from what av_read_frame+avcodec_decode_video2 ouputs

The ffprobe and ffmpeg libs were built from same latest code.

I used ffprobe -show_frames -select_streams v input to print out all frame info. and here's the info of last 2 frames

[FRAME]
media_type=video
key_frame=0
pkt_pts=N/A
pkt_pts_time=N/A
pkt_dts=167501
pkt_dts_time=167.501000
pkt_duration=N/A
pkt_duration_time=N/A
pkt_pos=103794518
pkt_size=74
width=1920
height=1080
pix_fmt=yuv420p
sample_aspect_ratio=1:1
pict_type=P
coded_picture_number=4016
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
FRAME
[FRAME]
media_type=video
key_frame=0
pkt_pts=N/A
pkt_pts_time=N/A
pkt_dts=167542
pkt_dts_time=167.542000
pkt_duration=N/A
pkt_duration_time=N/A
pkt_pos=103794920
pkt_size=74
width=1920
height=1080
pix_fmt=yuv420p
sample_aspect_ratio=1:1
pict_type=P
coded_picture_number=4017
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
FRAME

on the other hand, our application uses av_read_frame and avcodec_decode_video2 to read a avpacket and decode into a frame. Below are some traces

Line 100: 00:00:33.384 MAIN rhbc73 process packet, Packet.dts = 0, Packet.pts = -9223372036854775808
Line 101: 00:00:33.384 MAIN rhbc73 process packet, Packet.dts = 42, Packet.pts = -9223372036854775808
Line 102: 00:00:33.400 MAIN rhbc73 process packet, Packet.dts = 83, Packet.pts = -9223372036854775808
Line 103: 00:00:33.400 MAIN rhbc73 process packet, Packet.dts = 125, Packet.pts = -9223372036854775808
Line 104: 00:00:33.400 MAIN rhbc73 process packet, Packet.dts = 167, Packet.pts = -9223372036854775808
Line 105: 00:00:33.400 MAIN rhbc73 -- get a full frame, pFrame->pkt_dts = 0, pFrame->pkt_pts = -9223372036854775808, BestEffortTimeStamp = 0, pFrame->coded_picture_number = 0
Line 107: 00:00:33.400 MAIN rhbc73 process packet, Packet.dts = 209, Packet.pts = -9223372036854775808
Line 108: 00:00:33.400 MAIN rhbc73 -- get a full frame, pFrame->pkt_dts = 42, pFrame->pkt_pts = -9223372036854775808, BestEffortTimeStamp = 42, pFrame->coded_picture_number = 1
Line 110: 00:00:33.400 MAIN rhbc73 process packet, Packet.dts = 250, Packet.pts = -9223372036854775808
Line 111: 00:00:33.416 MAIN rhbc73 -- get a full frame, pFrame->pkt_dts = 83, pFrame->pkt_pts = -9223372036854775808, BestEffortTimeStamp = 83, pFrame->coded_picture_number = 2

Line 12140: 00:00:51.168 MAIN rhbc73 process packet, Packet.dts = 167501, Packet.pts = -9223372036854775808
Line 12141: 00:00:51.168 MAIN rhbc73 -- get a full frame, pFrame->pkt_dts = 167334, pFrame->pkt_pts = -9223372036854775808, BestEffortTimeStamp = 167334, pFrame->coded_picture_number = 4012
Line 12143: 00:00:51.184 MAIN rhbc73 process packet, Packet.dts = 167542, Packet.pts = -9223372036854775808
Line 12144: 00:00:51.184 MAIN rhbc73 -- get a full frame, pFrame->pkt_dts = 167376, pFrame->pkt_pts = -9223372036854775808, BestEffortTimeStamp = 167376, pFrame->coded_picture_number = 4013

so from this we can see last frame has different pkt_pts and coded_picture_number from the output of ffprobe.

The file I tested is here https://dl.dropboxusercontent.com/u/89678527/Threw%20It%20On%20The%20Ground.avi

Change History (1)

comment:1 by Stefano Sabatini, 11 years ago

Resolution: needs_more_info
Status: newclosed

If you show no application code there is no way to reproduce the issue.
For example, can you reproduce the issue using some of the programs in doc/examples?

Also, are you correctly flushing the decoder at the end of the demuxing loop?

Please reopen if you can provide the missing information.

Last edited 11 years ago by Stefano Sabatini (previous) (diff)
Note: See TracTickets for help on using tickets.