Home/News | About | Download | Documentation | Forum | Bug Reports | Contact | Donations | Consulting | Projects | Legal | Security | FATE


how to stream raw A/V data to ffmpeg thru network.

Discussions about problems encountered using ffserver.
Forum rules
FFmpeg is in a state of perpetual development and we do not currently have the person power to backport fixes to official releases. As such, if you wish to query or report a bug, you must try with the latest development branch revision of FFmpeg to confirm the issue still exists. The latest FFmpeg can be downloaded from here: http://www.ffmpeg.org/download.html

how to stream raw A/V data to ffmpeg thru network.

Postby hi.joony » Sat Apr 28, 2012 3:02 am

Hello.

I have searched many website to find some CLI of ffmpeg. but I could not understand and figure it out due to my limited video/audio technical knowledge.
currently, I am writing a QT code to transmit raw video/audio data from my application(webcam/microphone) to ffmpeg on windows 7 platform.

so, I got this CLI at stream-m open
ffmpeg -f vfwcap -r 16 -i 0 -i http://localhost:8081/ -g 52 \ /* this looks it tries to take video frames from webcam and to take audio stream thru network, it is not very clear if they use TCP or UDP */
-acodec libvorbis -ab 64k -vcodec libvpx -vb 448k \ /* I guess this option tries to actual transcoding in realtime for both video and audio */
-f matroska http://example.com:8080/publish/first?password=secret /* using matroska container, it stream out to stream-m server */

Somehow I could not quite understand each options in detail.

I looking for a cli for ffmpeg to take both raw audio/video data through network protocols. (possible using http)
I think current my CLI does not work; maybe there is something wrong.

ffmpeg -i http://localhost:8082 -i http://localhost:8081 -g 52 -acodec libvorbis -ab 64k -vcodec libvpx -vb 448k -f matroska http://localhost:54321/publish/first?password=secret


In addition, I would like to get some basic approach how to send raw audio/video data to ffmpeg. such as which application network layer(http, rtp and so on), network layer( tcp or udp ), how much data I can send to ffmpeg ? what is delimiter for each video/audio frame ?

My knowledge and information is limited, I would like to get some your detailed guideline for me to approach if you don't mind it.
hi.joony
 
Posts: 2
Joined: Sat Apr 28, 2012 2:30 am

Re: how to stream raw A/V data to ffmpeg thru network.

Postby admin » Sat Apr 28, 2012 11:16 am

hi.joony wrote:it is not very clear if they use TCP or UDP

Whenever you are unsure about format/codec of the input media, you can always use just:
Code: Select all
ffmpeg -i INPUT

and analyze its output to see what's the format/codec of that input. Btw, HTTP protocol is TCP based protocol, so I think the answer is pretty obvious :)

Also, I don't think matroska is suitable for streaming, take a look here: http://www.videolan.org/streaming-features.html

For a start, you can try udp, as it is the best way for streaming live multimedia content in local networks:
Code: Select all
ffmpeg -f vfwcap -r 16 -i 0 -i http://localhost:8081/ -acodec libvorbis -ab 64k -vcodec libvpx -vb 448k -f mpegts udp://1.2.3.4:5678


Then, on the computer with ip address 1.2.3.4 (where you send the stream to), start VLC and try to play it:
Code: Select all
vlc udp://@:5678

or with ffplay:
Code: Select all
ffplay udp://localhost:5678

that should give you some starting points.

If you want to use http, then you should read more about FFserver: http://ffmpeg.org/ffserver.html and http://ffmpeg.org/sample.html
admin
Site Admin
 
Posts: 26
Joined: Thu May 05, 2011 4:24 pm

Re: how to stream raw A/V data to ffmpeg thru network.

Postby hi.joony » Sat Apr 28, 2012 1:02 pm

Thanks for your prompt and kind reply. maybe, my question was not very clear.

Code: Select all
             ffmpeg -f vfwcap -r 16 -i 0 \               /* I would like to send raw video data to ffmpeg, not from vfwcap */
            -i http://localhost:8081 \
            -acodec libvorbis -ab 64k \
            -vcodec libvpx -vb 448k \
            -f mpegts udp://1.2.3.4:5678


I think it should be something like the following.
Code: Select all
            ffmpeg -i http://localhost:8082 \   /* Aas you know, RGB data does not contain any time stamp and other extra informaiton, I am not sure if this  approach will work */
            -i http://localhost:8081 \
            -acodec libvorbis -ab 64k \
            -vcodec libvpx -vb 448k \
            -f mpegts udp://1.2.3.4:5678


so, Does ffmpeg CLI take two inputs( audio, video)through http network? I am wondering if this approach is ok or not. please let me know.
hi.joony
 
Posts: 2
Joined: Sat Apr 28, 2012 2:30 am

Re: how to stream raw A/V data to ffmpeg thru network.

Postby admin » Sat Apr 28, 2012 1:32 pm

Can you please come in our IRC channel ( if you use IRC client, visit irc://irc.freenode.net/ffmpeg ), to resolve this in a faster way?
If not, can you provide the output of commands:
Code: Select all
ffmpeg -i http://localhost:8081

and
Code: Select all
ffmpeg -i http://localhost:8082


And yes, ffmpeg can take multiple inputs from all over (tcp, udp, /dev/video, usb, ...).
admin
Site Admin
 
Posts: 26
Joined: Thu May 05, 2011 4:24 pm


Return to ffserver

Who is online

Users browsing this forum: No registered users and 5 guests