私はffmpegを使って16のライブwowzaストリームからモザイクを作成しようとしています。 ffmpegでnvencサポートを有効にし、ライブストリーミングモザイクを作成しました。ただし、映像再生中に途切れ現象が一部発生します。動画が同期して再生されません。これは私のスクリプトです。
#!/bin/bash
/home/sysadmin/Downloads/ffmpeg-3.2.4/ffmpeg
-i rtsp://10.10.0.46:1935/live/stream1.stream
-i rtsp://10.10.0.46:1935/live/stream2.stream
-i rtsp://10.10.0.46:1935/live/stream3.stream
-i rtsp://10.10.0.46:1935/live/stream4.stream
-i rtsp://10.10.0.46:1935/live/stream5.stream
-i rtsp://10.10.0.46:1935/live/stream6.stream
-i rtsp://10.10.0.46:1935/live/stream7.stream
-i rtsp://10.10.0.46:1935/live/stream8.stream
-i rtsp://10.10.0.46:1935/live/stream9.stream
-i rtsp://10.10.0.46:1935/live/stream10.stream
-i rtsp://10.10.0.46:1935/live/stream11.stream
-i rtsp://10.10.0.46:1935/live/stream12.stream
-i rtsp://10.10.0.46:1935/live/stream13.stream
-i rtsp://10.10.0.46:1935/live/stream14.stream
-i rtsp://10.10.0.46:1935/live/stream15.stream
-i rtsp://10.10.0.46:1935/live/stream16.stream
-filter_complex "nullsrc=size=1280x720 [base];[0:v] setpts=PTS-STARTPTS, scale=320x180 [vid1]; [1:v] setpts=PTS-STARTPTS, scale=320x180 [vid2];[2:v] setpts=PTS-STARTPTS, scale=320x180 [vid3]; [3:v] setpts=PTS-STARTPTS, scale=320x180 [vid4]; [4:v] setpts=PTS-STARTPTS, scale=320x180 [vid5]; [5:v] setpts=PTS-STARTPTS, scale=320x180 [vid6]; [6:v] setpts=PTS-STARTPTS, scale=320x180 [vid7];[7:v] setpts=PTS-STARTPTS, scale=320x180 [vid8]; [8:v] setpts=PTS-STARTPTS, scale=320x180 [vid9]; [9:v] setpts=PTS-STARTPTS, scale=320x180 [vid10]; [10:v] setpts=PTS-STARTPTS, scale=320x180 [vid11]; [11:v] setpts=PTS-STARTPTS, scale=320x180 [vid12]; [12:v] setpts=PTS-STARTPTS, scale=320x180 [vid13]; [13:v] setpts=PTS-STARTPTS, scale=320x180 [vid14]; [14:v] setpts=PTS-STARTPTS, scale=320x180 [vid15]; [15:v] setpts=PTS-STARTPTS, scale=320x180 [vid16]; [base][vid1] overlay=shortest=1 [tmp1]; [tmp1][vid2] overlay=shortest=1:x=320 [tmp2]; [tmp2][vid3] overlay=shortest=1:x=640 [tmp3]; [tmp3][vid4] overlay=shortest=1:x=960 [tmp4]; [tmp4][vid5] overlay=shortest=1:y=180 [tmp5]; [tmp5][vid6] overlay=shortest=1:x=320:y=180 [tmp6]; [tmp6][vid7] overlay=shortest=1:x=640:y=180 [tmp7]; [tmp7][vid8] overlay=shortest=1:x=960:y=180 [tmp8]; [tmp8][vid9] overlay=shortest=1:y=360 [tmp9]; [tmp9][vid10] overlay=shortest=1:x=320:y=360 [tmp10]; [tmp10][vid11] overlay=shortest=1:x=640:y=360 [tmp11]; [tmp11][vid12] overlay=shortest=1:x=960:y=360 [tmp12]; [tmp12][vid13] overlay=shortest=1:y=540 [tmp13]; [tmp13][vid14] overlay=shortest=1:x=320:y=540 [tmp14]; [tmp14][vid15] overlay=shortest=1:x=640:y=540 [tmp15]; [tmp15][vid16] overlay=shortest=1:x=960:y=540" -strict experimental -c:v h264_nvenc -f mpegts udp://225.50.50.111:9001?pkt_size=1316
ベストアンサー1
私はこれを使用しました:
ffmpeg -i 1.ts -i 2.ts -i 3.ts -i 4.ts -i 5.ts -i 6.ts -i 7.ts -i 8.ts -i 9.ts -i 10.aac -filter_complex "[9:a][10:a] amix=inputs=2; nullsrc=size=1280x720 [base]; [0:v]setpts=PTS-STARTPTS, scale=426x240 [vid1]; [1:v]setpts=PTS-STARTPTS, scale=426x240 [vid2];[2:v] setpts=PTS-STARTPTS, scale=426x240 [vid3]; [3:v] setpts=PTS-STARTPTS, scale=426x240 [vid4]; [4:v] setpts=PTS-STARTPTS, scale=426x240 [vid5]; [5:v] setpts=PTS-STARTPTS, scale=426x240 [vid6]; [6:v] setpts=PTS-STARTPTS, scale=426x240 [vid7];[7:v] setpts=PTS-STARTPTS, scale=426x240 [vid8]; [8:v] setpts=PTS-STARTPTS, scale=426x240 [vid9]; [base][vid1] overlay=shortest=0 [tmp1]; [tmp1][vid2] overlay=shortest=0:x=426 [tmp2]; [tmp2][vid3] overlay=shortest=0:x=852 [tmp3]; [tmp3][vid4] overlay=shortest=0:y=240 [tmp4]; [tmp4][vid5] overlay=shortest=0:x=426:y=240 [tmp5]; [tmp5][vid6] overlay=shortest=0:x=852:y=240 [tmp6]; [tmp6][vid7] overlay=shortest=0:y=480 [tmp7]; [tmp7][vid8] overlay=shortest=0:x=426:y=480 [tmp8]; [tmp8][vid9] overlay=shortest=0:x=852:y=480" -strict experimental -c:v h264 -preset:v ultrafast -maxrate 2000k -minrate 2000k -bufsize 1200k -f segment -segment_format mpegts -segment_time 10 -segment_list_size 6 -segment_format_options mpegts_flags=+initial_discontinuity:mpegts_copyts=1 -segment_list_type m3u8 -segment_list_flags +live+delete -segment_list xxxx.m3u8 xxx1.ts