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 > Streaming media recording forum > rtmpdump
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 03-13-2017, 06:28 AM
sinanksu sinanksu is offline
Junior Member
 
Join Date: Feb 2017
Posts: 18
sinanksu is on a distinguished road
Default

RTMPDump query to ffmpeg query? (nginx rtmp module)


Hi,

I want to reflect a live broadcast from rtmp in the same way as "nginx rtmp module".

I ran that live broadcast with the following rtmpdump query. I installed an Ubuntu server. Then I installed the nginx rtmp module. This module has ffmpeg in the examples.

How do I write the rtmpdump question on fmmeg?

Successful rtmpdump query:

Quote:
rtmpdump -r "rtmpe://xx.xx.xx.xx/xlive" -a "xlive" -f "WIN 23,0,0,162" -s "http://xxxx.com/Player.swf" -w "5aaaa32059cba7xxxxxxxxxxx" -x "585534" -p "http://xxxxxxxxxxxx.com/viewer?game=1" -C S:client -C S:3.1.0.10 -C S:en --live -y "raw:472237" -o "2017blablabla.flv"

Quote:

rtmp {
server {
listen 1935;
chunk_size 4096;

application live {
live on;
record off;
exec ffmpeg -i "rtmpe://xx.xx.xx.xx/xlive" -a "xlive" -f "WIN 23,0,0,162" -s "http://xxxx.com/Player.swf" -w "5aaaa32059cba7xxxxxxxxxxx" -x "585534" -p "http://xxxxxxxxxxxx.com/viewer?game=1" -C S:client -C S:3.1.0.10 -C S:en --live -y "raw:472237";
}
application live360p {
live on;
record off;
}
}
}
Thank you
Reply With Quote
  #2  
Old 03-13-2017, 06:38 AM
j_cool j_cool is offline
Senior Member
 
Join Date: Feb 2016
Posts: 515
j_cool is on a distinguished road
Default

Re: RTMPDump query to ffmpeg query? (nginx rtmp module)


Use librtmp parameters with ffmpeg.

https://rtmpdump.mplayerhq.hu/librtmp.3.html
Reply With Quote
  #3  
Old 03-13-2017, 06:47 AM
sinanksu sinanksu is offline
Junior Member
 
Join Date: Feb 2017
Posts: 18
sinanksu is on a distinguished road
Default

Re: RTMPDump query to ffmpeg query? (nginx rtmp module)


Quote:
Originally Posted by j_cool View Post
Use librtmp parameters with ffmpeg.

https://rtmpdump.mplayerhq.hu/librtmp.3.html


Hi j_cool,

I tried but I could not get it working.
Reply With Quote
  #4  
Old 03-13-2017, 06:50 AM
j_cool j_cool is offline
Senior Member
 
Join Date: Feb 2016
Posts: 515
j_cool is on a distinguished road
Default

Re: RTMPDump query to ffmpeg query? (nginx rtmp module)


C:\>rtmpdump -h
RTMPDump v2.4 GIT-2015-12-14 (Compiled by KSV)
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL

rtmpdump: This program dumps the media content streamed over RTMP.

--help|-h Prints this help screen.
--url|-i url URL with options included (e.g. rtmp://host[ort]/path swfUrl=url tcUrl=url)
--rtmp|-r url URL (e.g. rtmp://host[ort]/path)
--host|-n hostname Overrides the hostname in the rtmp url
--port|-c port Overrides the port in the rtmp url
--socks|-S hostort Use the specified SOCKS proxy
--protocol|-l num Overrides the protocol in the rtmp url (0 - RTMP, 2 - RTMPE)
--playpath|-y path Overrides the playpath parsed from rtmp url
--playlist|-Y Set playlist before playing
--swfUrl|-s url URL to player swf file
--tcUrl|-t url URL to played stream (default: "rtmp://host[ort]/app")
--pageUrl|-p url Web URL of played programme
--app|-a app Name of target app on server
--swfhash|-w hexstring SHA256 hash of the decompressed SWF file (32 bytes)
--swfsize|-x num Size of the decompressed SWF file, required for SWFVerification
--swfVfy|-W url URL to player swf file, compute hash/size automatically
--swfAge|-X days Number of days to use cached SWF hash before refreshing
--auth|-u string Authentication string to be appended to the connect string
--conn|-C type:data Arbitrary AMF data to be appended to the connect string
B:boolean(0|1), S:string, N:number, Object-flag(0|1),
Znull), NB:name:boolean, NS:name:string, NN:name:number
--flashVer|-f string Flash version string (default: "WIN 10,0,32,18")
--live|-v Save a live stream, no --resume (seeking) of live streams possible
--subscribe|-d string Stream name to subscribe to (otherwise defaults to playpath if live is specifed)
--realtime|-R Don't attempt to speed up download via the Pause/Unpause BUFX hack
--flv|-o string FLV output file name, if the file name is - print stream to stdout
--resume|-e Resume a partial RTMP download
--timeout|-m num Timeout connection num seconds (default: 30)
--start|-A num Start at num seconds into stream (not valid when using --live)
--stop|-B num Stop at num seconds into stream
--token|-T key Key for SecureToken response
--ccommand|-K key Send custom command before play
--jtv|-j JSON Authentication token for Justin.tv legacy servers
--weeb|-J string Authentication token for weeb.tv servers
--hashes|-# Display progress with hashes, not with the byte counter
--buffer|-b Buffer time in milliseconds (default: 36000000)
--skip|-k num Skip num keyframes when looking for last keyframe to resume from. Useful if resume fails (default: 0)
--quiet|-q Suppresses all command output.
--verbose|-V Verbose command output.
--debug|-z Debug level command output.
If you don't pass parameters for swfUrl, pageUrl, or auth these properties will not be included in the connect packet.
Reply With Quote
  #5  
Old 03-13-2017, 07:06 AM
confused.com confused.com is offline
Senior Member
 
Join Date: Jan 2017
Posts: 165
confused.com is on a distinguished road
Default

Re: RTMPDump query to ffmpeg query? (nginx rtmp module)


http://stream-recorder.com/forum/ple...ng-t22585.html
Reply With Quote
  #6  
Old 03-13-2017, 09:50 AM
j_cool j_cool is offline
Senior Member
 
Join Date: Feb 2016
Posts: 515
j_cool is on a distinguished road
Default

Re: RTMPDump query to ffmpeg query? (nginx rtmp module)


ffmpeg -i "rtmpe://xx.xx.xx.xx/xlive app=xlive flashVer=WIN%%2023,0,0,162 swfUrl=http://xxxx.com/Player.swf swfhash=5aaaa32059cba7xxxxxxxxxxx swfsize=58553 pageUrl=http://xxxxxxxxxxxx.com/viewer?game=1 conn=S:client conn=S:3.1.0.10 conn=S:en live=1 playpath=raw:472237" -c copy "2017blablabla.flv"
Reply With Quote
  #7  
Old 03-13-2017, 10:08 AM
sinanksu sinanksu is offline
Junior Member
 
Join Date: Feb 2017
Posts: 18
sinanksu is on a distinguished road
Default

Re: RTMPDump query to ffmpeg query? (nginx rtmp module)


Quote:
Originally Posted by j_cool View Post
ffmpeg -i "rtmpe://xx.xx.xx.xx/xlive app=xlive flashVer=WIN%%2023,0,0,162 swfUrl=http://xxxx.com/Player.swf swfhash=5aaaa32059cba7xxxxxxxxxxx swfsize=58553 pageUrl=http://xxxxxxxxxxxx.com/viewer?game=1 conn=S:client conn=S:3.1.0.10 conn=S:en live=1 playpath=raw:472237" -c copy "2017blablabla.flv"
Hi j_cool,

Thank you for your reply.

I tried it like this. But I have not been successful. It works with RTMPDump but it does not work with ffmpeg. Also I could not send you the swf in ffmpeg. This swf size parameter does not exist.


Quote:
C:\f>ffmpeg -i "rtmpe://93.189.57.254/xlive app=xlive flashVer=WIN%%24,0,0,221 swfUrl=http://sportstream365.com/swf/VideoPlayer.swf swfAge=5aaaa32059cba732636c28519b2ce34a3568f1058a8 bd02d6a932643554ccbb4 swfVfy=1 pageUrl=http://sportstream365.com/viewer?game=107954793 conn=S:client conn=S:3.1.0.10 conn=S:en live=1 playpath=raw:478576" -c copy "2017blablabla.flv"
ffmpeg version N-83882-g58f0bbc Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 6.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 48.100 / 55. 48.100
libavcodec 57. 83.100 / 57. 83.100
libavformat 57. 66.104 / 57. 66.104
libavdevice 57. 3.100 / 57. 3.100
libavfilter 6. 76.100 / 6. 76.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
RTMP_ReadPacket, failed to read RTMP packet header
rtmpe://93.189.57.254/xlive app=xlive flashVer=WIN%%24,0,0,221 swfUrl=http://sportstream365.com/swf/VideoPlayer.swf swfAge=5aaaa32059cba732636c28519b2ce34a3568f1058a8 bd02d6a932643554ccbb4 swfVfy=1 pageUrl=http://sportstream365.com/viewer?game=107954793 conn=S:client conn=S:3.1.0.10 conn=S:en live=1 playpath=raw:478576: Unknown error occurred
Reply With Quote
  #8  
Old 03-13-2017, 10:35 AM
j_cool j_cool is offline
Senior Member
 
Join Date: Feb 2016
Posts: 515
j_cool is on a distinguished road
Default

Re: RTMPDump query to ffmpeg query? (nginx rtmp module)


This is not right:

flashVer=WIN%%24,0,0,221

It is about handling empty space within parameter.
From beginning to the end of parameter no empty space is allowed.
It is replaced with %%20 in batch file, with %20 on command line.

You can see real life example in my old post,

http://stream-recorder.com/forum/sho...57&postcount=3

and here it says it right.

http://www.robvanderwoude.com/escapechars.php

Your progress is good, it is troubleshooting little bits from here now on.

One more to "escape":

? with \?

pageUrl=http://sportstream365.com/viewer?game=107954793

pageUrl=http://sportstream365.com/viewer\?game=107954793

Last edited by j_cool : 03-13-2017 at 11:11 AM.
Reply With Quote
  #9  
Old 03-13-2017, 02:20 PM
sinanksu sinanksu is offline
Junior Member
 
Join Date: Feb 2017
Posts: 18
sinanksu is on a distinguished road
Default

Re: RTMPDump query to ffmpeg query? (nginx rtmp module)


Quote:
Originally Posted by j_cool View Post
...
Hi j_cool, thanks for the answer.

But I did not. Unable to verify SWF.

When I used rtmpdump in the past, I could not verify the swf. Then I added the swf size to the query. And rtmpdump worked.

Now, there is no parameter needed to add swf size to ffmpeg.

How will I do.




Quote:

C:\f>ffmpeg -i "rtmpe://93.189.57.254/xlive app=xlive swfUrl=http://streamsport365.com/swf/VideoPlayer.swf swfAge=5aaaa32059cba732636c28519b2ce34a3568f1058a8 bd02d6a932643554ccbb4 swfVfy=0 pageUrl=http://streamsport365.com/viewer\?game=107954793 conn=S:client conn=S:3.1.0.10 conn=S:en live=1 playpath=raw:478879" -c copy "2017blablabla.flv"
ffmpeg version N-83882-g58f0bbc Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 6.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 48.100 / 55. 48.100
libavcodec 57. 83.100 / 57. 83.100
libavformat 57. 66.104 / 57. 66.104
libavdevice 57. 3.100 / 57. 3.100
libavfilter 6. 76.100 / 6. 76.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
HandleCtrl: Ignoring SWFVerification request, use --swfVfy!
rtmp server sent error

Metadata:
width 720.00
height 400.00
Input #0, flv, from 'rtmpe://93.189.57.254/xlive app=xlive swfUrl=http://streamsport365.com/swf/VideoPlayer.swf swfAge=5aaaa32059cba732636c28519b2ce34a3568f1058a8 bd02d6a932643554ccbb4 swfVfy=0 pageUrl=http://streamsport365.com/viewer\?game=107954793 conn=S:client conn=S:3.1.0.10 conn=S:en live=1 playpath=raw:478879':
Duration: N/A, start: 0.021000, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p(progressive), 720x400 [SAR 80:81 DAR 16:9], 25 fps, 47 tbr, 1k tbn, 50 tbc
Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp
File '2017blablabla.flv' already exists. Overwrite ? [y/N] y
Output #0, flv, to '2017blablabla.flv':
Metadata:
encoder : Lavf57.66.104
Stream #0:0: Video: h264 (High) ([7][0][0][0] / 0x0007), yuv420p(progressive), 720x400 [SAR 80:81 DAR 16:9], q=2-31, 25 fps, 47 tbr, 1k tbn, 1k tbc
Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 48000 Hz, stereo, fltp
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
RTMP_ReadPacket, failed to read RTMP packet body. len: 4597902
frame= 120 fps=0.0 q=-1.0 Lsize= 265kB time=00:00:01.98 bitrate=1095.8kbits/s speed=8.57x
video:229kB audio:32kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.654435%

Reply With Quote
  #10  
Old 03-13-2017, 04:53 PM
j_cool j_cool is offline
Senior Member
 
Join Date: Feb 2016
Posts: 515
j_cool is on a distinguished road
Default

Re: RTMPDump query to ffmpeg query? (nginx rtmp module)


Your question is complicated, but the answer can be simple.

If something worked well with rtmpdump, it must work with ffmpeg as well. FFmpeg and Rtmpdump are both based on librtmp.

It is just matter of "translating" rtmpdump command to ffmpeg command.

There is one simple example of that, here.

http://stream-recorder.com/forum/ple...ng-t22585.html

escaping ? with \? appears not to be necessary in this case, so this is error here,
( Required only inside the regex pattern of FINDSTR ).
I noticed it is an error when I saw it showing on command line when you executed the command, on command line
you should see it all "as is", and purpose of escaping in batch file is to see it "as is" on command line.

Appart from that, I cannot see other syntax error in your last ffmpeg command so I suspect parameters themselves.
To solve that I would try to replicate parameters identically from old rtmpdump command that worked.

Last edited by j_cool : 03-14-2017 at 02:27 AM.
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:45 AM.


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