i have encoded H.264 video using ffmpeg . I want to apply packet loss model like Gilbert Eliot model to depict video transmission over unreliable network. Like in this thread TV noise is simulated. But noise in internet is different. So is there a way to simulate packet loss/ noise for video streaming using ffmpeg or matlab?


For me your question is not clear enough. This questions come to my mind:

  • what exactly do you want to transmit? Do you want to transmit raw H.264 bitstream (NAL units) or maybe MPEG2-TS, or RTP packets? Most video transmission applications would use either MPEG2-TS or RTP. I suppose that you are not interested in HTTP or other TCP based streaming solutions.
  • you are talking about the noise in the internet. Are you interested in simulation of some specific network topology?
  • what network protocols do you want to use and how does the transmission channel looks like?

You might take a look at NS-3 network simulator. With it you can simulate quite everything and it's also quite easy to use if you are familiar with C++ and network programming. But it is probably not the easiest way to solve your problem.

I'm pretty sure that you can also stream the video with FFMPEG but I don't think that FFMPEG allows you to drop packets based on some error model. But you could use NetEm to generate packet loss, delay or duplication of packets on your Linux system.

  • $\begingroup$ Thanks for answering. I want to take H.264 bitstream as an input thank encode the video using some FEC and then generate packet loss model that depicts real time video streaming using RTP. After that decode the video and recover error/erasure occur during transmission. I have seen JM which can generate RTP packet loss but unable to decode it. Could you please suggest something better? $\endgroup$ – james Jan 2 '16 at 6:31
  • $\begingroup$ Yes JM provides a simple rtp_loss.exe app. But if you take a look at rtp_loss.cpp you will see that the implementation of keep_packet function is very simple. They just drop the packets using rand() function. So if you want to simulate bursts you should reimplement this keep_packet function. And also if you are using JM encoder do not forget to add OutFileMode=1 to your config file. $\endgroup$ – Dimitri Podborski Jan 2 '16 at 12:46
  • $\begingroup$ +1 Now getting this error. slice_qp_delta makes slice_qp_y out of range when i want to decode the file. Any idea? $\endgroup$ – james Jan 2 '16 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.