Opened 10 years ago

Closed 10 years ago

#7961 closed patch (fixed)

Fix handling of streams without PTS values in every frame

Reported by: peter.alm@… Owned by: Janne Grunau
Priority: critical Milestone: 0.23
Component: MythTV - Video Playback Version: 0.22-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The current handling of streams without pts values in every frame is broken, frames without a stored pts value will have a temppts value of 0, not below 0 which the current check looks for.

Another problem with the current implementation is that it uses time_base when interpolating the pts value, on the channels I have seen that does not set the pts value, the time_base value is not a 1:1 mapping to the frame rate (50fps vs a time_base of 90,000) so this patch changes this behaviour to use curstream->r_frame_rate instead.

Attachments (1)

pts.diff (1012 bytes) - added by peter.alm@… 10 years ago.

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by peter.alm@…

Attachment: pts.diff added

comment:1 Changed 10 years ago by anonymous

Forgot to set a few fields:

Version should be 0.22-fixes Component should be MythTV - Video Playback

comment:2 Changed 10 years ago by Stuart Auchterlonie

Component: MythTV - GeneralMythTV - Video Playback
Milestone: unknown0.23
Owner: changed from Isaac Richards to Janne Grunau
Version: unknown0.22-fixes

comment:3 Changed 10 years ago by stuartm

Priority: minorcritical

comment:4 Changed 10 years ago by tralph

Peter, please provide a short sample which demonstrates your problem. You can use something like dd if=video.mpg of=video_small.mpg bs=1024 count=50000 to generate a 50MB file and upload to filebin.ca.

comment:5 Changed 10 years ago by peter.alm@…

comment:6 Changed 10 years ago by tralph

Resolution: fixed
Status: newclosed

(In [23612]) Correct the video timestamp fixup code by making the following changes:

  • Perform fixup when PTS is not available which is indicated by temppts == 0.
  • Calculate temppts using fps instead of context->time_base. The prior calculation was actually wrong since it also needed to be multiplied by context->ticks_per_frame. Using fps also allows us to be consistent with normalized_fps().

This commit is a slight modification of the provided patch.

Thanks to Peter Alm for the patch and sample.

Fixes #7961.

Note: See TracTickets for help on using tickets.