How to encode (e.g. H264) and divide video into segments, th
Posted: 27 Mar 2012 17:49
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.
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.