【问题标题】:FFMPEG MOV to MP4 error {Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument}FFMPEG MOV 到 MP4 错误 {Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument}
【发布时间】:2016-07-23 02:21:12
【问题描述】:

我正在使用 FFMPEG 来转换和加水印视频

ffmpeg -i "MVI_9692.MOV"   -i 360.png  -acodec copy -threads 12  -filter_complex "scale=-2:360,overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2"  "MVI_9692.MOV_360.mp4"

此命令适用于不同格式的视频,但我收到了其中一个 MOV 视频的错误消息

Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

这些是我在错误消息之前收到的警告

[swscaler @ 0x47adf20] deprecated pixel format used, make sure you did set range correctly

[mp4 @ 0x4729540] Codec for stream 1 does not use global headers but container format requires global headers
[mp4 @ 0x4729540] Could not find tag for codec pcm_s16le in stream #1, codec not currently supported in container

【问题讨论】:

    标签: ffmpeg


    【解决方案1】:

    FFmpeg 不会在 MP4 文件中混合 PCM 音频,因此您必须使用支持的编解码器(如 AAC、MP3、AC3..等)进行转换。

    对于 AAC 编码,使用-c:a aac

    例如

    ffmpeg -i "MVI_9692.MOV" -i 360.png -threads 12 -c:a aac 
           -filter_complex "scale=-2:360,overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2"
           "MVI_9692.MOV_360.mp4"
    

    【讨论】:

    • 感谢它几乎没有变化 ffmpeg -i "MVI_9692.MOV" -i 360.png -threads 12 -c:a libvo_aacenc -filter_complex "scale=-2:360,overlay=(main_w- overlay_w)/2:(main_h-overlay_h)/2" "MVI_9692.MOV_360.mp4"
    • 您使用的是旧版本的 FFmpeg。 libvo 编码器已被移除,因为本机编码器现在更好。升级,就可以使用我原来的命令了。
    • [aac @ 0x1ec04c0] 从比特率估计持续时间,这可能不准确 [aac @ 0x1ec04c0] 找不到流 0 的编解码器参数(音频:aac (LC),7.1,fltp,323 kb/ s):未指定的采样率考虑增加“analyzeduration”和“probesize”选项的值 video.ts:找不到编解码器参数输入#0,aac,来自“video.ts”:持续时间:02:11:07.36,比特率:323 kb/s 流 #0:0:音频:aac (LC)、7.1、fltp、323 kb/s 在过滤器 Parsed_scale_0 上找不到未标记输入垫 0 的匹配流
    • @Lebnik 似乎与这个 Q 和 A 无关。用完整的命令和日志打开一个新 Q。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-02-09
    • 1970-01-01
    • 2016-08-25
    • 2020-01-10
    • 2022-12-02
    • 1970-01-01
    • 2021-03-02
    相关资源
    最近更新 更多