Search code examples
ffmpeghttp-live-streamingmultiplexing

Unable to mux two live streams from webcam using ffmpeg in linux


We are trying to multiplex two live streams from webcams into an output file using ffmpeg in linux as follows,

fmpeg -i "http://10.41.2.57:8090/webcam.asf" -i "http://10.41.2.49:8090/webcam.asf" -map 0:0 -map 1:0 -t 60 "/home/../MuxLiveStream1.flv" 

ffmpeg stops responding at after a while and the console shows the following output,

FFmpeg version SVN-r0.5.9-4:0.5.9-0ubuntu0.10.04.3, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --extra-version=4:0.5.9-0ubuntu0.10.04.3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Jan 24 2013 19:42:59, gcc: 4.4.3

Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 2.00 (2/1)
Input #0, flv, from 'http:10.41.2.154:8090/webcam.flv':
  Duration: 00:00:00.00, start: 1587016.579000, bitrate: 200 kb/s
    Stream #0.0: Video: flv, yuv420p, 320x240, 200 kb/s, 2 tbr, 1k tbn, 1k tbc

Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 2.00 (2/1)
Input #1, flv, from 'http:10.41.2.57:8090/webcam.flv':
  Duration: 00:00:00.00, start: 1587230.806000, bitrate: 200 kb/s
    Stream #1.0: Video: flv, yuv420p, 320x240, 200 kb/s, 2 tbr, 1k tbn, 1k tbc
Number of stream maps must match number of output streams

Is there a mistake in the command or is there anything else that needs to be done?


Solution

  • A recent build shows:

    [flv @ 0x28e4d40] at most one video stream is supported in flv
    

    Try a more flexible output container such as Matroska (.mkv) and use a recent build since 0.5.9 is ancient. You can simply download a Linux build of ffmpeg or you can follow a step-by-step guide to compile ffmpeg.