error occured on -pix_fmt in ffmpeg while converti

2019-07-15 01:41发布

问题:

I am trying to convert .mov to .mp4 using ffmpeg my command is :

ffmpeg -i input.mov -vcodec libx264 -acodec copy output.mp4

but its giving me error like this

    [buffer @ 00000000059bf480] Unable to parse option value "-1" as pixel format
Last message repeated 1 times

[buffer @ 00000000059bf480] Error setting option pix_fmt to value -1. [graph 0 input from stream 0:4 @ 00000000043fd8a0] Error applying options to the filter. Error opening filters!

even I tried for another command

ffmpeg -i input.mov -vcodec copy -acodec copy output.mp4

but it converts only some part and first part is blank with sound then after some time picture is coming..

I have two Q's

1] for first command what is -pix_fmt and what value to be set for ?

2] for second command why it was giving only some part, as I am copying everything vcodec as well acodec..

please guide me ..!!

回答1:

Probably, selected profile does not support 4:2:2.

So, you need to mention the 4:2:0 by adding "-pix_fmt yuv420p" to the command.

Hope this will fix it.



回答2:

FFmpeg's "Unable to parse option value '-1' as pixel format" does occur with corrupted or harder to parse videos (although doubted on the mailing list). I've had it, and the best comment on that is to try increasing analyzeduration - as in this ticket. Some ffmpegs/ avconvs also give a note about tinkering with probesize:

Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 720x576, 869 kb/s): unspecified pixel format Consider increasing the value for the 'analyzeduration' and 'probesize' options

Well, both didn't work on a file where I tried it:

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2c36940] multiple edit list entries, a/v desync might occur, patch welcome [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2c36940] max_analyze_duration 5000000 reached

but other people's mileage may vary.



回答3:

you are running an old version of ffmpeg. this problem of conversion from .mov to .mp4 was fixed. see this

download the latest version. i would recommend installing the latest version from a binary as it is much simpler. i have answered about the same here

-pix_fmt is pixel format and its value should be an integer.

run ffmpeg -pix_fmts to see the all the available pixel formats.



标签: video ffmpeg