gpt4 book ai didi

ffmpeg 字幕按语言叠加

转载 作者:行者123 更新时间:2023-12-04 23:15:42 25 4
gpt4 key购买 nike

我的流看起来像这样:

Input #0, mpegts, from 'udp://@...':
Duration: N/A, start: 19316.897278, bitrate: N/A
Program 504
Stream #0:0[0x13b1], 125, 1/90000: Video: mpeg2video (Main), 1 reference frame ([2][0][0][0] / 0x0002), yuv420p(tv, top first, left), 720x576 [SAR 64:45 DAR 16:9], 0/1, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x13b2], 208, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 256 kb/s
Stream #0:2[0x1541](srp), 4, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:3[0x1542](slv), 3, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:4[0x1543](hrv), 4, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:5[0x1544](cze), 3, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:6[0x1545](hun), 4, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:7[0x1546](ron), 3, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:8[0x1547](alb), 4, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:9[0x1548](bul), 5, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:10[0x13b9](eng), 127, 1/90000: Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)

我尝试将英文字幕添加到输出视频中,但字幕/语言的数量随时间变化。我需要按语言选择所需的字幕。我能怎么做?这是我不工作的例子。谢谢你。
ffmpeg -i "udp://@..." -map s:eng -sn -map v:0 -profile:v baseline
-c:v libx264 -b:v 1500k -maxrate 2200k -filter_complex [0:v][0:s]overlay -c:a libfdk_aac -b:a 128k /test.ts

最佳答案

尝试

ffmpeg -i "udp://@..." -map 0:v -map 0:a -map 0:m:language:eng -c copy -f mpegts pipe:1 | ffmpeg -f mpegts -i pipe:0 -filter_complex [0:v][0:s]overlay -profile:v baseline -c:v libx264 -b:v 1500k -maxrate 2200k -c:a libfdk_aac -b:a 128k /test.ts

关于ffmpeg 字幕按语言叠加,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42248988/

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