fluent-ffmpeg-multistream icon indicating copy to clipboard operation
fluent-ffmpeg-multistream copied to clipboard

file #1 does not contain any stream

Open mhmmdd opened this issue 5 years ago • 0 comments
trafficstars

Hi, a really good project, thank you very much for developing this. Video broadcasting works very well, but audio doesn't work properly.

'use strict';

const ffmpeg = require('fluent-ffmpeg')
const wrtc = require('wrtc')
const w2f = require('wrtc-to-ffmpeg')(wrtc)
const videoOutput = w2f.output({kind: 'video', width: 640, height: 480});
const audioOutput = w2f.output({kind: 'audio', sampleRate: 48000})

Promise.all([videoOutput, audioOutput]).then(function (values) {

    values[0].options.push('-framerate 30');

    ffmpeg()
        .input('/dev/video0')
        // video
        .output(values[0].url)
        .outputOptions(values[0].options)
        // audio
        // throw this error "file #1 does not contain any stream"
        .output(values[1].url)
        .outputOptions(values[1].options)
        .on('error', function(err) {
            console.log(err);
        })
        .run();
});

Output:

Error: ffmpeg exited with code 1: Output #1, s16le, to 'unix:./2.sock':
Output file #1 does not contain any stream

    at ChildProcess.<anonymous> (/home/example/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:198:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)

How can I fix this problem?

My environment: Operating System: Ubuntu 18.04.4 LTS $ ffmpeg -y -f vfwcap -i list

ffmpeg version 4.2.2-0york0~18.04 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
  configuration: --prefix=/usr --extra-version='0york0~18.04' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Unknown input format: 'vfwcap'

mhmmdd avatar Apr 14 '20 19:04 mhmmdd