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

Reply
 
Thread Tools Search this Thread Display Modes
Old 12th September 2002, 16:25   #21  |  Link
Taranli Maren
Registered User
 
Taranli Maren's Avatar
 
Join Date: Nov 2001
Posts: 47
I'm confused, if the grame was dropped during encoding, then wouldn't it just be missing? so it wouldn't shorten the length of the avi my any amount. or are you saying that your demuxer is dropping the frame for some reason? This was encoded from a dvd, as opposed to video capture, so it doesn't seem like there should be any dropped frames in encode-time. (Except for the ones decimate drops as part of ivtc)
Taranli Maren is offline   Reply With Quote
Old 12th September 2002, 16:39   #22  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 4,281
If frames are drop during encoding the encoder may insert 'empty' frames into an AVI. For an AVI there is an index entry for this frame, but the data has zero length. For a OGM this translates into a video packet whose length header is set to the number of 'empty' frames that were present in the AVI. If there were no 'empty' frames then the length header is not present.

Now if someone wants to recreate an AVI from an OGM then he has to recreate these 'empty' entries in the AVI index aswell. Otherwise the audio/video synchronization will be of. The problem is that apparently only the video frame was dropped, but not the corresponding audio frame.
__________________
Latest MKVToolNix is v83.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 12th September 2002, 16:46   #23  |  Link
Suiryc
Registered User
 
Join Date: Oct 2001
Location: France
Posts: 517
Quote:
Originally posted by Taranli Maren
or are you saying that your demuxer is dropping the frame for some reason?
Yes, and the reason is : I didn't know at that time that dropped frames would cause that, so while processing my demuxer was telling to the AVI writer to write 1 frame (whereas it should also write a 0-length frames for each dropped one).

But the new version should handle that now.
Suiryc is offline   Reply With Quote
Old 12th September 2002, 19:09   #24  |  Link
eclipsedvd
Registered User
 
Join Date: Oct 2001
Location: France
Posts: 21
Hi,

here is a little addon to Cyrius Tools.

Now, you can demux/cut ogm files with the right-click on the mouse

http://www.eclipsedvd.firstream.net/...s_20020912.exe

Greets
ECLiPSE
__________________
ECLiPSEDVD Guides & News
http://www.eclipsedvd.fr.st
eclipsedvd is offline   Reply With Quote
Old 12th September 2002, 19:34   #25  |  Link
Suiryc
Registered User
 
Join Date: Oct 2001
Location: France
Posts: 517


Oh BTW I forgot something with the A$F support : I forgot to reuse the code (that I uses with AVI support) for correctly handling dropped frames. Normally there should be no problem with the resulting OGM file except that demuxing it back to an AVI file could result in shortened clip (as I said before).
So if I were you I wouldn't use A$F too much for the moment (it's corrected in my sources but ATM I am trying to add audio support).

Last edited by Suiryc; 12th September 2002 at 19:37.
Suiryc is offline   Reply With Quote
Old 12th September 2002, 22:30   #26  |  Link
Emp3r0r
Registered User
 
Emp3r0r's Avatar
 
Join Date: Oct 2001
Location: Alabama, USA
Posts: 769
great work guys, can't wait to test the AC3 support and the >2GB file support, thanks for the tools
__________________
ChapterGrabber - add names to your chapters | AtomSite - open source AtomPub server
Emp3r0r is offline   Reply With Quote
Old 13th September 2002, 02:04   #27  |  Link
Belgabor
VDubMod Devel
 
Belgabor's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 824
Quote:
Originally posted by Suiryc


Oh BTW I forgot something with the A$F support : I forgot to reuse the code (that I uses with AVI support) for correctly handling dropped frames. Normally there should be no problem with the resulting OGM file except that demuxing it back to an AVI file could result in shortened clip (as I said before).
So if I were you I wouldn't use A$F too much for the moment (it's corrected in my sources but ATM I am trying to add audio support).
while you're at it, plz add some error tolerance if possible. This could be the perfect way to rescue those f**ked up a$fs we all learned to love.

Cheers
Belgabor
Belgabor is offline   Reply With Quote
Old 13th September 2002, 03:52   #28  |  Link
sherpya
Registered User
 
sherpya's Avatar
 
Join Date: Jun 2002
Location: Italy
Posts: 110
I don't known if is the right place, anyway I've made a python library
to parse and handle ogg chapter list.
It's not for newbe (sorry) but I think it's better than nothing
Peraps I'm currently using it.
You can download caplib.py

The lib is designed to be used by a small python prog:
You can open ogg chapter files
Split an ogg chapter file
Parse result from a html page donwloaded from http://www.bn.com/
(search for a title and select "From the DVD->Scene Index")
Can import titles from a list parse from html file

A simple example:
Code:
#!/usr/bin/env python
import caplib
a = caplib.Caps("lotrcaps.txt")
b = caplib.Caps("lotr.html", format='bn')


a.import_titles(b)

c,d = a.split_at("01:30:00.000")
print c
print "*" * 78
print d
Note: It's not very tested it only the first public version.

@Suiryc
It would be great to integrate your tools into virtualdub

Last edited by sherpya; 13th September 2002 at 03:54.
sherpya is offline   Reply With Quote
Old 13th September 2002, 08:36   #29  |  Link
The Link
Registered User
 
The Link's Avatar
 
Join Date: Nov 2001
Location: Germany
Posts: 189
Cool! There are other python users than me on this forum. Hope I get some time to have a look at this.
__________________
When birds burp, it must taste like bugs! (Calvin&Hobbes)

The Link is offline   Reply With Quote
Old 13th September 2002, 10:30   #30  |  Link
Suiryc
Registered User
 
Join Date: Oct 2001
Location: France
Posts: 517
Quote:
Originally posted by Belgabor
while you're at it, plz add some error tolerance if possible. This could be the perfect way to rescue those f**ked up a$fs we all learned to love.


Well it seems there is no good way to export "special" audio format (for example WMA or DivX Audio) from A$F (or AVI) to Ogg. The Ogg file won't play the audio (saying it lacks a codec ... don't know why .... it seems to be OK with MP3 audio in AVI so either it's a "problem" with OggDS, or it's a restriction from Micro$soft that doesn't allow format other than AVI and A$F to play those kind of stream).
Well anyway I have my "VirtualDub 1.4.10 special A$F" version (I had to add some things because of this damn "VBR Audio" check) ... (hey sometimes you find really strange things in those A$F files ... like a >10MB Script Command stream that doesn't seem to do anything )


Quote:
Originally posted by sherpya
It would be great to integrate your tools into virtualdub
Well this is another thing ...
Suiryc is offline   Reply With Quote
Old 13th September 2002, 10:52   #31  |  Link
Belgabor
VDubMod Devel
 
Belgabor's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 824
Anything with more error tolerance than the original VDub implementation floating around would be really nice

Cheers
Belgabor

P.S: I second sherpyas wish
Belgabor is offline   Reply With Quote
Old 13th September 2002, 10:59   #32  |  Link
Suiryc
Registered User
 
Join Date: Oct 2001
Location: France
Posts: 517
Quote:
Originally posted by Belgabor
Anything with more error tolerance than the original VDub implementation floating around would be really nice

Cheers
Belgabor

P.S: I second sherpyas wish
The VirtualDub old (i.e. Version 1.3) A$F support doesn't have error tolerance ? (I just took the code, modified some things, added others so that it was "up-to-date" with version 1.4.10)
Suiryc is offline   Reply With Quote
Old 13th September 2002, 13:18   #33  |  Link
TobiasWaldvogel
Registered User
 
TobiasWaldvogel's Avatar
 
Join Date: Feb 2002
Location: Madrid (Spain)
Posts: 94
More than one frame per packet

Streams which are created with my DirectShow filters MAY contain more than one frame per packet. I just take the frames that I get from the preceeding filter (in most cases the AVI splitter) and store them in the stream with the corresponding timestamps. It seems that the AVI splitter sometimes sends more than 1 frames at a time . Thats's all. In Windows there the MPEG4 decoders accept more than one frame per packet. Currently I don't know how to seperate them. Any ideas are welcome.

Kind regards,
Tobias
TobiasWaldvogel is offline   Reply With Quote
Old 13th September 2002, 15:52   #34  |  Link
Suiryc
Registered User
 
Join Date: Oct 2001
Location: France
Posts: 517
Re: More than one frame per packet

Quote:
Originally posted by TobiasWaldvogel
Streams which are created with my DirectShow filters MAY contain more than one frame per packet. I just take the frames that I get from the preceeding filter (in most cases the AVI splitter) and store them in the stream with the corresponding timestamps. It seems that the AVI splitter sometimes sends more than 1 frames at a time . Thats's all. In Windows there the MPEG4 decoders accept more than one frame per packet. Currently I don't know how to seperate them. Any ideas are welcome.
The only case where I saw more than one frame in a Packet (with your DirectShow filter) was due to dropped frames. So in fact there wasn't really various frames in the Packet, just the (first) good one. As DirectShow still give good timestamps (because it takes care of the dropped frames), there is no problem (I mean while playing the OGM file times are still good).

So I don't think there is need to separate them (since in that case it's impossible because there is in reality only one frame)
IMO DirectShow won't send more than one frame at a time to your filter (it would be crazy to do so because that would mean each filter involved in video processing under DirectShow should have the ability to separate adjacent frames whatever is the format of the frame : uncompressed, Indeo, DivX 3.11, DivX 4, DivX 5, XviD, and so on ...).

Now my commanline muxer acts like your DirectShow filter concerning dropped frames in the AVI source file.

There is however one thing you may know : with an AVI file that had at the very beginning one good frame and 4 bad ones, the first video Page (with data) had a granulepos of 0 with your DirectShow filter (the way I do it with my muxer the granulepos would have been 4, i.e. the granulepos of the last data in the Packet).
But this doesn't seem to be a problem while decoding (well in fact I cannot really tell because of the dropped frames that make the video like "stuttering").

Then a question concerning the subtitle stream : why having choosed the beginning of the Page for granulepos and not the end (as described in the Ogg secification) ?

And while I am at it (I know I may ask too much things at a time ), I have one question concerning the way your DirectShow filter give audio streams to the next filters : the type of audio is based on the stream_header.subtype field, isn't it ? (so if I have "0161" in the subtype field, your filter tells that the audio format - I think of the wFormatTag field in WAVEFORMAT or WAVEFORMATEX structure here - is 0x0161 ?)
This would help me knowing if the fact that my OGM file containing a video stream and a WMA (or DivX Audio) stream won't play the audio (saying it lacks codec whereas the codec is here) is related to your filter or (more likely) to a restriction of Micro$oft in their filters.

Thanks.
Suiryc is offline   Reply With Quote
Old 13th September 2002, 19:08   #35  |  Link
TobiasWaldvogel
Registered User
 
TobiasWaldvogel's Avatar
 
Join Date: Feb 2002
Location: Madrid (Spain)
Posts: 94
Re: Re: More than one frame per packet

Quote:
Originally posted by Suiryc
Then a question concerning the subtitle stream : why having choosed the beginning of the Page for granulepos and not the end (as described in the Ogg secification) ?
I don't set the page granulepos. I just set the packet granulepos and the ogg library sets the page position accordingly. Therefore the page granulepos is always the first position of the last complete packet in a page. This applies also to vorbis packets. The page granulepos is never set manually.

Quote:
And while I am at it (I know I may ask too much things at a time , I have one question concerning the way your DirectShow filter give audio streams to the next filters : the type of audio is based on the stream_header.subtype field, isn't it ? (so if I have "0161" in the subtype field, your filter tells that the audio format - I think of the wFormatTag field in WAVEFORMAT or WAVEFORMATEX structure here - is 0x0161 ?)
This would help me knowing if the fact that my OGM file containing a video stream and a WMA (or DivX Audio) stream won't play the audio (saying it lacks codec whereas the codec is here) is related to your filter or (more likely) to a restriction of Micro$oft in their filters.
You are right, for other audio format (not vorbis) I use a waveformatex structure for pbFormat and subtype contains the wFormatTag field. 0x0161 is WindowsMedia but it seems that the WMA decoder ONLY connects to the AFS reader. If you try to connect it to an AVI or WAV containing audio with ID 0x0161 it happens the same. It seems that Microsoft wants to limit the use of Windows Media to ASF/WMA

Last edited by TobiasWaldvogel; 13th September 2002 at 19:10.
TobiasWaldvogel is offline   Reply With Quote
Old 13th September 2002, 20:20   #36  |  Link
Suiryc
Registered User
 
Join Date: Oct 2001
Location: France
Posts: 517
Re: Re: Re: More than one frame per packet

Quote:
Originally posted by TobiasWaldvogel
I don't set the page granulepos. I just set the packet granulepos and the ogg library sets the page position accordingly. Therefore the page granulepos is always the first position of the last complete packet in a page. This applies also to vorbis packets. The page granulepos is never set manually.
Sorry for having said it like that because in fact I know that (I talked of Page because in the case of subtitle streams there is only one Packet in a Page, which means Packet granulepos = Page granulepos - and of course even I don't set the Page granulepos manually, the ogg library is kind enough to do that ).

In fact I was wondering if I were misunderstanding the Ogg specification or the way subtitle streams are described :
Page's granulepos is described as the granular position of the last fully decodable data of the Page ("The position specified is the total samples encoded after including all packets finished on this page" is what is said). And for Packet containing text data, it is said that "lenbytes" (that represents the number of samples in the Packet) is expressed in ms.
So when the first Page/Packet containing text data says it contains 5000 samples (i.e. the subtitle lasts 5 seconds), I was surprised to see that its granulepos was 0 (i.e. the position of the first sample), whereas I would expect it to be 5000 (number of samples in the Page/Packet).
Suiryc is offline   Reply With Quote
Old 13th September 2002, 20:31   #37  |  Link
inoteb
OggMedia addict
 
inoteb's Avatar
 
Join Date: May 2002
Location: Palladia Tolosa (France)
Posts: 86
Quote:
Originally posted by Suiryc


There is the same problem when you mux everything with OGMuxer : the AC3 track is allways played. So I also think it's related to OggDS (but maybe there is no solution for that, who knows).
I agree with that: 3 month ago I made several tests with OGM containing [Avi+AC3]+Ogg, and never reach success really. (see ).
Nevertheless, Blight put a nice code in ZoomPlayer to change from one audio track (AC3) to the other (Ogg), so the 2 are not superimposed anymore...
I quote him:
"To support multiple audio tracks in zoom player, originally written for AVI, I included code that checks the number of renderers then shuts them off only keeping the first renderer active. This assures only one audio track at a time is active.
I wrote it in such a way that it isn't AVI specific, so in theory, it should work with anything with more than one audio renderer.
All the detected audio renders are then listed under the "Audio Track" entry of the context menu."

I'd love to hear Tobias' opinion on the subject. I know you're working with the TCMP team to improve the OggMedia support. But can we expect new releases of your DS filters (Ogg & subtitles) fixing some issues (particularly concerning AC3 and SRT display, if there is solutions, of course!) in the future ?

Regards,
inoteb ;-]

PS @Suiryc
"OGMCutter should also be able to "adjust" the comments that are in the original file (Title and Chapters) according to where it cut" :
I love that!!! I gonna try it very soon...
__________________
Black dogs are barking at the door ;-]
---
TCMP ! TCMP ! TCMP !
inoteb is offline   Reply With Quote
Old 13th September 2002, 20:50   #38  |  Link
sherpya
Registered User
 
sherpya's Avatar
 
Join Date: Jun 2002
Location: Italy
Posts: 110
Re: Re: More than one frame per packet

Quote:
Originally posted by Suiryc

And while I am at it (I know I may ask too much things at a time ), I have one question concerning the way your DirectShow filter give audio streams to the next filters : the type of audio is based on the stream_header.subtype field, isn't it ? (so if I have "0161" in the subtype field, your filter tells that the audio format - I think of the wFormatTag field in WAVEFORMAT or WAVEFORMATEX structure here - is 0x0161 ?)
This would help me knowing if the fact that my OGM file containing a video stream and a WMA (or DivX Audio) stream won't play the audio (saying it lacks codec whereas the codec is here) is related to your filter or (more likely) to a restriction of Micro$oft in their filters.

Thanks.
You will able to use "outside the asf reader" only hacked dlls (aka divx audio)
0x160/0x161 are handled by windows media audio v1/2
0x162 is the new media audio from corona
There is only a "Direct Media Object" for decode it (0x162) and connects only to ASFReader.
So wmv9 is more "Blackboxed" than previous versions
Note divxaudio in divx3.22 package is an acm driver not a directshow filter
Btw beware, take a look here:

http://www.advogato.org/article/101.html


---
A question:
I've seen ogm splitter is able to split correctly chapter list.
It would be possible to "trim" out chapters not bound in the file
Also it would be (or it is) possible to mux subtitles and chapter
into an existing ogm file?


Last edited by sherpya; 13th September 2002 at 20:54.
sherpya is offline   Reply With Quote
Old 13th September 2002, 22:31   #39  |  Link
Suiryc
Registered User
 
Join Date: Oct 2001
Location: France
Posts: 517
Re: Re: Re: More than one frame per packet

Quote:
Originally posted by sherpya
You will able to use "outside the asf reader" only hacked dlls (aka divx audio)
I installed DivX audio (from Nimo codec pack) and I was able to have the audio coming from an AVI file that have audio at 0x0161 format.
But it didn't worked with the OGM file

Quote:
Btw beware, take a look here:
http://www.advogato.org/article/101.html
Yeah I know, but my test were more for educational purpose than anything else, since there is no interest in "converting" A$F to something else (OGM here) if you cannot have the audio with it

So I doubt anyone use this "functionality" (I even don't)
And unless somebody tells me not to do so, I would consider to remove that ...

Quote:
A question:
I've seen ogm splitter is able to split correctly chapter list.
It would be possible to "trim" out chapters not bound in the file?
Well I made it the easiest way here : I know where I cut, and I look at all the chapters in the comments and adjust the time.
It would be easy to throw away chapters that belong to next parts, but it is another thing for those belonging to previous parts, because comments are like that :
CHAPTER01=...
CHAPTER01NAME=...
CHAPTER02=...
CHAPTER02NAME=...
...

In the first time I threw away chapters belonging to previous parts, for example the first chapter, which make the comments like that :
CHAPTER02=...
CHAPTER02NAME=...

The problem is that (at least in BSPlayer) then chapters are not taken into account anymore (because there is not the first chapter - CHAPTER01 things -).
So the solution would be to look at all the chapters, throw away those not belonging to the current part, search the lowest one (here CHAPTER02) and also adjust the chapter number.
This is possible of course, but I thought it was maybe too much here.
I also thought that keeping all the chapters was the best solution after cutting : in each file you know what are all the chapters in the entire clip, and their time (unless they belong to a previous part).

Of course if some of you think that just throwing away chapters is better in some situations, I could allow that too (then you would precise whether you want to keep all the chapters, or if you want to "trim" them).


Quote:
Also it would be (or it is) possible to mux subtitles and chapter into an existing ogm file?
Yes it is possible.
You can use an omx file (same as OggMux) :
in the "movie" tag you use your ogm file, in the subtitles tag, you precise your subtitle file with the comment, and in the chapters tag you precise the file (same formats supported that OggMux) containing the chapters.
That's all .

Well you wouldn't be able to use this omx file with OggMux since the video file must be an AVI one, but omx file was a convenient way for me to add comments and chapters functionality
With OGMuxer you would also be able to precise other OGM files, or even AC3/MP3/SRT ones in the soundtracks or subtitles tags because I just take the filename and open the file (my program determines automatically the format).
Suiryc is offline   Reply With Quote
Old 13th September 2002, 22:48   #40  |  Link
sherpya
Registered User
 
sherpya's Avatar
 
Join Date: Jun 2002
Location: Italy
Posts: 110
About the divx audio, what are you using to demux the audio?
DirectShow or ACM? (I will look the enitire thread maybe I've yet replied to this).
Anyway you don't need to decode the stream but extracting divxaudio to a file becomes a wma file?
If you put an avi file with divx audio into graphedit you will see
divxaudio is decoded by windows media audio dmo decoder
and accepts the input from avi splitter (and also from an avi parser)
Then I think it's also possibile... however I don't known about to insert a dmo into a graph

for chapter splitting in my python library I do this for the next split part:

- chapter list for the previous is truncated
- chapter number restart from 1
- find the time for the last chapter of the previous split and insert it as chapter 1 with time 0, this only if the first chapter of the second split is not at the ogm split time (I doubt for it )
This replicates last chapter (and for me it's ok) but you can also add an option to prevent this.


Edit: Ogm files with wma audio wont play in wmplayer 6.4 because doesn't support dmo, peraps with 9 oggds crashes, just to wait the new tobias's release that fixes issue with wmp9 or found an hacked wma filter (only for version 1/2, version 3 hasn't directshow filter)

Last edited by sherpya; 13th September 2002 at 22:59.
sherpya is offline   Reply With Quote
Reply

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 16:43.


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