FFmpeg:无法为“mpegts”找到合适的输出格式

时间:2021-04-27 12:47:24

标签: ffmpeg

我在几个视频流上使用以下命令将它们通过管道传输到我的 TVHeadend 服务器。

pipe:///usr/bin/ffmpeg -i *URL* -c copy -metadata service_provider="My Provider" -metadata service_name="My Service"-f mpegts pipe:1

此命令适用于大多数流,但有一些会抛出此错误...

ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.3.0 (Alpine 9.3.0)
configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-libdav1d --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --enable-libssh --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --enable-libaom --disable-debug
libavutil      56. 51.100 / 56. 51.100
libavcodec     58. 91.100 / 58. 91.100
libavformat    58. 45.100 / 58. 45.100
libavdevice    58. 10.100 / 58. 10.100
libavfilter     7. 85.100 /  7. 85.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  7.100 /  5.  7.100
libswresample   3.  7.100 /  3.  7.100
libpostproc    55.  7.100 / 55.  7.100
[hls @ 0x7f7c03b0c5c0] Skip ('#EXT-X-VERSION:3')
[hls @ 0x7f7c03b0c5c0] Opening '****' for reading
[hls @ 0x7f7c03b0c5c0] Opening '****' for reading
Input #0, hls, from '****:
Duration: N/A, start: 3116.333433, bitrate: N/A
Program 0 
Metadata:
variant_bitrate : 0
Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Metadata:
variant_bitrate : 0
Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp
Metadata:
variant_bitrate : 0
[NULL @ 0x55f1a0fcec80] Unable to find a suitable output format for 'mpegts'
mpegts: Invalid argument

问题流确实有效。 我在问这个问题之前搜索过,我发现的一切都与转换有关。 谁能看到我做错了什么? 使用 FFmpeg 和管道背后的原因是为了消除流冻结问题。 FFmpeg 比简单地将 URL 直接添加到我的 TVHeadend 服务器中更好地处理故障等。

1 个答案:

答案 0 :(得分:1)

更改自

-metadata service_name="My Service"-f mpegts pipe:1

-metadata service_name="My Service" -f mpegts pipe:1
相关问题