Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Modify umc_mpeg4_dec to use MP4Splitter...

scott5
Beginner
578 Views

I am trying to decode a MPEG4 audio and video stream, using the sample program umc_mpeg4_dec.

I realize the sample program uses AVISplitter, so I thought it would be as simple as changing it to MP4Splitter, however I get an -880 error, UMC_BAD_STREAM, when trying to play it.

The same media file plays / decodes just fine within the simple_player program, so I know it's a good file.

Any suggestions?

Thanks,

Scott

0 Kudos
9 Replies
bendeguy
Beginner
578 Views

Hi Scott!

Is this an avi file? Or two individual stream? Or what? For example I use umc_mpeg4_dec to decode my video stream and use aac decoder to decode my audio.

Greetings,

Bendeguy

0 Kudos
scott5
Beginner
578 Views

It is not an AVI file, it is a raw MPEG4 audio and video stream taken from an IP camera. Like I mentioned, the simple_player can play the stream fine, but I want to decompress it using the MP4Splitter then transfer it to Windows Media Encoder for streaming.

Thanks,
Scott

0 Kudos
bendeguy
Beginner
578 Views

Hi!

As far as I know in MPEG4 streaming the audio and the video data arrives on two different channels so what you got is audio and video streams but they are independent from each other. So you don't have to use a splitter.I think the Mpeg4Splitter is for mpeg4 files. I use IP camera too but in my case a program accept the audio and video data from the camera by RTP and creates packets for me with a chunk of audio and video and I decode them independently and synchronize it when I play. How do you obtain your stream from the camera?

Greetings,

Bendeguy

0 Kudos
scott5
Beginner
578 Views

The camera I am working with is a Sony SNC-RZ25N, and it too sends MPEG4 streams via RTP. If you wouldn't mind, I'd be interested in the method, and code, you are using to retrieve the MPEG4 data from your camera? Or, at the very least, what are you doing to decode the MPEG4 data from your camera?

Thanks,
Scott

0 Kudos
bendeguy
Beginner
578 Views

Hi Scott!

I don't really know too much details about the receiving of the rtp packets. What I know about this we uselive555(http://www.live555.com/) to receive them and after this we collect frames (I and all of the P until the next I) and send it to my decoder.

Decoding:
First of all I initialize the decoder and the renderer(I use NullVideoRenderer because I don't have to display the picture but send it to an other component of our program) after then, when I have a video packet I put it to a VideoData Object:

umcres = in.SetBufferPointer((vm_byte*)p_source, length);
if ( umcres != UMC::UMC_OK ) return VD_SETBUFFERERROR;
umcres = in.SetDataSize(length);
if ( umcres != UMC::UMC_OK ) return VD_SETBUFFERERROR;

and I use the following code to decode a frame:

dst.LockInputBuffer(&out);
umcres = mpeg4dec.GetFrame(&in, &out);
dst.UnLockInputBuffer(&out);

where dst is the renderer and mpeg4dec is the decoder.

Greetings,

Bendeguy

P.S.: I advice you to start to find out how to decode the audio after the video decoding is working. By the way what kind of audio does the camera send?

0 Kudos
scott5
Beginner
578 Views

Thanks for the info! I'm not familiar with live555, but I'll check it out. As for the audio, it can be in a variety of codec's, G.711 or G.726.

Thanks,
Scott

0 Kudos
bendeguy
Beginner
578 Views

Hi Scott!

You can easily decode G.711 with

ippsMuLawToLin_8u16s and ippsALawToLin_8u16s functions.

I'm trying to decode G.726 too at the moment. I post a question about this on the forum but nobody have answered yet.

Greetings,

Bendeguy

0 Kudos
scott5
Beginner
578 Views

Bendeguy,

I was wondering if you had time to talk offline about the live555 components? There isn't much documentation to it, and I've managed to get a MPEG4GenericRTPSource setup to capture data from my IP camera, but I'm not sure if I'm doing things right, and I don't know where to retrieve the entire MPEG frame to pass to the IPP libraries for decoding.

If you have time, please contact me at: scott _at_ skmsoftware _dot_ com

Thanks,
Scott

0 Kudos
bendeguy
Beginner
578 Views

Hi Scott!

I sent you mail. Did you receive them?

Bendeguy

0 Kudos
Reply