Log in

View Full Version : Extract slices from h.264 encoded file


asifjnajua88
18th April 2012, 07:39
HI GUYS
i have final year project of transmission of H.264 encoded video file. i read the file byte by byte in binary.and send to server using udp.but now i want to transmit the video slice by slice.but i do not know how i read or extract slices from h.264 encoded video file.
please guide me.
thanks

LoRd_MuldeR
18th April 2012, 22:44
Using multiple slices per frame is optional! If the H.264 stream you are dealing with was not encoded with slices, then you can not read frames "slice by slice", because there are no slices ;)

x264, for example, does not create slices by default. You can force it to create slices with "--slices n" parameter, if you need to.

Note: x264 does not need slices for multi-threaded encoding anymore (and it has been like that for a very long time). Most up-to-date H.264 decoders don't need slices for multi-threaded decoding either.

Guest
18th April 2012, 22:49
Also, there are other things in the stream than slices! You have for example SPSs, PPSs, SEIs. So if you are thinking of just sending slices, you'll need to rethink it.

The AVC spec can tell you how to parse slices from the bitstream.