Thanks a lot Moritz, that did the trick.
So I now have:
ffmpeg -i "$SOURCE" -thread_queue_size 2048 -f pulse -i "$AUDIO_SOURCE"
-c:v copy -map 0:v:0 -map 1:a:0 -c:a libmp3lame -f tee
which gives
Output #0, tee, to '[f=flv:onfail=ignore]rtmp://|[f=flv:onfail=ignore]local_file.mkv':

The output file is created, and the stream on YouTube is working too. I
don't know if MKV is the best format to use in this case.

I still have to figure out how to create a filename with a timestamp in it.
I had a look at the strftime option, but I don't know how to insert it into
the tee parameters.

I have another problem now, which is that the bitrate and the size have
frame= 4491 fps= 29 q=-1.0 size=N/A time=00:02:34.16 bitrate=N/A
I guess it's because of the tee. Is there any way to put them back on? It
was useful to check the streaming was going ok.

On Tue, Sep 10, 2019 at 10:03 PM Moritz Barsnick <> wrote:

> On Tue, Sep 10, 2019 at 17:25:43 +0200, Verachten Bruno wrote:
> > 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"
> [...]
> > 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
> > format...
> > Please let me know.
> Yes, you missed the actual error message. ;-)
> The tee muxer, unlike the flv muxer, doesn't have useful defaults for
> codecs. You are only specifying the video codec ("-c:v copy"), you also
> need to specify an audio codec. AFAICT, flv defaults to mp3, so if you
> want that, you should add "-c:a libmp3lame" to your command line.
> Hope this helps,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> To unsubscribe, visit link above, or email
> with subject "unsubscribe".

Bruno Verachten
ffmpeg-user mailing list

To unsubscribe, visit link above, or email with subject "unsubscribe".

Reply via email to