How can I play gtalk rtp payload data for video using codec h264? - rtp

I deal with rtp packets of gtalk video. I want to make video using gtalk rtp payload data. According to my search gtalk use h264 codec for video.
I combined all of rtp payload which is send with gtalk video and wanted to play ffplay using this comment "ffplay -f h264 "filename" but I can't see
anything and I take this error "Could not find codec parameters (Video: h264, yuv420p)". I think my wrong is combining rtp payload. how can I play this payload?
Thanks for your helps.
Cheers.

It could be that you need the sequence and picture parameters sets (SPS and PPS) which are often transferred during session setup. Standard protocols used for this are RTSP and SIP though I have no clue whether gtalk uses either of these.

Related

Gstreamer H264 RTP

I am using GStreamer 1.0 to capture and display a video broadcast by an MGW ACE encode(or from a VLC itself), I am using RTP with H264
I have read that the sender's SPS and PPS information is needed in order to decode.
Both information is added in the sprop-parameter-sets parameter.
But if I can't get that information, is there any way I can decode and display without adding that parameter?
My Payload is the following:
gst-launch-1.0 -vvv udpsrc port = 9001 caps = "application / x-rtp, media = (string) video"! rtph264depay! decodebin! autovideosink
I have verified that from two different hosts, one to emit and another to receive through gstreamer, I have no problem, I can send and receive it without problem.
But when I try to receive a video from a MGW ACE encode from a VLC itself, I cannot display it.
Some RTP streaming scenarios repeat SPS/PPS periodically in-band before each IDR-frame. However I believe they do for convenience for that particular case. If i remember correctly RTP defines SPS/PPS transmission to occur out of band, via SDP information.

WebM packet headers for real time streaming

I need to stream webm video to browser from my video server.
The video server (C++) receives vp8 encoded frame packets of webcam or screen from the client with .ivf headers like <4_bytes_data_size><8_bytes_pts><vp8_encoded_data>. Also I send 4 bytes of total packet duration before the rest of data, so the server knows the presentation timestamp, size and duration of each frame.
The question is: which headers should I use for frames in order for the browser to be able to play the stream in the <video> tag. Maybe there is some standard for webm real time streaming implementing?
PS: AFAIK the webm consists of EBML markup. If the same is used in <video> tag to parse the stream, could someone explain me what are the minimal set of EBML elements for video playback (no audio, just video)?
Video tag does not support ivf. Minimum webm requirement is whatever the minimum is to package your stream.

Avcodec : generate OPUS header for a stream

I'm using OPUS with avcodec to encode sounds and stream it using my own protocol.
It works with the MP2 codec so far but when I'm switching to OPUS, I have this issue :
[opus # 1b06d040] Error parsing the packet header.
I suppose that unlike MP2, I need to generate a header for my OPUS encoded data stream but I don't know how.
Can someone explain me how to do that? Thanks.
This error comes from ff_opus_parse_packet() failing, which handles the raw opus packet header, what the specification calls the 'TOC' (for table-of-contents) byte and optional subframe lengths. It means libavcodec couldn't find the packet duration where it expected.
So probably your custom protocol is corrupting the data, returning the wrong data length, or you're otherwise not splitting the opus packet out of your framing layer correctly.
You don't need to invent your own protocol if you don't want to. There are two established designs: Opus over RTP for interactive use (like live chat where latency matters) is documented in RFC 7587. For HTTP streaming, file storage for recording, playback and other applications like that use the Ogg container, documented here. There are implementations of both of these in libavformat. See rtpenc.c, oggenc.c and oggparseopus.c if you're curious about the details.

Write RTP Stream Data to file

I have written an application which triggers an IP Camera to stream it's data (MPEG4) over RTP. This works fine so far - I start to setup and start the stream with the corresponding RTSP commands ( DESCRIBE, SETUP and PLAY ).
While streaming I receive the usual Sender Reports and send my own Receiver Reports - Everything is working fine here.
Now with the application mentioned above, I do NOT read the stream. I have a seperate hardware , which just logs all the stuff going over the Ethernet ( a little bit like Wireshark ). Now when the whole streaming is finished I can download those logs from my hardware and extract data from them.
So what I have then is a logfile with all the data from the RTP stream as raw data.
My question would now is: How do I write this appropriately into a MPEG4 file? I know this is a very broad question and I don't expect to get a step-by-step tutorial. But actually I am a bit overwhelmed and don't know where to start.If I just memcpy all the Payload from the RTP messages sequentially into a MPEG4 file it doesn't work. Now I am also a bit confused by SDP and stuff.
Well maybe someone has a link or some help for me..?
You should first read RFC3016, which describes the RTP format of MPEG-4 stream, then you'll know how to extract MPEG-4 frames from the RTP stream.
I actually changed from MPEG4 to H.264 - it actually was a little bit easier to write a video file like this. For H.264 this answer covers it pretty much:
How to process raw UDP packets so that they can be decoded by a decoder filter in a directshow source filter

RTP H.264 save and replay

We are interested in saving a H.264 stream and replaying it. Is there any one who experience saving h.264 using winpcap and replaying it. We were able to save H.263 and replay, but same logic does not work for H.264.
We also tried rtpdump tool to save H264 stream, but we were unable to replay it in that format?
thanks in advance
An H.264 stream is usually sent as a Transport Stream (TS). If you want to save it to file then you need to demux it and then mux it to a format suitable for file storage, for example MP4.
You will probably need to disable bframes in your encoder. Saving an RTP H.264 didn't work for me with bframes enabled.
I also advise to use a low keyint value because the dump will only be readable after the first keyframe.
You can use VLC to save the incoming stream with this command:
vlc -I rc rtp://#:4444 :sout=#std{access=file,mux=mp4,dst=output.mp4} :ipv4
Replace 4444 with the port number.