|
|
| TCmullet |
| Posted: May 30 2003, 06:08 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 312
Member No.: 3970
Joined: 2-May 03

|
| QUOTE (fccHandler @ May 26 2003, 05:06 PM) | | QUOTE | | once I have this divx avi with mp2 audio in it, I have to be able to run VirtualDub to convert the mp2 audio to something else later on. |
I don't understand that. If you know somehow that you are going to convert the audio later on, then you might as well convert it when you convert the MPEG. The whole idea of the "direct audio stream copy" feature is to preserve the audio so it doesn't get converted to something else.
|
Dear fccHandler,
Here's what's goin on. You have probably changed my life forever. I started video capture w/Dazzle DVCII (mpeg2). I knew of Vdub, but to run Flaskmpeg then vdub was time-prohibitive. Also, no acm codecs were around that were adequate for quality & size (including interlacing for 60field/sec video). Because of you and Divx5, I can now enter Avery's great world! Thank you!
Brief app recap: I record star trek (among other things). from last season of voyager thru 1st of enterprise, I did 2 disks/episode @ 3-3.5 avg Mbit/sec 704x480 mpeg2. No reencoding; just edit & burn. last fall, "This is taking way too many disks. gotta get it down to 1 cd/episode. i cut res to 352x480 & 1.8 Mb/s. I'm starting to not like the low-res, but was necessary. come you & divx5, I can keep the disks to 1/epis. but still increase the res.!
More to point; was doing audio at 224kbps; higher than some folks but not the best. (a reasonable tradeoff.) when I found vdub-mpeg2 had to recompress & do it using existing acm codecs, i saw my sys had mp3 w/320max rate, & no way to direct stream my beloved 1st generation mp2. (from various sources, mp2 sounds better & it's what the mpeg2 capture creates in mpeg2 program stream). So my initial plan was to cap mp2 at 384k (the max) then use the acm mp3 at 320k. hopefully not much quality would be lost. (in video i cap 8Mbps cbr, fwiw.)
a little sidestep please. very important to me to play shows on tv, not computer. dvcii does this. but not divx. so why am i willing to sacrifice tv-ability? there are dvd players out that play divx to tv. what i record i rarely watch anytime soon. i can wait till divx player-to-tv becomes cheaper; in meantime i'm collecting great (& compact) episodes for future use. must (or wish to) be able to pop my avi cd in a player in the future. i checked kiss's website; they only play mp3 audio w/divx! (drat). But i hate to throw away the great sounding 384k mp2 audio. it really does sound better than my 224k. maybe kiss (etc) could be pursuaded to enhance their divx feature to allow mp2. but if not, and if I save mp2 via your prog, then i'd have to extract mp2.wav & convert to mp3.wav & vdub back in & burn another cd (to watch on tv). a hassle but feasible. (and you have described how, sort of.) Here's the problem: besweet doesn't use the mp3 acm codec that vdub uses; it bypasses acm completely. it seems most of those mp3 encoders do as well. also it didn't let me pick mp3 parameters like my codec does. i want 320k cbr true stereo (not joint). the one prog that DOES encode via acm, 'acm station', will not read the mp2.wav. drat. and vdub won't either.
so with all these obstacles along the way adding up, it looks like for time being i better give up my beloved 384kmp2 and stick w/320k mp3 from my acm codec. the world is mp3-crazy & i can't hold up to the pressure. (doing the besweet route would also require a heck of a lot of time, too, something am short of.)
HOWEVER, having said all this, i would still reconsider storing the mp2, IF you could make vdub able to do full audio monitoring & editing of the mp2 along w/the video (keeping output in mp2 via direct-stream audio). I didn't think you could do that until i read your post where you said you had avoided doing any of that.
as far as mpeg stream in non-mpeg container (avi/wav), my first exposure to mpeg audio was in '98 w/Windows 95C. acm codec was fraunh. mpeg layer (2 or 3?--can't remember). only to 22k sample rate but that was fine for my app then. i had never heard of mpeg program streams or even video capture, only this wav codec with label 'mpeg'. so if m.s. felt in win95c days that mpeg audio could be in wav (instead of mpeg container), then maybe it's okay to do mpeg outside of mpeg container, now and forever. (i gather program stream is the 'container' you've been referring to. i never heard the term 'container' used until this bbs.)
until now i ignored vfw/acm as it didn't relate to mpeg2 video, & hardware (card) bypassed it all. only interface was that an mpeg2 directshow filter would be installed when you installed software dvd player (which came with dvcii). now, acm is everything, just about.
thanks for reading all this (i think i've said all i needed), & please forgive no caps, as pinky still killing me (2 bad sprains). TC  |
 |
| fccHandler |
| Posted: May 30 2003, 06:38 AM |
 |
|
Administrator n00b
  
Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02

|
| QUOTE (TCmullet @ May 30 2003, 02:08 AM) | | You have probably changed my life forever. |
Hmm. I'm a little lost, but if you're happy then I'm happy for you.
| QUOTE | | Here's the problem: besweet doesn't use the mp3 acm codec that vdub uses; it bypasses acm completely. it seems most of those mp3 encoders do as well. |
I mentioned BeSweet as a decoder only because it was the first program that came to mind. Once you have the audio decoded to uncompressed PCM you can do anything you want with it, and that includes loading it back into VirtualDub and using your favorite ACM codec to recompress it.
| QUOTE | | IF you could make vdub able to do full audio monitoring & editing of the mp2 along w/the video (keeping output in mp2 via direct-stream audio). |
Like I said, I might do that someday.
| QUOTE | | so if m.s. felt in win95c days that mpeg audio could be in wav (instead of mpeg container), then maybe it's okay to do mpeg outside of mpeg container, now and forever. |
Audio is usually OK. My old argument with ChristianHJW is about the merits of MPEG video in Matroska.
-------------------- May the FOURCC be with you... |
 |
| TCmullet |
| Posted: May 30 2003, 07:44 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 312
Member No.: 3970
Joined: 2-May 03

|
| QUOTE (fccHandler @ May 30 2003, 12:38 AM) | | QUOTE (TCmullet @ May 30 2003, 02:08 AM) | | You have probably changed my life forever. |
Hmm. I'm a little lost, but if you're happy then I'm happy for you.
|
wasn't it obvious from my history? i've been drooling for 3 years to be able to use vdub filters. thanks 2 you u & divx, i now can. instead of burning all my video to cd-r as mpeg2s of different bitrates & pixel ratios (always tailering tradeoffs to the need), i can now take advantage of the better codec, divx for some of what i capture (as well as using filters to clean up problems--better then tmpgenc). very very significant change for my whole video life these days (and many to come). (must get faster cpu though. 850mhz still too slow--divx plods along at 1.7-3.6 fps.) |
 |
| TCmullet |
| Posted: May 30 2003, 07:49 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 312
Member No.: 3970
Joined: 2-May 03

|
| QUOTE (fccHandler @ May 30 2003, 12:38 AM) | | QUOTE | | Once you have the audio decoded to uncompressed PCM you can do anything you want with it, and that includes loading it back into VirtualDub and using your favorite ACM codec to recompress it. |
|
oops, i forgot about pcm. yes, i'm sure the converters (in & out of windows) are internally going to pcm intermediarily. i forgot i could do it explicitly. will look into it--after cleaning off disk space for the big ones.
actually, can you please recommend a tool to create the pcm wav file from the mp2.wav that you supply? progs i've seen either don't recognize the file or don't output to pcm. if besweet does it i haven't been able to figure out how. |
 |
| ChristianHJW |
| Posted: May 30 2003, 09:15 AM |
 |
|
Advanced Member
  
Group: Moderators
Posts: 1768
Member No.: 2
Joined: 7-July 02

|
| QUOTE (fccHandler @ May 30 2003, 08:38 AM) | | Audio is usually OK. My old argument with ChristianHJW is about the merits of MPEG video in Matroska. |
/me promises to never ever raise the subject again in front of fcchandler ......
-------------------- Visit the unofficial Virtualdub support forum on http://forums.virtualdub.org - help to reduce the big number of emails Avery Lee is getting every day !! Support matroska as container and Gstreamer as the only truely open, x-platform multimedia platform .... |
 |
| TCmullet |
| Posted: Jun 1 2003, 02:05 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 312
Member No.: 3970
Joined: 2-May 03

|
fccHandler,
i finally figured out how to make besweet do something. and one of the somethings i figured out was converting mp2.wav to pcm.wav as you said. yes it worked! then i was able to vdub pcm back into acm/mp3. came to almost the same size, even. and it plays in wmp 7.0, albeit not always very well.
i've decided to do this: even tho i can move the mp2 in and out of the avi & convert to mp3, i'm going to leave the originally encoded mp3 in there. in addition, i'm going to save your mp2.wav file separately. there's not enough room on 1 disk for both the avi w/mp3 and the mp2.wav. so i'm going to collect all the mp2.wav files for each show on a seperate set of disks, about 5 shows' worth per disk. so i will be able to easily play the avi on the disk (w/it's mp3 track), but if i want to redo it in the future with 384k mp2, then at least i've saved it elsewhere. the mp3 in there is obviously not as good as the original 384k mp2, but it's 320k and sounds pretty good, maybe even better than if i had mp2 encoded it to 224k as i used to.
but if you ever decide to make the mp2 track direct-stream-editable in vdub, you got my vote! (and hopefully by then, more hard/soft players will play the mp2 as part of the avi). thanks for all your help! TC |
 |
| fccHandler |
| Posted: Jun 1 2003, 05:52 AM |
 |
|
Administrator n00b
  
Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02

|
@ChristianHJW: Since you said you'd never raise the topic again, I'll raise it myself.
| QUOTE (ChristianHJW @ May 27 2003, 10:03 PM) | | MPEG sucks for editing ... In short, we will have tools to transmux MP4 into MKV, edit the files on VirtualdubMod, and then remux them to MP4 after haevy editing ... this is possible because the MKV container is editable by design without using the codecs .... |
There's something I don't understand about what you're saying here. Let's assume that I have successfully put an MPEG I/P sequence into a Matroska container (in display order), and it's 20 frames:
IPPPPPPPPPIPPPPPPPPP
Now I want to trim off the first 5 frames. How can that be done without using a codec? There are only two possibilities that I can see: Use the preceding frames to rebuild the sixth frame as an I-frame, then delete the first five frames (but that requires a codec), or keep all the frames but somehow tell the container that the sequence begins at the sixth frame (but that's wasteful).
I haven't even mentioned B frames...
-------------------- May the FOURCC be with you... |
 |
| TCmullet |
| Posted: Jun 2 2003, 07:51 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 312
Member No.: 3970
Joined: 2-May 03

|
Excuse me. Has anybody thought of somehow getting mpeg2 into the avi container w/acm codec, just like divx is? I've been interacting a LOT lately with folks on the divx.com forums. They are almost convincing me (after much discussion about many details), that mpeg4 formats won't be adequate for what I'll loosely call "perfect" digital archives. I'm just now hearing from them that you can't throw more bits at it to get more detail encoded. Some have said I must rely on mpeg2 for that.
If that's so, then I guess the dream of having better compression (without loss of detail) is only a pipedream. But part of MY dream was to get into avi so I could do all that neat vdub filtering!!!!!!!!! (In addition I could cut the big AVIs cleanly at the gops to break it up into cd-rs, then PERFECTLY join them back together for re-mastering.
Well, I hope you'll excuse me again... re-reading what I've written here makes me remember that storing mpeg in non-mpeg containers is what you've already been thinking about. I guess I'm now coming back to it from the fresh perspective of one whose been told that I have to go back to mpeg2 for what I want. |
 |
| ChristianHJW |
| Posted: Jun 2 2003, 09:29 AM |
 |
|
Advanced Member
  
Group: Moderators
Posts: 1768
Member No.: 2
Joined: 7-July 02

|
| QUOTE (TCmullet @ Jun 2 2003, 09:51 AM) | Excuse me. Has anybody thought of somehow getting mpeg2 into the avi container w/acm codec, just like divx is? But part of MY dream was to get into avi so I could do all that neat vdub filtering!!!!!!!!! (In addition I could cut the big AVIs cleanly at the gops to break it up into cd-rs, then PERFECTLY join them back together for re-mastering. |
:sigh: ..... this is exactly what i am talking about all the time ..... why oh why does nobody listen to me ? LOL ...
TCMullet, did you ever care to test VirtualdubMod 1.5.1.1a ? It is using fcchandler's perfect MPEG parser/decoder code under GPL, and can output to MKV and OGM instead of AVI. You can use all of Vdub's filters with it, and even do some fancy stuff in AVISynth if you prefer that.
I wont dare to state that it will be a bloody mess to try to put MPEG2 into AVI, as my level of knowledge is not sufficient for this, but if i am loking at fcchandler's question above i simply doubt it is possible ....
-------------------- Visit the unofficial Virtualdub support forum on http://forums.virtualdub.org - help to reduce the big number of emails Avery Lee is getting every day !! Support matroska as container and Gstreamer as the only truely open, x-platform multimedia platform .... |
 |
| ChristianHJW |
| Posted: Jun 2 2003, 10:00 AM |
 |
|
Advanced Member
  
Group: Moderators
Posts: 1768
Member No.: 2
Joined: 7-July 02

|
| QUOTE | @ChristianHJW:Since you said you'd never raise the topic again, I'll raise it myself. |
LOL ! And i had fear to have pissed you completely ....
| QUOTE | There's something I don't understand about what you're saying here. Let's assume that I have successfully put an MPEG I/P sequence into a Matroska container (in display order), and it's 20 frames:
IPPPPPPPPPIPPPPPPPPP
Now I want to trim off the first 5 frames. How can that be done without using a codec? There are only two possibilities that I can see: Use the preceding frames to rebuild the sixth frame as an I-frame, then delete the first five frames (but that requires a codec), or keep all the frames but somehow tell the container that the sequence begins at the sixth frame (but that's wasteful). I haven't even mentioned B frames... |
matroska cant do wonders. If you edit an AVI in 'Direct Stream Copy' mode, you have to cut on keyframes, and thats the very same in mkv also.
Now, with MPEG2 its becoming even more complicated, as
- P/B frames can have reference frames lying in the future, or even much in the past. matroska can cope with that in principal as all frames in mkv files can have references throughout the complete file, our frame referncing system supports that nicely, and you dont need the codec to tell you the frametype, unlike in OGM
- The MPEG specs say that in principal with every keyframe a new GOP can start. To handle this we had to add a new hi-level EBML element, lets call it KaxGOP for the moment.
In practice, hardly any of the above mentioned things are really used a lot, especially the future/past reference frames, as this would require to jump backwards and forwards in the media, and especially DVDs and streaming doesnt like this a lot 
Now, to be able to edit a matroska file containing MPEG video, the editing app ( VdubMod ) had to do the following :
1. Parse the complete file before editing and find every single GOP element, and store them in a table. Again, i dont expect that in real DVDs/MPEGs the GOP will change a lot, but we have to support this to be MPEG spec compliant. Now, the editing app know that - it cant edit segments out, when those are spanning over a GOP element, without adding the new GOP element header to the beginning of the file after the segment that was cut out. - It even has to recalculate the GOP element content accordingly AFAIK
2. If any frame has future/past references, and does refer to a frame in the section that will be edited/cut out, this frame has to be copied before deleting the segment. Again, matroska's time stamp based concept allows that, you can literally insert any number of frames for a given timestamp, being close to a real VFR application. When judging about this, please bare in mind that with normal MPEG editors, such a file couldnt be edited at all !!! And again, there wont be much use for past/future references in actual MPEG encoder apps, even no DVD standalones would be able to cope with that in real time if they had to seek to any future reference frame when playing from the DVD.
Of course, there was some coding work to be done to add MPEG2 editing capability to VdubMod, but its possible in principal, and still much much easier than making a good MPEG editor IMHO. Your MPEG decoder code, with some fixes, could be used to allow file preview during editing.
Sorry to bring this topic up again, but you invited me to do so. I am prepared for heavy bashing from a real MPEG expert now, but i hope that this will help us to understand where our concept has holes ?
-------------------- Visit the unofficial Virtualdub support forum on http://forums.virtualdub.org - help to reduce the big number of emails Avery Lee is getting every day !! Support matroska as container and Gstreamer as the only truely open, x-platform multimedia platform .... |
 |
| TCmullet |
| Posted: Jun 2 2003, 06:28 PM |
 |
|
Advanced Member
  
Group: Members
Posts: 312
Member No.: 3970
Joined: 2-May 03

|
| QUOTE (ChristianHJW @ Jun 2 2003, 03:29 AM) | :sigh: ..... this is exactly what i am talking about all the time ..... why oh why does nobody listen to me ? LOL ...
TCMullet, did you ever care to test VirtualdubMod 1.5.1.1a ? It is using fcchandler's perfect MPEG parser/decoder code under GPL, and can output to MKV and OGM instead of AVI. You can use all of Vdub's filters with it, and even do some fancy stuff in AVISynth if you prefer that.
|
Nobody listen to you? Well, I'm new here. And I'm definitely interested in listening to both you guys. (Even if a lot of it goes over my head.)
Never heard of 1.5.1.1a. Just got into vdub (having tried it a bit 3 years ago) a few weeks ago after discovering vdub-mpeg2. "Can output to mkv & ogm instead of avi." I haven't learned about mkv, ogm yet. and the few times i tried to get avisynth to work, it failed. as i've been mpeg2-only these 3 years, vdub & avi have had to take a back burner. i'm not sure how eager i'll be to go to mkv/ogm (whatever they are). but when I have time, i'll consider it. in meantime, this going to divx/avi is creating a terrible cpu backlog of "work"! I can't simply capture, edit, burn. now i have to also spend days of cpu each week encoding to divx. and it's becoming kinda hard to coordinate it all, especially as the mpeg2 input into vdub has to be recorded with high bitrate 2-4gb per file and i'm darn short of space.
although i know nothing of your mkv/ogm (wanna give a url?), already i see a snag for me. one of reasons for divx/avi is to be able to play on outcoming dvdplayers to tv such as kiss-dp-450, or the supposedly working Xcard. The kiss unit has said that the divx has to be in an avi. so there. (how will you solve that one?) |
 |
| fccHandler |
| Posted: Jun 2 2003, 07:53 PM |
 |
|
Administrator n00b
  
Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02

|
| QUOTE (ChristianHJW @ Jun 2 2003, 06:00 AM) | i had fear to have pissed you completely .... |
Hehe, not at all. Believe me, if I was pissed you'd know about it...
| QUOTE | Now, with MPEG2 its becoming even more complicated, as
- P/B frames can have reference frames lying in the future, or even much in the past. matroska can cope with that in principal as all frames in mkv files can have references throughout the complete file, our frame referncing system supports that nicely, and you dont need the codec to tell you the frametype, unlike in OGM |
MPEG2 didn't introduce P/B frames, they're present in all versions of MPEG.
| QUOTE | | In practice, hardly any of the above mentioned things are really used a lot, especially the future/past reference frames, as this would require to jump backwards and forwards in the media, and especially DVDs and streaming doesnt like this a lot |
Are you saying that DVDs don't use P/B frames? They certainly do. It's not a problem because the frames are stored backwards in the stream. The decompressor receives the future reference frame before it receives the B frame(s) that depend on it, but it displays the B frame(s) first, before displaying the future reference frame.
Consider the sequence (in display order):
IBBPBBPBBPBBIBBPBBPBBP
Is stored on the DVD like this:
IPBBPBBPBBIBBPBBPBBPBB
Note that the display process must lag one frame behind (I believe the spec addresses that), but ultimately every frame gets shown and there is no backwards/forwards jumping through the media.
Regarding your references to GOPs: The MPEG2 specs state that GOP headers are "optional" in MPEG2, so you may want to rethink parsing or seeking based on the presence of GOP headers.
@TCmullet: The Matroska link is at the bottom of every one of Christian's posts.
-------------------- May the FOURCC be with you... |
 |
| ChristianHJW |
| Posted: Jun 4 2003, 08:50 AM |
 |
|
Advanced Member
  
Group: Moderators
Posts: 1768
Member No.: 2
Joined: 7-July 02

|
| QUOTE | Are you saying that DVDs don't use P/B frames? | ... nope, misunderstanding ... will clarify a few lines below ...
| QUOTE | | They certainly do. It's not a problem because the frames are stored backwards in the stream. The decompressor receives the future reference frame before it receives the B frame(s) that depend on it, but it displays the B frame(s) first, before displaying the future reference frame. |
The MPEG specs, in principal, clearly allow that a reference frame ( I/P ) can be basically anywhere in the stream, as long as its inside the same GOP !! That means, a B/P frame in the middle of the movie can reference to an I/P frame being on the very start, and another frame on the very end of the movie ! Fortunately, i am not aware of any MPEG encoder that will really make use of that, because to encode such a movie the encoder had to buffer all frames of the movie ( uncompressed ), and of course this will never be done that way. Now, for displaying that means that heavy searching through the media had to be done to read the reference frame you need for decoding the actual frame, which is also a primary reason why there ( hopefully ) wont be any real existing encodings making use of that.
| QUOTE | Consider the sequence (in display order): IBBPBBPBBPBBIBBPBBPBBP Is stored on the DVD like this: IPBBPBBPBBIBBPBBPBBPBB Note that the display process must lag one frame behind (I believe the spec addresses that), but ultimately every frame gets shown and there is no backwards/forwards jumping through the media. |
1. all frames in MKV are stored in coding order, not display order. This makes sense we think, as most containers make it the same way, and as mentioned baove our frame referencing system is quite powerful, so even if a lot of B frames were used we can still know exactly how/where we can edit/cut the file.
2. as noted above, if there were encodings that would really stress the MPEG specs and use reference frames being a lot in the past/future, heavy seeking was necessary for playback. For us this simply brings up the problem, if we should make our MPEG support such that it will be able to cope with the specs, even in worst case, or only with real existing encodings. Maybe 2nd is enough, and we were investing much too much time to be able to cope with every possibility. On the other hand, if we decide on a way how to handle MPEG in matroska, it should be a working solution even for the future ( you never know what future MPEG2 encoder implementations will do one day, looking at modern PCs ), or we will run into trouble later.
To cut a long story short : If we onl have to care about normal MPEG1/2 encoding, with only GOP at the very start and normal frame orders, with I frames being always before the P frames using them as reference, and always one reference frame before and after a B frame, but not more than say 10 frames apart, its easy to do with current matroska implementation, libatroska could handle it out of the box right now ...
| QUOTE | | Regarding your references to GOPs: The MPEG2 specs state that GOP headers are "optional" in MPEG2, so you may want to rethink parsing or seeking based on the presence of GOP headers. |
Same problem as above : do we follow the MPEG specs to the letter, or are we happy with supporting what is existing/encoded today ?
-------------------- Visit the unofficial Virtualdub support forum on http://forums.virtualdub.org - help to reduce the big number of emails Avery Lee is getting every day !! Support matroska as container and Gstreamer as the only truely open, x-platform multimedia platform .... |
 |
| fccHandler |
| Posted: Jun 4 2003, 10:49 PM |
 |
|
Administrator n00b
  
Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02

|
| QUOTE (ChristianHJW @ Jun 4 2003, 04:50 AM) | | The MPEG specs, in principal, clearly allow that a reference frame ( I/P ) can be basically anywhere in the stream, as long as its inside the same GOP !! That means, a B/P frame in the middle of the movie can reference to an I/P frame being on the very start, and another frame on the very end of the movie ! |
I think you've misstated the facts a bit. MPEG frames can only refer to the previous (or next) "reference frame." In the case of a P-frame, it's the reference frame which immediately precedes it in display order. In the case of a B-frame, it's the two reference frames immediately before and after it in display order. Every I and P frame is a "reference frame."
In no sense does any frame refer to a reference frame "anywhere in the stream," it is always the one which is right next to it. A linear MPEG decoder has only to buffer the two most recent reference frames when it decodes them, so their data is available (if needed) to decode the next frame. If the next frame is an I/P frame, it replaces the previous reference in the buffer, and the cycle continues. Any number of B-frames may be present between the current frame and it's nearest reference frame, but B-frames are not reference frames and are discarded after being displayed.
What does complicate things (especially for random seeking) is the fact that P-frames also serve as "reference frames," so if P-frame #6 references P-frame #5, you can't reconstruct frame #6 without first decoding #5, but #5 references #4, and so on, all the way back to the most recent I-frame (which references nothing).
So yes, it's true that decoding a randomly selected P or B-frame from scratch may require you to walk the chain of dependencies all the way back to the beginning of the file (in the most extreme case). But if MKV stores the frames in coding order, there is no situation which would make it necessary to look ahead in the stream, because (as I explained in my last post) the reference frames that a B-frame depends on are coded before the B-frame itself.
-------------------- May the FOURCC be with you... |
 |
| TCmullet |
| Posted: Jun 8 2003, 10:51 PM |
 |
|
Advanced Member
  
Group: Members
Posts: 312
Member No.: 3970
Joined: 2-May 03

|
A few comments, observations, & a question.
When I encode to mpeg2 via Tsu (my nickname for Tmpgenc which was originally called the Tsunami Mpeg Encoder), I choose to limit my gop size to 18. This was because I heard somewhere that many (if not all) DVD players will barf at gops larger than 18 (15 for PAL). Furthermore, I think it's the DVD spec that says that B frames must be limited to 2 per P frame. (Not mpeg2 spec, but DVD spec.) So my gop structure in Tsu is:
IBBPBBPBBPBBPBBPBB
Mpeg2 would allow IBBBPBBBPBBBBBPBPBBBBB, but not DVD
I do have shorter ones (< 18) if scene change is detected. But if not, then gop=18 will ensure future dvd-compatibility of my program streams. Notice that the last frame is a B. This is called an open gop. Tsu has an option for generating the last frame of a gop as a P. As I'm sure you both know, only a P or I can be cut afterwards without special logic to transform the B into a P or I. But Bs are smaller, so I prefer to use open gops and edit using software that can handle the trailing Bs without reencoding the whole file. (Btw, I'm please to have discovered that Divx 5 has all closed gops, therefore I can edit on a gop-basis in Vdub in direct stream mode.)
Yes, Fcc, the B & P frames refer only to immediately adjacent frame (1 frame away in time). Chjw, I don't know where you would have gotten the idea that b or p can refer to any frame in the gop.
Now, Fcc, for my question. I had always felt that a gop is defined as a group of pictures that begins with an I and has only one I frame in it. That is, I always thought that if you have another I frame, then you've begun a new gop. But even Tsu allows you to specify 'number of I pictures in gop', which I always leave at 1. Does the mpeg2 spec allow for multiple I frames in a gop? If so, why? What's the point in have this thing called a gop if it's not defined as wherever an I frame exists.
(continued next post) |
 |
|