Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

video seeking and bookmarks do not work properly for some .avi files #825

Open
dhill999 opened this issue Dec 20, 2023 · 0 comments
Open

Comments

@dhill999
Copy link

  • Platform: Linux dh 5.15.0-88-generic Fix mytharchive #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

  • MythTV version: fixes/32

  • Package version: mythtv/jammy,jammy,now 2:32.0+fixes.20220325.f69ce764b7-0ubuntu1 all [installed]

  • Component:

What steps will reproduce the bug?

Play video encoded with 24 fps but reported frame rate as 30fps. When I play these videos, there is a noticeable drift between the mythtv timestamps and the actual video position. EG if I save a bookmark after playing for 10 minutes, then resume, it will resume a few minutes prior to the actual position. This also shows up when jumping forward / back within the video -- a jump forward often actually jumps backwards.
Videos were created over 10 years ago with mencoder but I do not have the specific options that led to this behavior. I fixed my video encoding procedure at the time but still have many videos with this odd encoding. I am happy to provide a sample upon request.
This bug was reported 11 years ago https://code.mythtv.org/trac/ticket/11415 and fixed in 0.27-fixes however I recently upgraded to 0.32-fixes and found the old behavior has returned.
Jim Stichnoth noted that:
Because frame intervals are actually encoded as 30fps, every
4th frame has to be repeated. Without an adjustment to framesPlayed,
translations between MythPlayer?'s frame-based seeking/display and
ffmpeg's timecode-based seeking drift out of sync.
Note: Similar adjustments may be necessary if frames have to be
dropped due to a frame rate mismatch.

How often does it reproduce? Is there a required condition?

100% of the time for videos encoded as described.

What is the expected behaviour?

mythtv should save bookmarks accurately so it can resume playback from the bookmarked position and jump forward/backward from the playback position accurately.

What do you see instead?

Resuming from bookmark always resumes earlier than video position and jumping forward/back jumps farther back than intended.
The longer the video was playing, the farther off it gets.

Additional information

Original commit that fixed the issue:
e7a8dfc

Latest code has no references to framesPlayedExtra -- commit history shows it was removed in 2020:
5bb0e9e

@dhill999
Copy link
Author

I initially thought this was limited to my older videos, but I found that even more recently encoded videos are also showing this behavior. These are typically videos ripped from DVDs with the following commands:

/usr/bin/mplayer dvd://01 -nocache -dumpstream -dumpfile video.vob -alang en -slang en -forcedsubsonly
/usr/bin/ffmpeg -i video.vob -vcodec libx264 -preset fast  -b:v 1800k  -af aresample=async=1000 -f avi -pass 1 -r 30000/1001 -y /dev/null
/usr/bin/ffmpeg -i video.vob -vcodec libx264 -preset fast  -b:v 1800k  -af aresample=async=1000 -f avi -pass 2  -r 30000/1001 -acodec ac3 -b:a 256k -map 0:0 -map 0:1 video.avi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant