[FFmpeg-user] ffmpeg to stream an already h.264 encoded stream

Verachten Bruno gounthar at gmail.com
Tue Sep 10 18:25:43 EEST 2019

First of all, I don't know if I should continue within this thread or
create a new one. It's all about the same subject, streaming and
recording locally RTMP streams. Please let me know.

So, for the time being, I am able to stream the h.264 encoded stream
with the audio changed thanks to:
ffmpeg -i "$SOURCE" -thread_queue_size 2048 -f pulse -i
"alsa_input.usb-Focusrite_Scarlett_2i4_USB-00.analog-stereo" -c:v copy
 -map 0:v:0 -map 1:a:0 -f flv "$YOUTUBE_URL/$KEY"
That's fine, I'm really happy with that.
Now, I have to save the video on the disk too.
So I had a look at the tee format, and issued that command:
ffmpeg -i rtmp:// -thread_queue_size
2048 -f pulse -i
alsa_input.usb-Focusrite_Scarlett_2i4_USB-00.analog-stereo -c:v copy
-map 0:v:0 -map 1:a:0 -f tee "[f=flv:onfail=ignore]$YOUTUBE_URL/$KEY"
ffmpeg version 4.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
  configuration: --enable-gpl --enable-version3 --disable-static
--enable-shared --enable-small --enable-avisynth --enable-chromaprint
--enable-frei0r --enable-gmp --enable-gnutls --enable-ladspa
--enable-libaom --enable-libass --enable-libcaca --enable-libcdio
--enable-libcodec2 --enable-libfontconfig --enable-libfreetype
--enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack
--enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopencore-amrwb
--enable-libopenjpeg --enable-libopenmpt --enable-libopus
--enable-libpulse --enable-librsvg --enable-librubberband
--enable-librtmp --enable-libshine --enable-libsnappy --enable-libsoxr
--enable-libspeex --enable-libssh --enable-libtesseract
--enable-libtheora --enable-libtwolame --enable-libv4l2
--enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxvid --enable-libxml2 --enable-libzmq --enable-libzvbi
--enable-lv2 --enable-libmysofa --enable-openal --enable-opencl
--enable-opengl --enable-libdrm --enable-nonfree --enable-libfdk-aac
--enable-libbluray --extra-libs='-lnettle -lhogweed -lgmp'
  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
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, flv, from 'rtmp://':
  Duration: N/A, start: 12094.717000, bitrate: N/A
    Stream #0:0: Video: h264, yuv420p(progressive), 1920x1080, 29.97
fps, 29.97 tbr, 1k tbn
    Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, pulse, from
  Duration: N/A, start: 1568128912.858773, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Automatic encoder selection failed for output stream #0:1. Default
encoder for format tee (codec none) is probably disabled. Please
choose an encoder manually.
Error selecting an encoder for stream 0:1

I had other outputs for the tee, but as it was not working, I removed
them. There must be something important that I missed in that tee
Please let me know.

Best wishes,

Bruno Verachten

On Tue, Sep 10, 2019 at 11:23 AM Verachten Bruno <gounthar at gmail.com> wrote:
> Thanks a lot, I am now able to stream two videos at the same time with
> the computer doing almost nothing.
> Now, I have to replace the audio of the streams with what is coming
> from the FocusRite Scarlett 2i4 2nd generation, and lots of other
> things.
> Best regards,
> Bruno Verachten

Bruno Verachten

More information about the ffmpeg-user mailing list