Thursday, January 03, 2008

Capture video and audio from devices and send it to RTP Stream

Capture video and audio from devices and send it to RTP :

1.I installed the cygwin in windowsXP.
2.I copied the FFMPEG with .exe
3. I connected the webcam,microphone in my pc.
4. I run this command in cygwin shell as follows :

$ ./ffmpeg -v 100 -f vfwcap -s "640x480" -i /dev/video0 -vcodec mpeg4 -f rtp rt
p://127.0.0.1:8090 -f audio_device -i /dev/dsp -acodec mp2 -f rtp rtp://127.0.0
.1:9090 2>&1 | tee ffmpeg_log_win32.txt


./ is the standard for running .exe files in cygwin shell.


we can switch over to drive using the following command:

cd D:
cd C:
we have to run the ffmpeg from the directory at which the it is being installed.


I opened the .sdp file in a QuickTime player.
After buffering the quicktime player shows the data.
SDP stands for Session Description Protocol.
.SDP file content is as follows :



v=0
o=- 0 0 IN IPV4 127.0.0.1
t=0 0
s=No Name
a=tool:libavformat
c=IN IP4 127.0.0.1
m=video 8090 RTP/AVP 96
a=rtpmap:96 MP4V-ES/90000
a=fmtp:96 profile-level-id=1
m=audio 9090 RTP/AVP 14
a=rtpmap:14 MPA/90000

I used the DS Network receiver to receive data from the specified port.
(8090) and using Dump Filter, I dumped the data in to a file.
FFMPEG transmits the data in Transport Stream format.
Our MPEG4 Encoder and decoders are in Program Stream.

No comments: