Wednesday, April 27, 2016

Playing H.264 RTP stream from streaming of ffmpeg

To demonstrate video transmission with low bit-rate communication devices, I need to grab image from webcam and encode it in H.264 video format and send it through devices.
The target is sending 320 x 240 video in 100 kbps transmission speed.

To prototype it, I configured following demo sequences:

  1. streaming H.264 video from a webcam
    I chose the ffmpeg tool.
  2. playing streaming video
    I chose the VLC player.

RTP streaming 

To capture video with ffmpeg, it need to find webcam device name.

ffmpeg -list_devices true -f dshow -i dummy

After I found a device name, "USB HD Webcam" in my case, I could run a ffmpeg.
The '192.168.1.158' is an IP address of PC where a VLC player run.

ffmpeg -s 320x240 -f dshow -i video="USB HD Webcam" -r 2 -an -f rtp rtp://192.168.1.158:20000 -r 2 -minrate 10k -maxrate 10k -an -vcodec h264

To play RTP stream with a VLC player, it needs a SDP file.
A ffmpeg outputs SDP lines for that, I grab those lines and made text file with file extension .sdp.

Playing RTP streaming with VLC player

Finally, I run a VLC player and open the SDP file.


No comments:

Post a Comment