PDA

View Full Version : Muxing m2v and ac3 into VOB - Delphi


PJones2101
3rd June 2005, 13:57
I'm looking for some Delphi code / components / direction to Demux and mux
VOB / M2V / AC3 files. Any suggestions. Basically I want to code an app to
split a VOB, run it through an encoder to reduce size and recreate the VOB
file automatically. Any suggestions. Thanks

Darksoul71
5th June 2005, 21:56
Hi,

hm, the easiest approach would be using external tools to do this. Something like this:

bbdmux -> extracting all streams you want
rejig or requant -> shrinking your video to the size you want
mplex -> re-muxing your streams as MPG
dvdauthor -> generating VOBīs from MPG

Re-encoding can also be done via AVISynth and any MPEG encoder which can be called via Commandline (or Encoder + Tools, e.g. CCE + EclCCE).

If you think about a "DVD2DVD-R" solution where subtitles are included this will get more complicated. Have a look at the GKnot sources for running VOBSub.

-D$

SeeMoreDigital
5th June 2005, 22:16
If you want to try an external .VOB muxing tool, personally, I would recommend MuxMan (http://forum.doom9.org/showthread.php?t=93553).


Cheers

Darksoul71
5th June 2005, 22:37
@SeeMoreDigital:
Wow, a valid option !

@PJones2101:
Yep, MuxMan looks more promising and skips a step compared 2 mplex+dvdauthor.

BTW: Couldnīt DVD2SVCD make good use of MuxMan ?

PJones2101
6th June 2005, 11:04
Thx Guys. I really wanted to actually do it in Delphi code because then I have a little more control ( and I like control. ) But if that's the best way to do it. Then I suppose so. By the way - Ever try the HX Encoder. Brilliant. Going to use that for my project.

Enots_
6th June 2005, 12:15
Doing your own mux is a lot of work - at least if you want a compliant mux. Basically what you'd need to do to write one is:
a) Write a packetizer - the packetizer needs to chop up video and AC3 put it into packets, create pack and packets headers. To do this right you need to parse the mpeg as well as the AC3 in order to make sure that your packets start in the right place, that the right packets have time stamps.....

b) Write the buffer model logic - DVD (VCD & SVCD too) has a pretty complex buffer model. Basically what this means is that the timestamps in the stream - which you must set by muxing - controls the reading and decoding timing in the DVD player. The DVD spec only has a limited amount of memory availble (I believe some 300k) so it's important that the timestamps are far enough apart that the DVD players don't read more data from the disc than it can hold in this memory. On the other it's also very important that the pictures you wish to display have already been read. And last you need to make sure that the decoding time stamps give the decoder enough time to decode a frame before it must be displayed without ofcause demanding that it decode faster than the spec says the hardware can. As you can imagine - this can get pretty ugly.

The spec for the buffer model is ISO/IEC 13818-1. It's 160 pages (although you'd need less than half of tha

mpucoder
6th June 2005, 13:05
The STD buffer model is only the tip of the iceberg in DVD multiplexing, there's VOBU size, subpicture timing, audio timing, NAV pointers, and a 100 other things.
MuxMan will handle the subpictures as well.

Sirber
6th June 2005, 14:04
use TDosCommand to manage your external apps :)

Enots_
6th June 2005, 16:59
Obviously mpucoder is right. Packetizing and looking after the buffermodel is just the start. Although in my humble opinion the more difficult part of it. If you're not confident on your skills of writting code to spec, don't play with a mux it is in my opinion the most difficult part of DVD's..

PJones2101
7th June 2005, 19:56
Seeing that this is a casual project - Stuff That :-) Muxman it is. Thanks for the advice.

Dmitry Vergheles
9th June 2005, 14:08
for fast MPEG2 video recompression have a look at SolveigMM Requantizer DirectShow Filter.
http://www.solveigmm.com/?Products&id=MPEG2Requant

Darksoul71
9th June 2005, 14:32
@Dmitry Vergheles:
Rule #5: Do not spam. No blatant advertising !
In relation to this I wouldnīt post a link to a product I sell myself !
To me this seems like advertising as you do not really help him on the topic !

Just my 2 cents,
-D$

Dmitry Vergheles
9th June 2005, 15:11
@Dmitry Vergheles:
Rule #5: Do not spam. No blatant advertising !
In relation to this I wouldnīt post a link to a product I sell myself !
To me this seems like advertising as you do not really help him on the topic !

Just my 2 cents,
-D$

Actually I'd reccomend the author any other requantizer if I knew one ;)
IMHO, such a component is an one of the author asked about.
So, I don't really think it was blatant.

Darksoul71
9th June 2005, 15:31
@Dmitry: Not to sound picky but he asked for this:
I'm looking for some Delphi code / components / direction to Demux and mux
VOB / M2V / AC3 files.
No involvment of recompression unless in the next line ;)

Actually I'd reccomend the author any other requantizer if I knew one
Rejig, Requant, etc.
You name it, we have it .... :D

-D$

PJones2101
11th June 2005, 18:34
Thanks DarkSoul - By the way I have another awesome compressor I use, developed in this forum - ( No names but look under Other Mpeg compression ) VERY near the top - Anyway. DeMuxing and Muxing seems very complicated for a private small project, so I'm just going to shell out to other utilities.

Darksoul71
12th June 2005, 19:13
Thanks DarkSoul - By the way I have another awesome compressor I use, developed in this forum - ( No names but look under Other Mpeg compression ) VERY near the top - Anyway. DeMuxing and Muxing seems very complicated for a private small project, so I'm just going to shell out to other utilities.
@PJones: U r welcome ! :cool:

Are you talking about the HC encoder ?

BTW: Writing DeMux and Muxing "just to have it done by yourself" to me would only make sense for two reasons:
1) You are keen on learning something new
2) You have a lot of time :)

Just kidding, but running those apps Iīve mentioned via shell should be sufficent. Additionally you have at least some control by verifiying the output of those tools.

-D$

PJones2101
1st July 2005, 11:33
Sorry for the long delay - I stay in South Africa ( Cape Town to be exact ) - and they limit you to 3GB per MONTH.

I wanted to make an app that extracts streams from a movie DVD only - recompress the video with GC ( :-) ) and then remux everything, so that I can run it overnight. Because HC takes +- 5 Hours on a .m2v file.

I don't mind the manual labour - just felt like making a little tool.

By the way the movie contains the video stream and 1 ac3 5.1 file.

Anyway thanx again for the advice !