Page 1 of 1

How to encode (e.g. H264) and divide video into segments, th

Posted: 27 Mar 2012 17:49
by andersbranderud
I want to transmit an encoded video file over a simple UDP-protocol that doesn't receive any acknowledgments from the receiver. The file should be encoded into small segments, so that the segments received and decoded by the receier, can be immediately played.
The major challenge of my problem is that which I outline in the title.

The data to be sent should be located in a big buffer of encoded video-data, to which I easily can apply FEC-code. For each playable (when decoded) segement of the video, I will apply FEC-code using a separate FEC-code session.

I am looking for some guidelines of an overview of how to step-by-step implement this.

Is this a good idea?:

Sender-side:
Take a video-file.
Use e.g. a H264-encoder from a video encoding library (e.g. FFMPEG) and encode the video into 1 sec- playable segments.
Apply FEC-code on each 1-sec-segment.
For each 1-sec-segment:
Send the data over UDP (include one byte containing a number outlining which FEC-encoding-session the data belongs to).

Receiver-side:
For each 1-sec-segment:
Receive all data containing to the same FEC-session. When enough packets are received, FEC-decode the data.
Use H264-decoder
Play the segment if no segment is playing and it is the next segment to be played; or put in its right position in the queue of segments to be played.

Re: How to encode (e.g. H264) and divide video into segments

Posted: 07 Apr 2012 03:48
by str3tmonk
Seems like you're trying to reinvent HLS (Apple's HTTP Live Stream format). As far as I know, VLC does not support encoding HLS streams as of yet. Google "mediasegmenter" to see how to do it in another solution.

Hope this helps.