Project

General

Profile

Actions

action #42047

closed

Mark (non) keyframes in OGV file correctly size:M

Added by mkittler over 5 years ago. Updated 3 months ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
Regressions/Crashes
Target version:
Start date:
2018-10-05
Due date:
% Done:

0%

Estimated time:

Description

Observation

Apparently (non) keyframes are not marked correctly in the OGG stream produced by videoencoder.cpp:

mpv https://openqa.suse.de/tests/2125363/file/video.ogv
Playing: https://openqa.suse.de/tests/2125363/file/video.ogv
[ffmpeg/demuxer] ogg: Broken file, keyframe not correctly marked.
 (+) Video --vid=1 (theora 1024x768)
[ffmpeg/demuxer] ogg: Broken file, non-keyframe not correctly marked.
[ffmpeg/demuxer] ogg: Broken file, non-keyframe not correctly marked.
[ffmpeg/demuxer] ogg: Broken file, non-keyframe not correctly marked.
[ffmpeg/demuxer] ogg: Broken file, non-keyframe not correctly marked.
[ffmpeg/demuxer] ogg: Broken file, non-keyframe not correctly marked.
[ffmpeg/demuxer] ogg: Broken file, non-keyframe not correctly marked.
[ffmpeg/demuxer] ogg: Broken file, non-keyframe not correctly marked.
[ffmpeg/demuxer] ogg: Broken file, non-keyframe not correctly marked.
[ffmpeg/demuxer] ogg: Broken file, keyframe not correctly marked.
[ffmpeg/demuxer] ogg: Broken file, keyframe not correctly marked.
[ffmpeg/demuxer] ogg: Broken file, non-keyframe not correctly marked.
[ffmpeg/demuxer] ogg: Broken file, non-keyframe not correctly marked.
[ffmpeg/demuxer] ogg: Broken file, non-keyframe not correctly marked.
[ffmpeg/demuxer] ogg: Broken file, keyframe not correctly marked.

(similar output with ffplay)

Acceptance criteria

  • AC1: No error reports about non-keyframe not correctly marked in OGV generated video
  • AC2 No error reports about keyframe not correctly marked in OGV generated video

Suggestions

  • Quickly check if with simple code changes the above error message can be prevented (at best fixed for good), otherwise state somewhere that such error messages need to be ignored and "ffmpeg" should be installed for a better experience
  • Confirm that ffmpeg-generated videos do not have such error

Further details

Likely this is not a problem for the new encoder use of ffmpeg when available


Related issues 1 (0 open1 closed)

Related to openQA Project - action #39251: Ensure videos are seekable for timed out jobsRejectedokurz2018-08-07

Actions
Actions #1

Updated by okurz over 4 years ago

  • Related to action #39251: Ensure videos are seekable for timed out jobs added
Actions #2

Updated by okurz over 4 years ago

@mkittler I assume this could explain why stepping back and forth in the video, e.g. going frame by frame with mpv, is not consistent and does not always work as expected?

Actions #3

Updated by mkittler over 4 years ago

Yes, that would explain it. But note that OGG is generally not the best container format when it comes to exact seeking. (OGG files have no global seek table like MKV or MP4 files usually have.)

Actions #4

Updated by okurz over 3 years ago

  • Target version set to future
Actions #5

Updated by AdamWill 4 months ago · Edited

This still seems to be an issue, and is rather annoying when you're trying to watch a very specific, short part of a long video.

edit: ah, of course, that implies we're still using the internal video encoder and not ffmpeg, when I intended to switch us to ffmpeg when that feature showed up. I did it wrong. I'm fixing that so hopefully we'll be using ffmpeg now and this won't be a problem for us, but as long as the internal encoder still exists I guess it's still a potential problem.

Actions #6

Updated by okurz 4 months ago

  • Target version changed from future to Ready
Actions #7

Updated by dheidler 4 months ago

  • Subject changed from Mark (non) keyframes in OGV file correctly to Mark (non) keyframes in OGV file correctly size:M
  • Description updated (diff)
  • Status changed from New to Workable
Actions #8

Updated by mkittler 4 months ago

Not sure whether it makes actually sense working on that with the external encoder in place. (But I guess it would generally be a very interesting part of the code to work on.)

Actions #9

Updated by mkittler 3 months ago

  • Status changed from Workable to In Progress
  • Assignee set to mkittler
Actions #10

Updated by mkittler 3 months ago · Edited

Our code is actually closely following https://gitlab.xiph.org/xiph/theora/-/blob/master/examples/encoder_example.c / https://gitlab.xiph.org/xiph/theora/-/blob/master/examples/png2theora.c.

I also checked out:

However, finding what's missing here and what we need to do is not very straight forward. Maybe our OGG files are actually fine/good and the keyframe marking on Ogg level is rather FFmpeg specific.

EDIT: I asked on the ffmpeg IRC channel about it.

Actions #11

Updated by mkittler 3 months ago

  • Status changed from In Progress to Feedback

oggz-validate video.ogv doesn't complain about mismarked keyframes. It only complains about a missing end of steam marker but that's actually another problem and probably only relevant for jobs that have been forcefully aborted.

So this could probably just be a warning of ffmpeg. When remuxing the video with ffmpeg -i video.ogv -c copy … the resulting file no longer shows these warnings. When I compare these files with various tools from oggz it seems that the muxing is quite differently. ffmpeg only puts 3.3 packets in one page (on avarage) whereas our muxer puts 5.3 packets in one page. The list of keyframes shown via oggz-scan -k … is on the other hand longer for our muxings.

Considering oggz-validate doesn't complain about this and the files play just fine and we now normally use ffmpeg anyway I'm inclined to reject this ticket.

Otherwise the next step would be to dig deeper, e.g. to read https://www.theora.org/doc/Theora.pdf or to change our code to use ffmpeg's muxer library.

Actions #12

Updated by okurz 3 months ago

Ok, so maybe we don't need to look into fixing those warnings but do you think we can do something about the inconsistent seeking as explained in earlier comments?

Actions #13

Updated by mkittler 3 months ago

The seeking works for me with mpv. (Seeking back seems a bit unprecise when seeking not back by a single frame but by 5 seconds but the same problem exists with the ffmpeg muxed file.)

Actions #14

Updated by okurz 3 months ago

  • Status changed from Feedback to Resolved

mkittler and me discussed this further. The only feasible potential improvement we could find where the effort would be acceptable would be to call ffmpeg to remux an ogv file when finalizing. However then that would kinda defeat the purpose to provide a solution that works without ffmpeg for little benefit because besides the questionable warning messages no functional impact was observed. We could seek in all kind of videos and could go frame by frame e.g. using mpv with the "," and "." keys. So resolving as in "everything works fine, ignore the warnings"

Actions

Also available in: Atom PDF