VLC UDP Multicasting to a RTMP flash client

1,763 views
Skip to first unread message

facundo

unread,
Oct 22, 2011, 12:30:33 PM10/22/11
to C++ RTMP Server
Hi,
we are trying to convert a udp multicast coming from VLC, in "some
way" making into a rtmp to be played in a Flash player.

The "some way" we are trying are two:
1. crtmpserver consuming the UDP multicast directly (using
inboundUdpTs)
2. or, by putting ffmpeg in the middle to convert the multicast
into a tcp live flv (using inboundLiveFlv).

In both cases the video doesn't play smoothly as if i use a vlc
client consuming the udp multicast directly.

Any recommendations or ideas??


Thanks in advance.
Facundo

C++ RTMP Server

unread,
Oct 22, 2011, 5:47:04 PM10/22/11
to c-rtmp...@googlegroups.com
Can you paste the command you use for VLC? I would like to see it myself and try to fix possible issues.

As far as I know, VLC works just fine as a RTSP server and crtmpserver as a RTSP client
Also ffmpeg works fine with mpegts over tcp as feeder and crtmpserver as consumer. I will fix UDP support ASAP as well

Cheers,
Andrei

> You received this message because you are subscribed to "C++ RTMP Server" mailing list.
> To post to this group, send email to c-rtmp...@googlegroups.com
> To unsubscribe from this group, send email to
> c-rtmp-serve...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/c-rtmp-server?hl=en

facundo

unread,
Oct 22, 2011, 7:11:14 PM10/22/11
to C++ RTMP Server
Sorry, i answer only to the author. Will paste the VLC command again:
vlc a.avi --
sout='#duplicate{dst=std{access=udp,mux=ts,dst=239.1.1.1:1234}}' :sout-
all -I dummy

and the ffmpeg command:
ffmpeg -i udp://239.1.1.1:1234 -vcodec copy -b 5 -strict
experimental -g 25 -me_method zero -acodec none -metadata
streamName=pepe -f flv tcp://localhost:6666


I had to remove the "-re" option from ffmpeg to make it work smoothly.

Cheers,
Facundo.-
>  smime.p7s
> 6KViewDownload

C++ RTMP Server

unread,
Oct 22, 2011, 7:45:36 PM10/22/11
to facundo, c-rtmp...@googlegroups.com
Hi,

Please try not replying to me directly in the future, other people on the mailing list may be interested in your findings :)

So, first observation: I see that in VLC case you use an AVI as input. Is taht containing h264/aac? if not, is not going to work at all.

Second, I think you over-complicate the problem. Why don't use use ffmpeg or VLC directly?

Third, here are some commands for bringing in streams
VLC,mpegts,udp, real time, transcoding (just for fun, to see that's possible)
/Applications/VLC.app/Contents/MacOS/VLC -I dummy ~/Desktop/TCIgnored/bunny.mp4 --sout='#transcode{acodec=aac,vcodec=h264,x264-bframes=0}:std{access=udp,mux=ts,dst=127.0.0.1:9999}' --sout-x264-bframes=0

VLC,RTSP,no transcoding,real-time
/Applications/VLC.app/Contents/MacOS/VLC -I dummy ~/Desktop/TCIgnored/bunny.mp4 --sout='#rtp{dst=0.0.0.0,sdp=rtsp://0.0.0.0:2323/test.sdp}'

ffmpeg,mpegts,udp, no transcoding, realtime
ffmpeg -re -i ~/Desktop/TCIgnored/bunny.mp4 -codec copy -vcodec copy -vbsf h264_mp4toannexb -f mpegts "udp://127.0.0.1:9999"

ffmpeg,mpegts,tcp, no transcoding, realtime
ffmpeg -re -i ~/Desktop/TCIgnored/bunny.mp4 -codec copy -vcodec copy -vbsf h264_mp4toannexb -f mpegts "tcp://127.0.0.1:9999"

ffmpeg,mpegts,tcp, no transcoding, super fast (completely useless because it is finished before you have a chance to start the playback. Again, just for the sake of completeness)
ffmpeg -i ~/Desktop/TCIgnored/bunny.mp4 -codec copy -vcodec copy -vbsf h264_mp4toannexb -f mpegts "tcp://127.0.0.1:9999"


on crtmpserver side, you need to add another acceptor (just below the existing inboundTcpTs):
{
ip="0.0.0.0",
port=9999,
protocol="inboundUdpTs",
},

Also, if you want to consume the RTSP stream from VLC, you can add this to the external streams section:
{
uri="rtsp://localhost:2323/test.sdp",
localStreamName="test1"
}

Hope it helps

On Oct 23, 2011, at 2:09 AM, facundo wrote:

> this is the VLC command:


> vlc a.avi --
> sout='#duplicate{dst=std{access=udp,mux=ts,dst=239.1.1.1:1234}}' :sout-
> all -I dummy
>
>

> An update on this, i made it work by removing the "-re" option from
> ffmpeg.
> This is the ffmpeg command that I'm using right now:


> ffmpeg -i udp://239.1.1.1:1234 -vcodec copy -b 5 -strict
> experimental -g 25 -me_method zero -acodec none -metadata
> streamName=pepe -f flv tcp://localhost:6666
>

> i have acode to none because i don't need audio.
>
> Any improvement is more than welcome.
>
> Will try the rtsp option again, but i couldn't make it work.
>
> Thanks,
> cheers,


> Facundo.-
>
> On Oct 22, 7:47 pm, C++ RTMP Server <crtmpser...@gmail.com> wrote:

>> smime.p7s
>> 6KViewDownload

Facundo Garat

unread,
Oct 22, 2011, 8:49:28 PM10/22/11
to C++ RTMP Server, c-rtmp...@googlegroups.com
Yup, sorry. About that.

I'm trying not to over-complicate but i have no control on the UDP Multicast, we are integrating this solution on a legacy system that use this udp multicast, so we have to use something to integrate that multicast in rtmp stream to be used by a flash player.

Will try this and let you know.


Thanks
Cheers,
Facundo.-
Reply all
Reply to author
Forward
0 new messages