Quantcast

Is it possible to use ffmpeg as a rtmp downloader like rtmpdump?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Is it possible to use ffmpeg as a rtmp downloader like rtmpdump?

rslovers
A simple 'ffmpeg -i rtmp://url -c copy -f flv -' is not expected, since ffmpeg
cares too much about the actual content of the stream and will complain about
bad flv tags and ignore tags it doesn't understand.

Is it possible to make ffmpeg just download from rtmp and save it as a flv file
and do not inspect what it contains?
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is it possible to use ffmpeg as a rtmp downloader like rtmpdump?

DopeLabs
Your command should work just fine. Is the file not playable when the stream completes or after you stop ffmpeg?


$ ffmpeg -i rtmp://stream.dsfm.tv/live/dubstepfm_720p -c copy -f flv output.flv
ffmpeg version N-86169-g55b56a8 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: --enable-shared --disable-static --enable-version3 --enable-openal --enable-libxvid --enable-libx264 --enable-libwavpack --enable-libvpx --enable-libvorbis --enable-libtheora --enable-libssh --enable-librtmp --enable-libopenjpeg --enable-libmp3lame --enable-libfdk-aac --enable-libass --enable-avresample --enable-nonfree --enable-gpl --enable-libfreetype --enable-openssl --enable-fontconfig --enable-libzmq --enable-libfribidi --enable-libsoxr --enable-libcaca --enable-chromaprint --enable-avisynth --disable-txtpages --disable-podpages --disable-htmlpages --enable-libx265
  libavutil      55. 63.100 / 55. 63.100
  libavcodec     57. 96.101 / 57. 96.101
  libavformat    57. 72.101 / 57. 72.101
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 90.100 /  6. 90.100
  libavresample   3.  6.  0 /  3.  6.  0
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Metadata:
  duration              0.00
  width                 1280.00
  height                720.00
  videodatarate         19531.25
  framerate             60.00
  videocodecid          7.00
  audiodatarate         250.00
  audiosamplerate       44100.00
  audiosamplesize       16.00
  stereo                TRUE
  audiocodecid          10.00
  major_brand           dash
  minor_version         0
  compatible_brands     iso6avc1mp41
  encoder               Lavf57.28.100
  filesize              0.00
Input #0, flv, from 'rtmp://stream.dsfm.tv/live/dubstepfm_720p':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
    encoder         : Lavf57.28.100
  Duration: 00:00:00.00, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 20000 kb/s, 60 fps, 60 tbr, 1k tbn, 120 tbc
    Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp, 256 kb/s
Output #0, flv, to 'output.flv':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
    encoder         : Lavf57.72.101
    Stream #0:0: Video: h264 (High) ([7][0][0][0] / 0x0007), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 20000 kb/s, 60 fps, 60 tbr, 1k tbn, 1k tbc
    Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, stereo, fltp, 256 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=  328 fps= 61 q=-1.0 Lsize=   16525kB time=00:00:05.80 bitrate=23331.7kbits/s speed=1.08x
video:16332kB audio:181kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.066842%



$ ffprobe output.flv
ffprobe version N-86169-g55b56a8 Copyright (c) 2007-2017 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: --enable-shared --disable-static --enable-version3 --enable-openal --enable-libxvid --enable-libx264 --enable-libwavpack --enable-libvpx --enable-libvorbis --enable-libtheora --enable-libssh --enable-librtmp --enable-libopenjpeg --enable-libmp3lame --enable-libfdk-aac --enable-libass --enable-avresample --enable-nonfree --enable-gpl --enable-libfreetype --enable-openssl --enable-fontconfig --enable-libzmq --enable-libfribidi --enable-libsoxr --enable-libcaca --enable-chromaprint --enable-avisynth --disable-txtpages --disable-podpages --disable-htmlpages --enable-libx265
  libavutil      55. 63.100 / 55. 63.100
  libavcodec     57. 96.101 / 57. 96.101
  libavformat    57. 72.101 / 57. 72.101
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 90.100 /  6. 90.100
  libavresample   3.  6.  0 /  3.  6.  0
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, flv, from 'output.flv':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
    encoder         : Lavf57.72.101
  Duration: 00:00:05.85, start: 0.000000, bitrate: 23140 kb/s
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 20000 kb/s, 60 fps, 60 tbr, 1k tbn, 120 tbc
    Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp, 256 kb/s






> On May 19, 2017, at 3:20 36AM, Xu Pu Ti <[hidden email]> wrote:
>
> A simple 'ffmpeg -i rtmp://url -c copy -f flv -' is not expected, since ffmpeg
> cares too much about the actual content of the stream and will complain about
> bad flv tags and ignore tags it doesn't understand.
>
> Is it possible to make ffmpeg just download from rtmp and save it as a flv file
> and do not inspect what it contains?
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is it possible to use ffmpeg as a rtmp downloader like rtmpdump?

Moritz Barsnick
In reply to this post by rslovers
On Fri, May 19, 2017 at 13:20:36 +0300, Xu Pu Ti wrote:
> A simple 'ffmpeg -i rtmp://url -c copy -f flv -' is not expected, since ffmpeg
> cares too much about the actual content of the stream and will complain about
> bad flv tags and ignore tags it doesn't understand.

Does it? I don't understand your issue, but it is correct, ffmpeg will
always at least demux the incoming container, and cannot retain its
original format. That's what other tools are better at ("mplayer
-dumpstream" also comes to mind, assuming it supports RTMP).

> Is it possible to make ffmpeg just download from rtmp and save it as
> a flv file and do not inspect what it contains?

If you're not going to use ffmpeg for anything special, why not use
rtmpdump?

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is it possible to use ffmpeg as a rtmp downloader like rtmpdump?

Carl Eugen Hoyos-2
In reply to this post by rslovers
2017-05-19 12:20 GMT+02:00 Xu Pu Ti <[hidden email]>:
> A simple 'ffmpeg -i rtmp://url -c copy -f flv -' is not expected, since ffmpeg
> cares too much about the actual content of the stream and will complain about
> bad flv tags and ignore tags it doesn't understand.
>
> Is it possible to make ffmpeg just download from rtmp and save it as a flv file
> and do not inspect what it contains?

This should be possible with the data format but the issue is currently
broken, see ticket #5950.

You can test mplayer -dumpstream ffmpeg://rtmp://... but Moritz' answer
may make more sense.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Loading...