Custom source for H.264 video obtained from encoder card

Topics: Question
Feb 17, 2015 at 12:42 PM
I have a Stretch encoding card that can provide me with H.264-encoded video stream.

Please suggest which classes should I use in order to stream this video using RtspServer.
Coordinator
Feb 17, 2015 at 3:38 PM
RtspSource in Server/MediaTypes

If you need anything else let me know.

Im off until tomorrow or so.

Thanks!
Feb 18, 2015 at 4:26 AM
RtspServer expects an URL of the RTSP stream but I don't get RTSP stream from the card. I've mentioned video stream, but it's just a stream of frames (bytes) encoded using H.264 codec. I'm communicating with the card using SDK. So I need to packetize these frames and provide RtspServer with some IMedia. I suspect that I need to create my own implementation of IMedia or ISourceMedia.

I hope the issue is more clear now.
Coordinator
Feb 19, 2015 at 2:42 AM
Can you post a copy of the SDP the source gives you?

Do you also have a Wireshark capture of an existing player working with the card?

I would assume the card provides an IP address or an EndPoint address for your to communicate, I would also assume that there is both a public and private protocol.

You probably don't need to implement anything custom but it's quite possible and I would love to see your use case for possible inclusion in the library as a supported paradigm.

Any further information you can provide would be helpful to answering your question!

In short if you have an IP EndPoint then you don't need to do anything, as I implemented that portion completely, if the end point is serial or another protocol you will have to probably implement some protocol to communicate with the hardware anyway.

If you need anything at all just let me know!
Feb 19, 2015 at 5:03 AM
No, I don't have any IP end point. Communication to the encoding card is performed through C++ dll. So I get only binary frames, so called AV buffer.

Please suggest me what classes to use in order to packetize video frames that I get from the card.
Coordinator
Feb 19, 2015 at 5:29 AM
I think I know what your saying but maybe not since I haven't played with all hardware there is to play with.

Is your data already depackeized?

Can you send me a manual or sdk link or something which between describes the layers between yourself and the card.

If it gives you rtsp or an mpeg stream only via calls it still must have a driver or an ip , both of which are end points.

If u get av frame your data is probably in a vendors format .

Anything I can do to help though just let me know!

@Yf ;)
Feb 19, 2015 at 8:21 AM
Here is the link to the SDK: http://office.edsd.ru/files/SDVR/sdvr_sdk.html

I provide SDK with a callback of the following signature:
typedef void (*sdvr_av_frame_callback)(sdvr_chan_handle_t handle,
                                       sdvr_frame_type_e frame_type,
                                       sx_bool primary_frame);
Within the callback I get a buffer with the following function:
sdvr_err_e sdvr_get_stream_buffer (sdvr_chan_handle_t    handle,
                                   sdvr_frame_type_e     frame_type,
                                   sx_uint32             stream_id,
                                   sdvr_av_buffer_t   ** frame_buffer);
And after that I can get buffer data using different functions:
sdvr_err_e sdvr_av_buf_payload (sdvr_av_buffer_t *  frame_buffer,
                                sx_uint8         ** payload,
                                sx_uint32        *  payload_size);

sdvr_err_e sdvr_get_buffer_yuv_payloads (sdvr_av_buffer_t *  frame_buffer,
                                         sx_uint8         ** y_data,
                                         sx_uint8         ** u_data,
                                         sx_uint8         ** v_data);
Coordinator
Feb 21, 2015 at 1:49 AM
You have to decode the frame using 7.6

If the format is raw in the frame you can just use existing rfc, if proprietary then decoding or dynamic format or at least wrapping to a suitable rfc allowed format.

Yes, hosting of the stream would need to implement the rtpsink class unless there is an existing player for the dvr which can be leveraged, is there another Instruction manual on how to play separate from the sdk?
Marked as answer by juliusfriedman on 2/20/2015 at 5:49 PM