I've started a small project and developed a program to parse MPEG-2 video streams. Reason is I wanted to understand the structure of the files (first) and then build a program that can "compare" two video streams encoded differently and "measure" the difference in quality.
While doing this, I have found a strange encoding peculiarity. I have noticed that DVD2One insists in adding a Video Sequence header before every group of pictures. And as it uses a different set of quantization matrix values, the header is the full 243 bytes long.
Obviously this inclusion does not deviate from the MPEG-2 standard, however it means that it adds 243 bytes of data for every 14~16 frames, which -for PAL - means roughly 350 bytes for every second of video. This (in bits) is 2.4kbps. For me it appears too much to waste.
I've removed these extra headers from a video and it still plays well.
So, after this extra long introduction, here comes the actual question:
Is there any useful reason for repeating the same Sequence header every now and then? Is it required by the DVD specification?
I welcome any insight.
+ Reply to Thread
Results 1 to 11 of 11
-
The more I learn, the more I come to realize how little it is I know.
-
Yes there is a reason to regularly have the headers. But my brain is foggy, and I can't remember. If I remember where I read this info, I'll post a link (unless someone beats me to it).
Hope is the trap the world sets for you every night when you go to sleep and the only reason you have to get up in the morning is the hope that this day, things will get better... But they never do, do they? -
No one can post the DVD MPEG-2 specifications since they signed a non disclosure areement regarding said specs and I certainly don't know them myself. That said, If I recall, you can have an mpeg-2 stream, without the header information at the beginning of each gop. The drawback is that picking up anywhere without the stream without a starting header could have unreliable results. Entrypoints can only be placed where there is an MPEG Sequence Header. This could make the gap between recoverable frames somewhat large. If the encoder lost the stream, or encountered problems, it could display blank screen, or pixel garbage for a few seconds before the next header was encountered. I think TMPGenc defaults to adding the header sequence at the beginning of every gop. This can be manually overridden of course, allowing you to sepcify the number of gops between each header sequence. When using the DVD, SVCD, and VCD templates, it defaults to 1 per gop. I'm assuming the author does know the spec. Take that as you will
Impossible to see the future is. The Dark Side clouds everything... -
Thanks for the feedback guys. I realize that the MPEG-2 specs are far wider than the DVD specs. DVD specs dictate a specific sub-syntax of the broader MPEG-2 and probably require some things that are optional in MPEG-2 streams. The existense of GOP headers is obviously one thing. However, these really "offer" some information to the player application. Timecodes is one thing.
Your postings made me realize Tmpgenc offers the option to not include Sequence Headers. Instead of trying to remove them from an existing stream, I will dig Tmpgenc up and encode a video without them. I will then try that on a DVD. For one thing, if Scenarist accepts the stream, the Sequence header is probably optional.
On a similar issue regarding encoding mode, I have noticed that CCE defaults in setting the timestamp for the first GOP at 1:00:00.00 (1 hour). To my understanding this only causes problems with audio streams that have a zero based timecode. Of course one can change that initial timecode to 0:00:00.00. All other encoders I tried either don't offer this option (always start at 0) or offer the option but the default is 0. Anyone has a clue why CCE is doing this? Just out of curiosity.The more I learn, the more I come to realize how little it is I know. -
Originally Posted by SaSi
I believe sequence headers are needed for DVD. But so, try it out. No harm in it. Just make the test short. No need to spend TOO much time on it.I'm not online anymore. Ask BALDRICK, LORDSMURF or SATSTORM for help. PM's are ignored. -
Sasi, it's curious that you should mention that. The guides for CCE will tell you to set the timecode to 0. The docs for CCE however, state that it should be set to 1, and that 0 is for internal or future use. I've tried it with both, and found both to be compatible.
Impossible to see the future is. The Dark Side clouds everything... -
Hi guys,
It took me some time to find the time to make the test, and in case you are still watching the thread, creating an MPEG-2 file without sequence headers made it DVD incompatible. I tried the file with a couple of DVD authoring apps and they all rejected it. Interesting thing is that Tmpgenc will not include the quantization matrix if you choose the default. So, it saves some space.
Regarding the start timecode value in CCE, any value you give to it will mark the first GOP header timepsamp and any subsequent GOPs will have incremental values. The end result is that if you import the stream into an authoring program - I tried with Scenarist - the video will have a start time equal to the value entered in CCE. If audio is encoded separatelly (with a start value of 0) or it is a ripped AC3 file with a different start timestamp, you will get audio and video totally out of sync. And of course, subtitles will be out of timing as well.The more I learn, the more I come to realize how little it is I know. -
SaSi, where you able to try a few with a small difference in timecode, like 0, and 1? I'm wondering which, if either will impact output. I understand a large value could skew audio. I'm just wondering if you noticed a difference between those two values.
Impossible to see the future is. The Dark Side clouds everything... -
DJRumpy,
I'm not sure what you mean with small difference in timecode. I've seen different versions of CCE have different user interface for the timecode. I've tried version 2.50 and 2.62. One has separate textboxes for hours, minutes, seconds, ... and the other has a single one.
Any value that is entered for the start timecode did not impact audio and video sync. Importing video and audio into Scenarist or IFOEdit produced a DVD structure that played OK.
The only problem I have seen with a start timecode other than 0:00:00.00 is that the movie (video+audio) get out-of-sync with the subpicture stream I have, which is produced by ripping the VOB files with SubRip and having a start value of 0:00:00.00. Importing these subpictures into Scenarist places them in an offset to the video sequence, totally out of place. Of course, one can rip the video and audio, check the video with Restream and examing the video start timecode and offset the subpicture stream with an equal amount. It's not a problem that cannot be solved, however I cannot understand how a video stream can be encoded with a start timecode of 4:33:12.85. It doesn't appear to provide any benefit.The more I learn, the more I come to realize how little it is I know. -
My misunderstanding. I though you said that the audio, and video would lose sync in your previous post. Please disregard...
Impossible to see the future is. The Dark Side clouds everything...
Similar Threads
-
advanced (2:3:3:2) pulldown removal
By socalver in forum Newbie / General discussionsReplies: 6Last Post: 17th Aug 2009, 21:15 -
Problems installing Sony advanced MPEG encoder board.
By bidomo in forum Capturing and VCRReplies: 5Last Post: 9th Jul 2009, 11:15 -
Need advanced framerate converter
By Xpenguin17 in forum EditingReplies: 17Last Post: 1st Jul 2009, 15:13 -
final cut pro - advanced question
By marinebc11 in forum MacReplies: 2Last Post: 18th Aug 2008, 10:01 -
Advanced Video Editor?
By efb91 in forum EditingReplies: 0Last Post: 24th Dec 2007, 11:48