1
votes

I have read through several posts about H264 recording, but none of them really answer my question, so here is what I am trying to do.

A server is sending H264 encoded video packets to me, and I would like to capture and turn the packets into a video file (.mpeg or .avi)

Here is how I envision the setup: I need to setup UDP listener to capture the video packets, then send the packet payload to a DirecShow graph for processing. The DirectShow graph should consist of a H264 decoder and a MPEG encoder.

Am I on the right track?

Thank you

1
The question is not well-formed. For starters, you need to know the protocol data is on the wire encoded in. Then you might want to avoid re-encoding. Then DirectShow is not the only option, and with DirectShow you will need third party filters since stock filters don't fully cover the task.Roman R.
Hi Roman, I think the payload is encoded in H264 with 90000 samples per second. Could you tell me what other options I have? I would like to do more research on those possibilities. ThanksLex L
Maybe you wanted to tell that it is H.264 over RTP - just a guess, and a hint that you do need a research on the protocol, and this would - then - reveal the options.Roman R.
Sorry that I forgot to mention the protocol. Yes, it is H264 over RTP.Lex L

1 Answers

1
votes

If all you want to do is capture the h.264 stream and stick it into a container, I would utilize FFmpeg. I don't know the exact command line, so this is untested but try something like...

ffmpeg -i - -f mp4 output.mp4

Then, write to it over STDIN. It should detect your stream type after several packets, and begin writing to the MP4 file.