[FFmpeg-user] output to multiple targets

Anthony Griffiths neuronetv at gmail.com
Sat Apr 25 15:51:53 CEST 2015


I'm running ffmpeg xxxx on fedora 20 64 bit.
I've been using the following command with success to encode a (live
camera) dv input to rtmp stream :

# dvgrab -format dv1 - | ffmpeg -deinterlace -f dv -i - -f flv -vcodec
flv -s 320x240 -r 10 -b:v 1000k -vcodec libx264 -preset veryfast -crf
25 -maxrate 3000k -bufsize 6000k -g 20 -c:a libfdk_aac -ac 1 -ab 32k
-ar 22050 'rtmp://xxx.xxx.xxx.xxx:1935/live/livestream1'

however I'd like to make an mp4 recording of the stream as well, so
following the instructions at
https://trac.ffmpeg.org/wiki/Creating%20multiple%20outputs I've tried
the following command

# dvgrab -format dv1 - | ffmpeg -deinterlace -f dv -i - -f flv -vcodec
flv -s 320x240 -r 10 -b:v 1000k -vcodec libx264 -preset veryfast -crf
25 -maxrate 3000k -bufsize 6000k -g 20 -c:a libfdk_aac -ac 1 -ab 32k
-ar 22050 -f tee -map 0:v -map 0:a
'recording.mp4|rtmp://xxx.xxx.xxx.xxx:1935/live/livestream1'

but it doesn't work, I get:
'Could not write header for output file #0 (incorrect codec parameters
?): Invalid argument'

this is the console output from the above command:

----------------------
$ dvgrab -format dv1 - | ffmpeg -deinterlace -f dv -i - -f flv -vcodec
flv -s 320x240 -r 10 -b:v 1000k -vcodec libx264 -preset veryfast -crf
25 -maxrate 3000k -bufsize 6000k -g 20 -c:a libfdk_aac -ac 1 -ab 32k
-ar 22050 -f tee -map 0:v -map 0:a
'recording.mp4|rtmp://xxx.xxx.xxx.xxx:1935/live/livestream1'
ffmpeg version 2.5.3 Copyright (c) 2000-2015 the FFmpeg developers
  built on Jan 22 2015 21:08:41 with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-7)
  configuration: --prefix=/home/user/ffmpeg_build
--extra-cflags=-I/home/user/ffmpeg_build/include
--extra-ldflags=-L/home/user/ffmpeg_build/lib --bindir=/home/user/bin
--extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac
--enable-libx264 --enable-libfreetype --enable-libfontconfig
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 13.100 / 56. 13.100
  libavformat    56. 15.102 / 56. 15.102
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Found AV/C device with GUID 0x002011011501d694
Waiting for DV...
Capture Started
Input #0, dv, from 'pipe:':
  Duration: N/A, start: 0.000000, bitrate: 28800 kb/s
    Stream #0:0: Video: dvvideo, yuv420p, 720x576 [SAR 16:15 DAR 4:3],
28800 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[libx264 @ 0x3638960] using SAR=1/1
[libx264 @ 0x3638960] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0x3638960] profile High, level 3.0
[flv @ 0x3c1dae0] Codec for stream 0 does not use global headers but
container format requires global headers
[flv @ 0x3c1dae0] Codec for stream 1 does not use global headers but
container format requires global headers
[NULL @ 0x3c27440] Unable to find a suitable output format for
'rtmp://xxx.xxx.xxx.xxx:1935/live/livestream1'
Output #0, tee, to 'recording.mp4|rtmp://xxx.xxx.xxx.xxx:1935/live/livestream1':
  Metadata:
    encoder         : Lavf56.15.102
    Stream #0:0: Video: h264 (libx264), yuv420p, 320x240 [SAR 1:1 DAR
4:3], q=-1--1, 1000 kb/s, 10 fps, 10 tbn, 10 tbc
    Metadata:
      encoder         : Lavc56.13.100 libx264
    Stream #0:1: Audio: aac (libfdk_aac), 22050 Hz, mono, s16, 32 kb/s
    Metadata:
      encoder         : Lavc56.13.100 libfdk_aac
Stream mapping:
  Stream #0:0 -> #0:0 (dvvideo (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (libfdk_aac))
Could not write header for output file #0 (incorrect codec parameters
?): Invalid argument

--------------------------

can anyone see what the problem is here? I've tried different file
extensions on the file name but no joy. Thanks for any pointers.


More information about the ffmpeg-user mailing list