[FFmpeg-user] FFmpeg record RTMP to FLV

shacky shacky83 at gmail.com
Thu Nov 6 13:21:28 CET 2014


Hi.
I'm trying to record some RTMP stream with FFmpeg to a FLV file or
something else.

I'm trying the following command:

ffmpeg -i "rtmp://94.47.147.130:1937/live/livestream" -f flv -t 60 test.flv

But I receive a 6 byte file which seems to contain only one frame.

This is the output of ffmpeg:

ffmpeg -i "rtmp://94.47.147.130:1937/live/livestream" -f flv -t 60 test.flv
ffmpeg version 1.2.4 Copyright (c) 2000-2013 the FFmpeg developers

  built on Jan 14 2014 16:31:42 with Apple LLVM version 5.0
(clang-500.2.79) (based on LLVM 3.3svn)

  configuration: --prefix=/usr/local/Cellar/ffmpeg/1.2.4
--enable-shared --enable-pthreads --enable-gpl --enable-version3
--enable-nonfree --enable-hardcoded-tables --enable-avresample
--enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libx264
--enable-libfaac --enable-libmp3lame --enable-libxvid

  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100

[flv @ 0x7fd26a81d400] negative cts, previous timestamps might be wrong
    Last message repeated 2 times

[flv @ 0x7fd26a81d400] Estimating duration from bitrate, this may be inaccurate

Input #0, flv, from 'rtmp://94.47.147.130:1937/live/livestream':
  Metadata:

    author          :
    copyright       :
    description     :
    keywords        :
    rating          :
    title           :
    presetname      : Custom
    creationdate    : Thu Sep 18 17:08:34 2014
                    :
    videodevice     : Osprey-230 Video Device 1
    avclevel        : 31
    avcprofile      : 66
    videokeyframe_frequency: 5
    audiodevice     : Osprey-230 Audio Device 1L
    audiochannels   : 2
    audioinputvolume: 53
  Duration: N/A, start: -5607.794000, bitrate: 456 kb/s
    Stream #0:0: Video: h264 (Baseline), yuv420p, 320x240 [SAR 1:1 DAR
4:3], 358 kb/s, 25.33 tbr, 1k tbn, 50 tbc
    Stream #0:1: Audio: mp3, 44100 Hz, stereo, s16p, 98 kb/s

Output #0, flv, to 'test.flv':

  Metadata:
    author          :
    copyright       :
    description     :
    keywords        :
    rating          :
    title           :
    presetname      : Custom
    creationdate    : Thu Sep 18 17:08:34 2014
                    :

    videodevice     : Osprey-230 Video Device 1
    avclevel        : 31
    avcprofile      : 66
    videokeyframe_frequency: 5
    audiodevice     : Osprey-230 Audio Device 1L
    audiochannels   : 2
    audioinputvolume: 53
    encoder         : Lavf54.63.104
    Stream #0:0: Video: flv1 ([2][0][0][0] / 0x0002), yuv420p, 320x240
[SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 1k tbn, 25.33 tbc
    Stream #0:1: Audio: mp3 ([2][0][0][0] / 0x0002), 44100 Hz, stereo, s16p

Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> flv)
  Stream #0:1 -> #0:1 (mp3 -> libmp3lame)
Press [q] to stop, [?] for help

DTS 4294972256, next:5607874000 st:0 invalid dropping
PTS 4294972256, next:5607874000 invalid dropping st:0
DTS 4294972296, next:5607914000 st:0 invalid dropping
PTS 4294972296, next:5607914000 invalid dropping st:0
frame=    1 fps=0.0 q=3.8 Lsize=      10kB time=01:33:27.82 bitrate=
0.0kbits/s dup=0 drop=3
video:9kB audio:1kB subtitle:0 global headers:0kB muxing overhead 7.016300%

Could you help me to understand how I can do, please?

Thank you very much.
Bye


More information about the ffmpeg-user mailing list