Log in

View Full Version : need something to play the audiopart of vob/mpg in delphi


Amnon82
8th April 2006, 22:12
I'm coding on an MPEG2 Player. The videopart is finished. What I still need is the audiopart.

I'm coding in Delphi7. Has someone a solution for my problem?

For the source take the link in my signature ;)

Inc
9th April 2006, 08:46
There are a big amount of mpeg2 supporting SW players out there, so I dont see your approach, .... well anyhow, if you just want to crack the nut:

- you need a Delphi-directshow interface wich besides decoding supports audio "ring-buffering", means using several audiobuffers which get refilled during the audioplayback. Look into the DirectX SDK where you can find an c++ audio streaming sample folder -> native Directshow coding could be obligatory in here if the DsPack doesnt support Streaming audio.

But I do see you already are trying to get independant of Dshow as you do access the mpeg2lib directly. So for audio it should be the same independancy. Other wise do use a Directshowplayer-code where all streams will be handled via the internal DS Filtergraph.
SO for Audio then, also here you would have to get decoding libraries for ac3 and mp2. You can find these in the libavcodec package (liba52 and mpeg2dec). So do compile dlls out of these and access these dlls like the way you did in the libmpeg2 case.
But still you would have to write that ringbuffering code.

A LOT of work ... good luck.

Amnon82
10th April 2006, 18:36
To reinvent the wheel is not the way, which I should go... I drobed the thoughts.

jfcarbel
15th June 2006, 07:58
Amnon82 - just curious is your video decoding based on DirectShow or another library?

I am also another Delphi developer and very interested in hearing more about how your project is progressing and what it will be used for.

Did you figure out how you will play the audio along with the video?

I have toyed with the idea of combining DirectShow for playback of video and audio, but for the video scrubbing (i.e. scanning thru video using the thumb track during pause) I was thinking of doing something similar to DGDecode when it loads a DVDs VOBs.

But there are 2 gotchas to this approach:

1. While the DS preview window would support resizing even during live playback. DGIndex code does not.

2. Then we need to be able to tell DS exactly where to pickup playing video when done scanning using the DGIndex method.

I think the above 2 can be accomplished but my experience in this area is very limited.

I compared the DVD playback of Nero Recode and DVD Shrink 3.2. Both supposedly done by the same programmer. However, I found the scrubbing in DVDShrink even during playback to be extremely responsive. I would really like to know how he did it as it is surely not based on DS with that kind of responsiveness. I could actually drag the video thumbtrack in DVDShrink and even before I let go it would pickup playing with audio. You can actually hold down the thumbtrack and just start quickly dragging it back and forth without letting go and it will start immediately playing very quickly - very impressive. I wish I could hire this DVDShrink guy to write my add-on clips creator for my DVDOrganizer project. DVDShrink, you listening? :)