Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Broadcasting streaming media > Re-broadcasting streaming media
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 07-07-2011, 05:41 PM
secretsquirrel secretsquirrel is offline
Junior Member
 
Join Date: Jul 2011
Posts: 4
secretsquirrel is on a distinguished road
Default

Use ffserver, ffmpeg, rtmpdump, VLC to convert live RTMP stream into UDP multicast


I've been banging my head against the desk for a while now with this problem, but hopefully one of you can help me. I'm attempting to use rtmpdump and VLC to convert (redirect) a couple of live RTMP streams into UDP multicasts.

When I try
Code:
rtmpdump.exe -v -r rtmp://stream2.france24.yacast.net/france24_live/en -a france24_live/en -W http://www.france24.com/en/sites/all/modules/maison/aef_player/flash/player.swf -p http://www.france24.com/en/aef_player_popup/france24_player -y f24_liveen | "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -
VLC pops up and the video plays perfectly. However, when I try

Code:
rtmpdump.exe -v -r rtmp://stream2.france24.yacast.net/france24_live/en -a france24_live/en -W http://www.france24.com/en/sites/all/modules/maison/aef_player/flash/player.swf -p http://www.france24.com/en/aef_player_popup/france24_player -y f24_liveen | "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" - :sout-all :sout=#duplicate{dst=udp{mux=ts,dst=239.1.1.1:9000},dst=display} :ttl=20 :sout-keep
The audio shows up, but the video disappears on the local display. Tuning into the multicast confirms the video PID has dropped. VLC is pumping out the error that duplicate PCRs are being output, so I'm guessing this is why the video is being dropped. Any ideas on how to fix this?

Thanks in advance
-SS
Reply With Quote
  #2  
Old 07-13-2011, 12:58 AM
hyc hyc is offline
RTMPdump team
 
Join Date: Dec 2009
Posts: 169
hyc will become famous soon enoughhyc will become famous soon enough
Default

Re: use rtmpdump and VLC to convert a couple of live RTMP streams into UDP multicasts


Personally I would use ffserver instead, though I'm not sure it does UDP broadcasts. It definitely does RTP though. You might even be able to just use ffmpeg with an RTMP URL as the input and a UDP URL as the output.

vlc has always been pretty finicky and I've never had much success with it for streaming.
Reply With Quote
  #3  
Old 08-05-2011, 12:52 PM
secretsquirrel secretsquirrel is offline
Junior Member
 
Join Date: Jul 2011
Posts: 4
secretsquirrel is on a distinguished road
Default

Re: use rtmpdump and VLC to convert a couple of live RTMP streams into UDP multicasts


I've actually kept grinding on this issue and I think I almost have it solved, but maybe need just a little nudge to help figure it out the rest of the way.

So I took your suggestion (hyc) from the post you made at the Videolan forums and tried ...
Code:
ffmpeg "rtmp://stream2.france24.yacast.net/france24_live/en app=france24_live/en swfUrl=http://www.france24.com/en/sites/all/modules/maison/aef_player/flash/player.swf pageUrl=http://www.france24.com/en/aef_player_popup/france24_player playpath=f24_liveen" -an -vcodec copy -f rtp rtp://10.188.252.76:9002 -vn -acodec copy -f rtp rtp://10.188.252.76:9004 -newaudio
I realized this didn't work because it needs the "-i" to specify input and the swfUrl has changed recently. So I tried this ...
Code:
ffmpeg -loglevel verbose -i "rtmp://stream2.france24.yacast.net/france24_live/en app=france24_live/en swfUrl=http://www.france24.com/en/sites/all/modules/maison/aef_player/flash/player_new.swf pageUrl=http://www.france24.com/en/aef_player_popup/france24_player playpath=f24_liveen live=1" -vcodec copy -acodec copy -vbsf h264_mp4toannexb -f mpegts udp://10.188.252.76:9000
This seems to be ok, but I'm still left with only audio on the receiving end. VLC can pick up that there is a video stream (it shows it in the codec details on stream0), it just doesn't spit anything out. I get a lot of this error...
Code:
packetizer_h264 warning: waiting for SPS/PPS
I wondered if it was just this feed, so I tried Bloomberg with this command...

Code:
ffmpeg -i "rtmp://cp87869.live.edgefcs.net/live app=live playpath=us_300@21006 swfUrl=http://player.ooyala.com/static/cacheable/63abb43363926ab.e712725090ebb5f31/player_v2.swf swfVfy=1 pageUrl=http://www.bloomberg.com/tv live=1" -vcodec copy -acodec copy -vbsf h264_mp4toannexb -f mpegts udp://10.188.252.76:9000
Now I have the opposite problem. I get pictures with no audio. Once again VLC sees both the audio and video streams and can identify the codec being used, but I get a lot of this error...
Code:
faad warning: Unexpected channel configuration change
Any clue at all how I could clean this up?

Thanks!
Reply With Quote
  #4  
Old 08-06-2011, 02:22 AM
hyc hyc is offline
RTMPdump team
 
Join Date: Dec 2009
Posts: 169
hyc will become famous soon enoughhyc will become famous soon enough
Default

Re: Use ffserver, ffmpeg, rtmpdump, VLC to convert live RTMP stream into UDP multicas


Are you sure you even need that bitstream filter in there? I have to say, that filter has been pretty buggy for as long as I've worked with the ffmpeg code. (Which is a couple years already...) Just for experimental purposes, have you tried using any other output formats?

Like I said, I have pretty good luck with ffserver serving over RTP and HTTP.
Reply With Quote
  #5  
Old 08-06-2011, 06:24 PM
secretsquirrel secretsquirrel is offline
Junior Member
 
Join Date: Jul 2011
Posts: 4
secretsquirrel is on a distinguished road
Default

Re: Use ffserver, ffmpeg, rtmpdump, VLC to convert live RTMP stream into UDP multicas


Unfortunately, yes, I seem to need the bitstream filter. If I don't use it, I get ...
Code:
[mpegts @ 0x985cde0] h264 bitstream malformated, no startcode found, use -vbsf h264_mp4toannexb
av_interleaved_write_frame(): Operation not permitted
And I get dumped back out to command prompt.

All these errors seem to me to center around malformed or missing PCR or ffmpeg's mpegts muxer is broken. Actually, in looking about the Internet, it would seem there's something odd about mpegts and h264 that ffmpeg doesn't handle well. I'm not about to give up yet, but I do need some more ideas on what I could try to do to fix this.
Reply With Quote
  #6  
Old 08-06-2011, 09:48 PM
hyc hyc is offline
RTMPdump team
 
Join Date: Dec 2009
Posts: 169
hyc will become famous soon enoughhyc will become famous soon enough
Default

Re: Use ffserver, ffmpeg, rtmpdump, VLC to convert live RTMP stream into UDP multicas


I still think you should try ffserver instead. This works for me with your France24 stream

ffserver.conf example
Code:
Port 8090
RTSPPort 554
BindAddress 0.0.0.0
MaxHTTPConnections 1000
MaxClients 200
MaxBandwidth 10000
CustomLog -

<Feed l.ffm>
File /tmp/l.ffm
FileMaxSize 2000M
</Feed>

<Stream test1.flv>
Format rtp
Feed l.ffm
MulticastAddress 224.124.0.1
MulticastPort 5000
MulticastTTL 16
NoLoop

VideoCodec libx264
VideoFrameRate 25
VideoBitRate 400
VideoSize 384x224
AVPresetVideo default
AVPresetVideo main
AVOptionVideo flags +global_header

AudioCodec libfaac
AudioBitRate 48
AudioChannels 1
AudioSampleRate 44100
AVOptionAudio flags +global_header

</Stream>
Start ffserver with that config file, start ffmpeg:
Code:
ffmpeg -i "rtmp://stream2.france24.yacast.net/france24_live/en app=france24_live/en swfUrl=http://www.france24.com/en/sites/all/modules/maison/aef_player/flash/player_new.swf pageUrl=http://www.france24.com/en/aef_player_popup/france24_player playpath=f24_liveen live=1" http://localhost:8090/l.ffm
set client to play from http://server:8090/test1.sdp

============


This is even easier, don't use ffmpeg at all, just let ffserver fetch the stream directly:

Code:
Port 8090
RTSPPort 554
BindAddress 0.0.0.0
MaxHTTPConnections 1000
MaxClients 200
MaxBandwidth 10000
CustomLog -

<Stream test1.flv>
Format rtp
MulticastAddress 224.124.0.1
MulticastPort 5000
MulticastTTL 16
NoLoop

File "rtmp://stream2.france24.yacast.net/france24_live/en app=france24_live/en swfUrl=http://www.france24.com/en/sites/all/modules/maison/aef_player/flash/player_new.swf pageUrl=http://www.france24.com/en/aef_player_popup/france24_player playpath=f24_liveen live=1" 
</Stream>

Last edited by hyc : 08-06-2011 at 10:36 PM.
Reply With Quote
  #7  
Old 08-08-2011, 10:46 PM
secretsquirrel secretsquirrel is offline
Junior Member
 
Join Date: Jul 2011
Posts: 4
secretsquirrel is on a distinguished road
Default

Re: Use ffserver, ffmpeg, rtmpdump, VLC to convert live RTMP stream into UDP multicas


I had to look into ffserver a bit because the documentation is fairly sparse compared to ffmpeg, but I don't think this will work unless I'm reading this all wrong.

The target playback devices are a couple of IPTV set top boxes, so I need these streams bent into standard MPEG-TS UDP or RTP multicasts. This seems to be packing them up for an on-demand reflector service. Unfortunately, I think these little boxes are too dumb to know what to do with that.
Reply With Quote
  #8  
Old 08-09-2011, 04:09 PM
hyc hyc is offline
RTMPdump team
 
Join Date: Dec 2009
Posts: 169
hyc will become famous soon enoughhyc will become famous soon enough
Default

Re: Use ffserver, ffmpeg, rtmpdump, VLC to convert live RTMP stream into UDP multicas


Quote:
Originally Posted by secretsquirrel View Post
I had to look into ffserver a bit because the documentation is fairly sparse compared to ffmpeg, but I don't think this will work unless I'm reading this all wrong.

The target playback devices are a couple of IPTV set top boxes, so I need these streams bent into standard MPEG-TS UDP or RTP multicasts. This seems to be packing them up for an on-demand reflector service. Unfortunately, I think these little boxes are too dumb to know what to do with that.
The ffserver configs I posted will multicast using native RTP format. Clients need to retrieve the SDP info from the http URL in order to read the stream parameters. I'm not sure about muxing in MPEG-TS first, haven't tried that, but vlc was able to play from this ffserver with no trouble.
Reply With Quote
Reply Post New Thread
Tags: , , , , , , , , , , , , , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 09:00 PM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons