FFmpeg错误:无法为输出文件#0编写头部(编解码器参数不正确?):找不到混合器。

4
我正在尝试为HLS播放分段MP4视频文件,但出现以下错误:
“无法为输出文件#0编写标头(编解码器参数不正确?):未找到复用器”
有人知道我做错了什么吗?
输入命令:
sudo ffmpeg -y -i adwd.mp4 -vcodec copy -acodec copy -force_key_frames 30 -map 0  -f segment segment_list adwd.m3u8 -segment_time 10 -segment_format mpeg_ts -segment_list_type m3u8 segment%d.ts


    ffmpeg version 2.8.5 Copyright (c) 2000-2016 the FFmpeg developers
      built with Apple LLVM version 7.0.2 (clang-700.1.81)
      configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.5 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
      libavutil      54. 31.100 / 54. 31.100
      libavcodec     56. 60.100 / 56. 60.100
      libavformat    56. 40.101 / 56. 40.101
      libavdevice    56.  4.100 / 56.  4.100
      libavfilter     5. 40.101 /  5. 40.101
      libavresample   2.  1.  0 /  2.  1.  0
      libswscale      3.  1.101 /  3.  1.101
      libswresample   1.  2.101 /  1.  2.101
      libpostproc    53.  3.100 / 53.  3.100

视频信息:

General / Container Stream #1
    Total Video Streams for this File.................1
    Total Audio Streams for this File.................1
    Video Codecs Used.................................AVC
    Audio Codecs Used.................................AAC LC
    File Format.......................................MPEG-4
    Play Time.........................................9h 1mn
    Total File Size...................................588 MiB
    Total Stream BitRate..............................152 Kbps
    Encoded with......................................Lavf56.40.101
Video Stream #1
    Codec (Human Name)................................AVC
    Codec (FourCC)....................................avc1
    Codec Profile.....................................High@L2.1
    Frame Width.......................................426 pixels
    Frame Height......................................240 pixels
    Frame Rate........................................29.970 fps
    Total Frames......................................973039
    Display Aspect Ratio..............................16:9
    Scan Type.........................................Progressive
    Color Space.......................................YUV
    Codec Settings (Summary)..........................CABAC / 4 Ref Frames
    QF (like Gordian Knot)............................0.005
    Codec Settings (CABAC)............................Yes
    Codec Settings (Reference Frames).................4
    Video Stream Length...............................9h 1mn 7s 68ms
    Video Stream BitRate..............................15.2 Kbps
    Video Stream BitRate Mode.........................VBR
    Bit Depth.........................................8 bits
    Video Stream Size.................................58.9 MiB (10%)
    Video Encoder.....................................x264 - core 148 r2601 a0cd7d3
    Video Encoder (Settings)..........................cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Audio Stream #1
    Codec.............................................AAC
    Codec (FourCC)....................................40
    Audio Stream Length...............................9h 1mn 7s 104ms
    Audio Stream BitRate..............................128 Kbps
    Audio Stream BitRate Mode.........................CBR
    Number of Audio Channels..........................2
    Audio Channel's Positions.........................Front: L R
    Sampling Rate.....................................44.1 KHz
    Audio Stream Size.................................495 MiB (84%)

感谢 DoughnutZombie 的编辑!我很匆忙,只是简单地剪切和粘贴了信息。 - Benjamin Russell
1
将完整的控制台报告粘贴到您的 Q 中。同时,使用“-vcodec copy”参数,强制关键帧将不起作用。 - Gyan
2个回答

1
错误信息似乎表明找不到片段复用器。您可以使用以下命令检查是否已启用它:
ffmpeg -formats | grep segment

它应该输出类似于这样的内容:

E segment         segment
E stream_segment,ssegment streaming segment muxer

这是我得到的内容 Simon,看起来大约正确吗? libavutil 54.31.100 / 54.31.100 libavcodec 56.60.100 / 56.60.100 libavformat 56.40.101 / 56.40.101 libavdevice 56.4.100 / 56.4.100 libavfilter 5.40.101 / 5.40.101 libavresample 2.1.0 / 2.1.0 libswscale 3.1.101 / 3.1.101 libswresample 1.2.101 / 1.2.101 libpostproc 53.3.100 / 53.3.100 E segment 段落 E stream_segment,ssegment 流片段复用器 - Benjamin Russell

1
我通过删除强制关键帧(我的原始编码中剩余的命令)并设置-flags -global_header参数来解决了这个编码问题。
这是我使用的最终命令:
sudo ffmpeg -i adwd.mp4 -bsf:v h264_mp4toannexb -c copy -map 0 -flags -global_header  -f segment -segment_time 10 -segment_list adwd.m3u8 -segment_format mpegts adwd%d.ts 

7
你确定这里需要使用 sudo 吗? - llogan

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接