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

Verachten Bruno gounthar at gmail.com
Thu Sep 12 11:31:03 EEST 2019


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
"[f=flv:onfail=ignore]$YOUTUBE_URL/$KEY|[f=flv:onfail=ignore]local_file.mkv"
which gives
Output #0, tee, to '[f=flv:onfail=ignore]rtmp://
a.rtmp.youtube.com/live2/my-key|[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
disappeared:
frame= 4491 fps= 29 q=-1.0 size=N/A time=00:02:34.16 bitrate=N/A
speed=0.999x
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 <barsnick at gmx.net> wrote:

> On Tue, Sep 10, 2019 at 17:25:43 +0200, Verachten Bruno wrote:
> > ffmpeg -i rtmp://192.168.1.212:1935/live/stream1 -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
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



-- 
Bruno Verachten


More information about the ffmpeg-user mailing list