Re: [Live-devel] Converting H.264 RTP Video to MPEG-2 Transport Stream

2012-04-12 Thread Ross Finlayson
> Although it works fine, but noticed that there is a memory copy which I think > is redundant. I have tried to let fTo point directly to fInputBuffer, but > that caused the generated data full of garbage. I don't known why. who will > use fTo later and where is fTo's initialization? "fTo" is

Re: [Live-devel] Converting H.264 RTP Video to MPEG-2 Transport Stream

2012-04-12 Thread JeffChen
I add this code in doGetNextFrame(): if (fMaxSize > fInputBufferSize) { fInputBufferSize = fMaxSize; delete[] fInputBuffer; fInputBuffer = new unsigned char[fInputBufferSize]; *( reinterpret_cast(fInputBuffer) ) = htonl(0x01); } // Arrange to read data directly into the client's buffer: fI

Re: [Live-devel] Converting H.264 RTP Video to MPEG-2 Transport Stream

2012-04-09 Thread Ross Finlayson
> This *should* work, with one modification: You will need to add a 'start > code' (i.e., 0x00 0x00 0x00 0x01) before each NAL unit that comes out of the > "H264VideoRTPSource". You will need to do this - using a separate filter > class (that you would write) - before you feed the output into

Re: [Live-devel] Converting H.264 RTP Video to MPEG-2 Transport Stream

2012-04-09 Thread 陈跃辉
Thanks very much for your assistance! I do the "H264VideoRTPSource -> H264VideoFileSink -> testH264VideoToTransportStream" test and yes, VLC can play the generated file successful. This *should* work, with one modification: You will need to add a 'start code' (i.e., 0x00 0x00 0x00 0x01) before ea

Re: [Live-devel] Converting H.264 RTP Video to MPEG-2 Transport Stream

2012-04-09 Thread Ross Finlayson
> I have an application running on iPhone that generates an H.264 RTP > video stream from camera. I wanna writing an application to convert > the received H.264 stream to an MPEG-2 Transport Stream and then > stream the live TS to another device. > > my first try is modified the example "testH264V

[Live-devel] Converting H.264 RTP Video to MPEG-2 Transport Stream

2012-04-09 Thread 陈跃辉
Hello Everyone! I have an application running on iPhone that generates an H.264 RTP video stream from camera. I wanna writing an application to convert the received H.264 stream to an MPEG-2 Transport Stream and then stream the live TS to another device. my first try is modified the example "test