Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to stream a video over to a terminal using RTP. The video is coded in h.246. I'm using ffmpeg to extract the byte stream according to h.264 annex B :

ffmpeg -i test.h264 -vcodec copy -vbsf h264_mp4toannexb -an out.h264 

This works fine, but some NAL units are bigger than the network MTU and thus they get fragmented by IP when being sent over to the terminal. The terminal seems a little bit lazy and discards fragmented datagrams making the video playback awful.

So basically I need a way to reduce the NAL unit size, any ideas ?

share|improve this question
size of NAL is decidec by encoder at the time of encoding, nothing can be done at bitstream level. only solution seems like re-encoding. – rajneesh Jan 26 '13 at 17:05
@rajneesh thanks for your comment. I've done that. I decoded the video into raw and then reencoded it as h246, but I still get these huge (around 3kb) SPS frames that I can not reduce. – Nicolas Emiliani Jan 28 '13 at 13:29
enable multiple slice, each slice can then be put into separate NAL can choose number of slice per picture according to picture-size, bitrate. – rajneesh Jan 28 '13 at 17:14
@rajneesh I've been trying to do what you suggested with no luck, I'm using x264 for the encoding but I still get huge SPSs... this is the line I'm trying : $ x264 --profile baseline --input-res 352x288 --slices 8 --slice-max-size 1200 -o test.h264 --fps 15 --bitrate 90 video.yuv – Nicolas Emiliani Jan 30 '13 at 13:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.