PDA

View Full Version : how to stream rtmp to rtmp


Koze
01-19-2016, 05:12 PM
Hello,

I have for example following stream:
"rtmp://stream.smcloud.net/live2/wawa/wawa_720p" -a "live2/eskatv" -f "WIN 11,9,900,170" -W "http://www.eska.tv/thrdparty/flowplayer/flowplayer.rtmp.swf" -p "http://www.eska.tv/player" --live -y "eskatv_360p"


and would like to re-stream to another rtmp using ffmpeg on Linux Debian. Do I need any other program than ffmpeg to do the task?

Could you kindly check my below command if is correct one?
ffmpeg -re -i "rtmp://stream.smcloud.net/live2/wawa/wawa_720p" -a "live2/eskatv" -f "WIN 11,9,900,170" -W "http://www.eska.tv/thrdparty/flowplayer/flowplayer.rtmp.swf" -p "http://www.eska.tv/player" --live -y "eskatv_360p" -codec copy -f flv rtmp://xxxxxxx

If not what would be the way to re-stream above source?

Thank you in advance for any suggestion.

k

biezom
01-19-2016, 05:52 PM
hi

you can use livestreamer

livestreamer --player-external-http --player-external-http-port "4546" "rtmp://stream.smcloud.net/live2/wawa/wawa_720p app=live2/eskatv pageUrl=http://www.eska.tv/player live=1 playpath=eskatv_360p" best

in local
http://127.0.0.1:4546/

extern
http://SERVER-IP:4546/
maybe need allow port 4546 on the server's firewall

Koze
01-19-2016, 06:04 PM
Thank you bezom,

So if I will use livestreamer with above port in local then can I re-stream within ffmpeg with following command:

ffmpeg -re -i "http://localhost:4546/" -acodec aac -strict -2 -vcodec copy -b:a 128K -preset ultrafast -bufsize 3968k -f flv rtmp://xxxxxxxxxxxxxxxx

or should I use:
ffmpeg -re -i "http://127.0.0.1:4546/" -acodec aac -strict -2 -vcodec copy -b:a 128K -preset ultrafast -bufsize 3968k -f flv rtmp://xxxxxxxxxxxxxxxx

Is that going to work?

Much appreciate your help,

k

biezom
01-19-2016, 06:07 PM
i don't know but the command with livestreamer re-stream already

Koze
01-19-2016, 06:14 PM
yes I know,

but I would like to re-stream to another server (let's say twitch.tv)

Sorry for not being clear with that.

Thank you,
k

biezom
01-19-2016, 06:17 PM
i'm not sure if i understand

if your sever is the debian linux run the livestreamer's command on this server

Koze
01-21-2016, 12:46 PM
Thanks biezom for your great help.

With your help I was able to re-stream the source using livestreamer and ffmpeg.

I was using following command within ffmpeg:
ffmpeg -re -i "http://127.0.0.1:4824/" -acodec aac -strict -2 -vcodec copy -b:v 2000k -b:a 128K -preset ultrafast -bufsize 3968k -f flv rtmp://xxxxxx

But at the begging of the stream I got following error
[flv @ 0x2619580] Codec for stream 0 does not use global headers but container format requires global headers

and then after successfully streaming over 2 h stream crashed with following information:

frame=197473 fps= 25 q=-1.0 size= 2457396kB t frame=197486 fps= 25 q=-1.0 size= 2457548kB t frame=197499 fps= 25 q=-1.0 size= 2457711kB t [flv @ 0x3626580] Failed to update header wit h correct duration.
[flv @ 0x3626580] Failed to update header wit h correct filesize.
frame=197500 fps= 25 q=-1.0 Lsize= 2457731kB time=02:11:40.03 bitrate=2548.6kbits/s
video:2314517kB audio:133208kB subtitle:0kB o ther streams:0kB global headers:0kB muxing ov erhead: 0.408774%


Any idea how I can fix the issue?
Should I change something within my ffmpeg command?

I also noticed that after about 1 h livestream terminal became inactive but streaming continued with ffmpeg.

Is that normal?

Thank you,

k

Koze
02-05-2016, 01:40 PM
Hello again,

I have tried to re-stream following link using livestreamer and ffmpeg:
http://wtk.live-ext.e96-jw.insyscd.net/lechtv.smil/playlist.m3u8

Live streamer is connecting and fetching the stream but ffmpeg produce a lot of errors.

Could anyone have a look and let me know if I need to change something in my ffmpeg command:
ffmpeg -re -headers 'User-Agent: bar'$'\r\n' -i "http://127.0.0.1:9155/" -acodec aac -bsf:a aac_adtstoasc -strict -2 -vcodec copy -bufsize 3968k -f flv rtmp://stream


Thanks a lot for your help in advance,

koze