FFMPEG MOV到MP4错误{无法写入输出文件#0(编解码器参数不正确)的标题:参数无效} [英] FFMPEG MOV to MP4 error {Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument}

查看:6714
本文介绍了FFMPEG MOV到MP4错误{无法写入输出文件#0(编解码器参数不正确)的标题:参数无效}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用FFMPEG转换和观看视频

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

此命令使用不同格式的视频正常工作,但是我收到一个MOV视频的错误消息

 无法为输出文件#0写入头(编码参数不正确?):参数无效

这些是在错误消息之前发现的警告

  [swscaler @ 0x47adf20]不建议使用的像素格式,请确保正确设置范围

[mp4 @ 0x4729540]流1的编解码器不使用全局头文件,但容器格式需要全局头文件
[mp4 @ 0x4729540 ]在流#1中无法找到编解码器pcm_s16le的标签,容器
当前不支持编解码器


解决方案

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



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



eg

  ffmpeg -iMVI_9692.MOV-i 360.png -threads 12 -c:a aac 
- filter_complexscale = -2:360,overlay =(main_w-overlay_w)/ 2:(main_h-overlay_h)/ 2
MVI_9692.MOV_360.mp4
/ pre>

I'm using FFMPEG to convert and watermar videos

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"

this command isworking OK with with diffrent format videos but I got this error message for one of the MOV videos

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

and these are the warnings I got before the error message

[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 does not mux PCM audio in MP4 files, so you'll have to convert using a supported codec like AAC, MP3, AC3..etc.

For AAC encoding, use -c:a aac

e.g.

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 MOV到MP4错误{无法写入输出文件#0(编解码器参数不正确)的标题:参数无效}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆