gpt4 book ai didi

linux - Ffmpeg 4 音频和 1 视频输入到 4 视频输出性能问题

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

我创建了 4 个空接收器脉冲监视器,它工作正常。
当我将 4 个输出发布到具有噪音和停止的 rtmp 音频时。当与 2 个输出一起工作时,它工作正常。
如果我将分辨率从 1920x1080 降低到 1280*720,它也可以正常工作。
使用 4 个不同的音频输入和 1 个视频输入


SCREEN_WIDTH=1920
SCREEN_HEIGHT=1080
SCREEN_RESOLUTION=${SCREEN_WIDTH}x${SCREEN_HEIGHT}
COLOR_DEPTH=24
X_SERVER_NUM=2
VIDEO_BITRATE=3000
VIDEO_FRAMERATE=30
VIDEO_GOP=$((VIDEO_FRAMERATE))
AUDIO_BITRATE=160k
AUDIO_SAMPLERATE=44100
AUDIO_CHANNELS=1
#some codes here

ffmpeg -y\
-hide_banner -loglevel error \
-nostdin \
-s ${SCREEN_RESOLUTION} \
-r ${VIDEO_FRAMERATE} \
-draw_mouse 0 \
-f x11grab \
-i ${DISPLAY} \
-f pulse -i MySink1.monitor \
-f pulse -i MySink2.monitor \
-f pulse -i MySink3.monitor \
-f pulse -i MySink4.monitor \
-c:v libx264 \
-pix_fmt yuv420p \
-profile:v main \
-preset veryfast \
-minrate ${VIDEO_BITRATE} \
-maxrate ${VIDEO_BITRATE} \
-g ${VIDEO_GOP} \
-map 0 -f flv -map 1 ${RTMP_URL1} \
-c:v libx264 \
-pix_fmt yuv420p \
-profile:v main \
-preset veryfast \
-minrate ${VIDEO_BITRATE} \
-maxrate ${VIDEO_BITRATE} \
-g ${VIDEO_GOP} \
-map 0 -f flv -map 2 ${RTMP_URL2} \
-c:v libx264 \
-pix_fmt yuv420p \
-profile:v main \
-preset veryfast \
-minrate ${VIDEO_BITRATE} \
-maxrate ${VIDEO_BITRATE} \
-g ${VIDEO_GOP} \
-map 0 -f flv -map 3 ${RTMP_URL3} \
-c:v libx264 \
-pix_fmt yuv420p \
-profile:v main \
-preset veryfast \
-minrate ${VIDEO_BITRATE} \
-maxrate ${VIDEO_BITRATE} \
-g ${VIDEO_GOP} \
-map 0 -f flv -map 4 ${RTMP_URL4} \````

I guess I need some performance issue. How can I add **tee** or use one decoded video in all outputs.

最佳答案

使用 tee muxer .简化示例:

ffmpeg \
-f x11grab -framerate 30 -video_size 1920x1080 -i :0.0 \
-f pulse -i MySink1.monitor \
-f pulse -i MySink2.monitor \
-f pulse -i MySink3.monitor \
-f pulse -i MySink4.monitor \
-map 0 -map 1 -map 2 -map 3 -map 4 \
-c:v libx264 -vf format=yuv420p -maxrate 3000k -bufsize 6000k -g 60 -c:a aac -flags +global_header \
-f tee "[select=\'v,a:0\':f=flv:onfail=ignore]${RTMP_URL1}|[select=\'v,a:1\':f=flv:onfail=ignore]${RTMP_URL2}|[select=\'v,a:2\':f=flv:onfail=ignore]${RTMP_URL3}|[select=\'v,a:3\':f=flv:onfail=ignore]${RTMP_URL4}"

关于linux - Ffmpeg 4 音频和 1 视频输入到 4 视频输出性能问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66324258/

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