Opened 7 years ago

Closed 5 years ago

Last modified 5 years ago

#10104 closed Developer Task (fixed)

Proper Duration and Position Support

Reported by: tralph Owned by: Jim Stichnoth
Priority: minor Milestone: 0.27
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no


Ticket to track development for proper duration and position support.

The object of this feature is to provide accurate duration and total frame count for the recorder and commercial flagger. This will address the long standing issues with incorrect duration/position for variable frame rate and frame repeats.

For videos with a position map we will use the generated duration/frame count to generate duration/position. If no position map exists we will use the timestamp and duration provided by libav.

Change History (8)

comment:1 Changed 6 years ago by tralph

Owner: set to tralph
Status: newassigned

comment:2 Changed 6 years ago by Github

dtvrecorder: update MPEG-2 parser to properly generate repeat_pict values

This is going to be used for generating correct video duration.

Refs #10104

Branch: master Changeset: be8919faf54b9c0384f44acbee3950c79e6230a8

comment:3 Changed 6 years ago by tralph

Resolution: Won't Fix
Status: assignedclosed

There isn't much left to do to support this. Just not enough time to work on it anymore.

comment:4 Changed 5 years ago by Jim Stichnoth

Resolution: Won't Fix
Status: closednew

comment:5 Changed 5 years ago by Jim Stichnoth

Milestone: 0.250.27
Owner: changed from tralph to Jim Stichnoth
Status: newaccepted
  1. Mythcommflag --rebuild produces MARK_DURATION_MS marks in recordedseek or filemarkup, mapping keyframes to time offsets relative to the beginning of the recording.
  1. Recorders produce this same information.
  1. New command added to myth protocol - "QUERY_RECORDER FILL_DURATION_MAP" - similar to FILL_POSITION_MAP, to send updated duration info for playback of an in-progress recording.
  1. Use the duration map during playback to provide more accurate display and seeking with durations and time offsets, by linear interpolation between close values in the duration map. Avoid using naive framerate based calculations, or inaccurate/noisy/discontinuous display timecodes from the recording. Also take the cutlist into account.

comment:6 Changed 5 years ago by Jim Stichnoth <jstichnoth@…>

Resolution: fixed
Status: acceptedclosed

In 49dbed5be0729b04a5f0fd0426a32fceb2dd7935/mythtv:

Provide accurate position/duration/seeking with non-constant framerates.

The recordedseek and filemarkup tables are enhanced to hold timestamp
data in addition to the existing file offset data. The millisecond
timestamps are produced by all recorders that subclass DTVRecorder, as
well as mythtranscode and mythcommflag --rebuild. These timestamps
are relative to the start of the recording/video.

A new command is added to the myth protocol, "QUERY_RECORDER
FILL_DURATION_MAP", modeled after FILL_POSITION_MAP, to send updated
timestamp info for playback of an in-progress recording.

The timestamp markup is used during playback to give accurate position
and duration information in the OSD wherever possible, and to provide
accurate time-based seeking, such as "skip forward 30 seconds" or
"jump to the 5-minute mark". Timestamps are linearly interpolated
from a frame's nearest neighbors in the map, and extrapolated based on
the current frame rate when the map is missing (e.g. legacy
recordings) or incomplete (e.g. in-progress recordings). Other than
that, the frame rate is not used for seeking or duration calculations.
(With the exception of a handful of areas that still need some
attention, including seeking based on commskipmap, seeking across
program boundaries during Live TV, and the watched flag calculation.)

The cutlist continues to be taken into account for seeking and
displaying timestamps, for the most part making cutlists
indistinguishable from the result of lossless transcoding.

Note that to get the benefit of these changes for preexisting
recordings, it may be necessary to run "mythcommflag --rebuild" on
such recordings.

Bumps the ABI and protocol versions. "make distclean" is recommended.

Fixes #10104.

comment:7 Changed 5 years ago by Karl Dietz <dekarl@…>

In 4995830547a1852ea46c42f3d9d5ff6a2fc490e5/mythtv:

split position and duration map in mythtranscode

after [49dbed5b] a lossless transcode would run into untested code and
fail to insert the new position map

factor 1000 adjustment by Jim Stichnoth

Refs #10104

comment:8 Changed 5 years ago by Karl Dietz <dekarl@…>

In dd5a80dcbdfd0ce856a6743c2e6f89b3a11fb318/mythtv:

there's no point in comparing frame number to key type

the .map file should now contain the same content as before addition
of proper duration support

Refs #10104

Note: See TracTickets for help on using tickets.