Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > New and alternative a/v containers

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 17th February 2015, 10:49   #3001  |  Link
ndjamena
Registered User
 
Join Date: Sep 2012
Posts: 366
Actually, you're talking about variable frame rate. The track statistics tags were my fault, and "gaps in the file" was one of Mosu's major reservations about implementing any kind of statistics... VFR can't cause those kind of problems.
ndjamena is offline  
Old 17th February 2015, 10:53   #3002  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Gaps imply variable framerate, i.e. difference between timecode_x and timecode_x+1 is not constant.
sneaker_ger is offline  
Old 17th February 2015, 11:15   #3003  |  Link
ndjamena
Registered User
 
Join Date: Sep 2012
Posts: 366
If I append three episodes of a TV show, episodes 1 and 3 have audio commentaries as a secondary track, episodes 2 doesn't. There will be a rather large gap in the secondary audio stream that can't be written off a simple VFR.

Are you sure you're not thinking of MP4?
ndjamena is offline  
Old 17th February 2015, 11:22   #3004  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by ndjamena View Post
There will be a rather large gap in the secondary audio stream that can't be written off a simple VFR.
Why not? What do you think would define the difference between gaps and VFR?
sneaker_ger is offline  
Old 17th February 2015, 11:25   #3005  |  Link
ndjamena
Registered User
 
Join Date: Sep 2012
Posts: 366
Gaps are empty, VFR always contains the last frame.
ndjamena is offline  
Old 17th February 2015, 19:30   #3006  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
A true gap would be a Cluster that had a timecode beginning some time after the duration of the last Cluster's last BlockGroup ended. I'm sure that could come from real-time recording where the camera is temporarily unavailable and the recorder pauses instead of inserting filler, as well, but it would more likely indicate a damaged stream for most people. I don't think there's any reason for MediaInfo to look for that, that's a job for a file integrity checker.

Jerôme, thanks for the good explanation. I'm glad MediaInfo is as powerful as it is now, and the future is definitely bright.
foxyshadis is offline  
Old 17th February 2015, 19:41   #3007  |  Link
ndjamena
Registered User
 
Join Date: Sep 2012
Posts: 366
Matroska is supposed to be able to hold multiple titles in a single file. Therefore gaps are necessary, or else you'd have to fill them with junk.

Think ISO, not MP4.
ndjamena is offline  
Old 17th February 2015, 20:04   #3008  |  Link
ndjamena
Registered User
 
Join Date: Sep 2012
Posts: 366
Looky:

http://matroska.org/technical/specs/...deo.html#whole

Did none of you bother reading the specs?

One file, one title.
multiple files, one title.
one file, multiple titles.

It's supposed to be FLEXIBLE...

So if a few of those episodes have commentaries...

http://matroska.org/technical/specs/chapters/index.html

[ChapterTrack]

And once the specs are actually finished and start making sense (it may happen one day) that will just be a simple example.
ndjamena is offline  
Old 17th February 2015, 21:22   #3009  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
I don't see the relevance. There is no mention about how gaps are realized in the video tag section, ripping multiple episodes does not necessarily imply the special situation you had in your case (some episodes with and some episodes without a commentary track). The existence of chapters does not imply gaps.
sneaker_ger is offline  
Old 18th February 2015, 01:36   #3010  |  Link
ndjamena
Registered User
 
Join Date: Sep 2012
Posts: 366
Maybe I'm looking too far ahead, but I can take MKVMerge right now and create a file exactly like that. If you think I shouldn't be able to, you could try filing a bug report on the MKVToolNix bug tracker and see where it gets you.

Since they're just basic implementation of the Matroska file system all players support them by default, VLC goes ballistic when it finds a gap in audio, but my WDTV just interprets them as silence. I, or anyone else on earth, can easily create one of these files and playing them back on my WDTV really isn't that bad. I could just manually switch to the main audio track once the commentary goes silent and per the specs it would be a perfectly valid Matroska file..

Do you really have a problem a with that?
ndjamena is offline  
Old 18th February 2015, 03:01   #3011  |  Link
ndjamena
Registered User
 
Join Date: Sep 2012
Posts: 366
Quote:
Originally Posted by Moritz Bunkus
And the stream length. Yes, you could simply define that as the difference between the MAX(timecode+duration) and MIN(timecode). But what about gaps in the middle? If you extract back to a raw elementary streams such gaps are lost resulting in different stream lengths.

I'm not saying that such header fields aren't useful, they definitely would have been. They would also have had drawbacks that may not be obvious at first glance, though.
Hmmm, upon reading the entire email I've decided it's best to edit the rest out.

'nuf said I think.
ndjamena is offline  
Old 18th February 2015, 06:57   #3012  |  Link
Chetwood
Registered User
 
Chetwood's Avatar
 
Join Date: Nov 2001
Posts: 1,104
Quote:
Originally Posted by ndjamena View Post
My WDTV Live SMP actually sets the frame rate being passed to my TV through HDMI to 23.976fps when I'm playing a blu ray rip.
For 24 FPS files too? Also from m2ts?
__________________

MultiMakeMKV: MakeMKV batch processing (Win)
MultiShrink
: DVD Shrink batch processing
Offizieller Übersetzer von DVD Shrink deutsch
Chetwood is offline  
Old 18th February 2015, 08:56   #3013  |  Link
ndjamena
Registered User
 
Join Date: Sep 2012
Posts: 366
Well, the moment I start playing anything 23.976fps my TV display jumps up and says declares it as 24p. I just tested an m2ts and it worked with that as well. My video settings are configured to HDMI (auto).

I created a 10 minute black screen file using AviSynth BlankClip and tried playing that back and it still switched to 24p, maybe it can tell from dithering or maybe x264 isn't encoding the blank screen lossless.

I made another at exactly 24fps at crf 1 (the lowest i could go without switch to the incompatible "lossless" mode) and it did indeed switch to 24p.

I turned off Cinema Drive in my TVs settings, which should disable any detection of film and it still says 24p.

I'm not sure how to test it any further.


Quote:
Bit rates are even trickier with respect to gaps. Do I include the gaps in the calculation? Probably not, but Matroska doesn't require a continues stream of packets, it allows for gaps (even in audio tracks).
I took an episode of Eureka, extracted all the tracks, cut the video track in half using MKVMerge, then recreated the file with the shortened video track, then I appended that episode to the next episode. When I played it back with VLC the moment it reached the cut point it skipped to the next episode. If it was VFR it would have just repeated the last frame until the next episode. VLC is buggy, I'm not sure what it's supposed to do, but what it does at the moment is just annoying (especially when it's just gap in an audio track, even one that's not currently playing. And when the section of file it has to scan through to find the next frame happens to contain 1080p video rather than AAC audio it can get messy.) Thankfully, I have it in good authority that someone is looking into it.

[The actual Matroska specs don't specifically say much at all. Arguments based on that will go nowhere. I just read what Mosu said about MP4, I remembered it wrong, maybe I should check if they can have gaps in the files too.]
ndjamena is offline  
Old 18th February 2015, 09:01   #3014  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
The MP4 headers allow for gaps (don't know about the specs, though). But the gaps will always be a multiples of the duration of a single frame/field (for video tracks) and not arbitrarily long/short. Of course you could also use edit lists in MP4 for creating gaps of arbitrary lengths, I guess. Or abuse the CTTS atom for it.

So many possibilities…
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is online now  
Old 18th February 2015, 09:12   #3015  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
BTW, when you're saying »if it was VFR…« then you're conflating different issues here. VFR is, abstractly speaking, simply the fact that the duration between adjacent frames is not constant. This can happen in very different situations: if there's an outage during a live capture; if there are segments that use alternating durations between frames (this is what people often refer to as VFR); if there are real gaps in one track but not another.

What would enable a player to handle all situations properly would not be a simple flag »hey this file is VFR«. Instead, a player would have to know what kind of gap or change happens each time so that it could treat case 2 from above differently than case 3. Matroska doesn't provide such information, but neither does any other popular container that I'm aware of.

About the frame rate being necessary for playback. So far the only case in which the frame rate has to be known in advance would mean syncing the playback device's frame rate. This is your example of your TV switching to a certain number of frames per second. Matroska's design did indeed not take this into account, and therefore a nominal frame rate is not part of the track headers. However, it still doesn't make all that much sense. Let's assume you specify a default duration of 40ms and derive a frame rate of 25 FPS from it. But then there's a gap of 12ms right at the beginning (audio starts at 0, video at 12ms). Or even worse: somewhere in the middle! So… now the playback device doesn't have the frame's timecodes synced to its own clock of when frames are supposed to be shown anymore.

Any container that allows arbitrary timecodes (ant not just multiples of the frame rate) suffer from this. M2TS does. MPEG PS does.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is online now  
Old 18th February 2015, 09:32   #3016  |  Link
Zenitram
Registered User
 
Join Date: Aug 2002
Location: France, Paris
Posts: 672
Quote:
Originally Posted by Mosu View Post
VFR is, abstractly speaking, simply the fact that the duration between adjacent frames is not constant. (...) This can happen in very different situations: if there's an outage during a live capture;
I kindly disagree: in such case, this is a stream outage, and my users consider such stream as CFR stream having missing frames.
there is a difference between a CFR stream missing some frames and a stream which is authored as VFR.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo
Zenitram is offline  
Old 18th February 2015, 09:53   #3017  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
Which doesn't affect my point: having a flag in the headers »this stream uses VFR« is simply not enough for handling all situations in which you encounter a frame with a duration different from the ones present in the headers. For true VFR streams in the sense that you're talking about each change in frame rate should be flagged as a change in frame rate along with the new expected frame rate. Similarly other types of duration differences ( = gaps) would have to be signalled.

Unless this is done there will always be ambiguity regarding how things like a streams duration and therefore bitrate is calculated.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is online now  
Old 18th February 2015, 10:27   #3018  |  Link
ndjamena
Registered User
 
Join Date: Sep 2012
Posts: 366
You could add Null frames to cover missing frames and stream terminators/initiators to cover gaps.

Just saying.
ndjamena is offline  
Old 18th February 2015, 10:32   #3019  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,278
While that might work for video it wouldn't work so well for audio, I guess. What should a player do with an empty audio frame? Continue playing the last frame over and over like with video?

My whole point is that the topic of gaps in the stream is a complex one with many issues and pitfalls. A simple flag (VFR on/off) or a simple value (frame rate) doesn't cover it.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is online now  
Old 18th February 2015, 13:43   #3020  |  Link
ndjamena
Registered User
 
Join Date: Sep 2012
Posts: 366
My actual definition of "Active Duration" has always been "the sum of the durations of every frame", which is different than "duration minus gaps" but would sound wrong.

Variable Frame Rate may be the wrong word to use, there seems to be three distinct issues being addressed:

1: Variable Frame Duration
2: Broken Stream (Missing Frames)
3: Stream Termination

1: is the classical definition of VFR
2: can be constant frame rate, the frames do exist in theory and still have the same duration but they're not present in the file
3: There are no frames, and since there are no frames, there's no frame rate. A delay is the most common example and is almost never included in frame rate calculations.

A null audio frame is silence... the stream is broken, there's not much you can do about that. A player can try to improvise something to fill the gap but it most likely won't be worth the effort (and that's essentially what it's doing with the video as well). If I watch something on TV and the signal gets scrambled the audio cuts out, should my TV be doing something else?

I don't imagine I'd ever see a null frame from any of the files I'd use, but I image they'd be counted separately from the proper frames.

Last edited by ndjamena; 18th February 2015 at 14:54.
ndjamena is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:52.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.