gpt4 book ai didi

python-3.x - 在 ffmpeg 命令上映射 3 个或更多输出

转载 作者:行者123 更新时间:2023-12-04 23:19:13 26 4
gpt4 key购买 nike

我正在使用以下命令在多个输出上进行流式传输,直到 2 个输出它都可以正常工作,但是当我添加第三个输出时,它给出了一个错误-
2个输出的命令-

ffmpeg_stream = 'ffmpeg -thread_queue_size 1024 -f x11grab -draw_mouse 0 -s 1920x1080  -i :122 -f alsa -i pulse -ac 2 -c:a aac -b:a 64k -threads 0 -flags +global_header -c:v libx264 -pix_fmt yuv420p -s 1920x1080 -threads 0 -f tee -map 0:0 -map 1:0 "[f=flv]rtmps://live-api-s.facebook.com:443/rtmp/stream_key|[f=flv]rtmp://a.rtmp.youtube.com/live2/stream_key"'
3个输出的命令-
ffmpeg_stream = 'ffmpeg -thread_queue_size 1024 -f x11grab -draw_mouse 0 -s 1920x1080  -i :122 -f alsa -i pulse -ac 2 -c:a aac -b:a 64k -threads 0 -flags +global_header -c:v libx264 -pix_fmt yuv420p -s 1920x1080 -threads 0 -f tee -map 0:0 -map 1:0 -map 2:0 "[f=flv]rtmps://live-api-s.facebook.com:443/rtmp/stream_key|[f=flv]rtmp://a.rtmp.youtube.com/live2/stream_key|[f=flv]rtmp://play.stream.some_domain/stream/i48b-rdq0-jwme-2yj0"'
错误-
liveStreaming   | Invalid input file index: 2.
仅自定义 rtmp url 错误-
liveStreaming   | [rtmp @ 0x55af7e7f8280] Server error: Already 

publishing
liveStreaming | [tee @ 0x55af7e12f540] Slave '[f=flv]rtmp://stream.domain/stream/i48b-rdq0-jwme-2yj0': error opening: Operation not permitted
liveStreaming | [tee @ 0x55af7e12f540] Slave muxer #1 failed, aborting.
liveStreaming | [flv @ 0x55af7e4d1880] Failed to update header with correct duration.
liveStreaming | [flv @ 0x55af7e4d1880] Failed to update header with correct filesize.
liveStreaming | Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted
liveStreaming | Error initializing output stream 0:1 --
liveStreaming | [aac @ 0x55af7e1346c0] Qavg: -nan
liveStreaming | [alsa @ 0x55af7e111dc0] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
liveStreaming | Conversion failed!
谢谢

最佳答案

-map用于添加输入流以进行输出。您只有 2 个输入。对于第三个输出,使用 tee ,你只需要像你已经做的那样将它添加到输出 URL 中。删除 -map 2:0ffmpeg_stream = 'ffmpeg -thread_queue_size 1024 -f x11grab -draw_mouse 0 -s 1920x1080 -i :122 -f alsa -i pulse -ac 2 -c:a aac -b:a 64k -threads 0 -flags +global_header -c:v libx264 -pix_fmt yuv420p -s 1920x1080 -threads 0 -f tee -map 0:0 -map 1:0 "[f=flv]rtmps://live-api-s.facebook.com:443/rtmp/stream_key|[f=flv]rtmp://a.rtmp.youtube.com/live2/stream_key|[f=flv]rtmp://play.stream.some_domain/stream/i48b-rdq0-jwme-2yj0"'

关于python-3.x - 在 ffmpeg 命令上映射 3 个或更多输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70227703/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com