简体   繁体   English

使用 ffmpeg 将 heif 文件转换为 png/jpg

[英]convert a heif file to png/jpg using ffmpeg

The use case is very straight forward.用例非常简单。 Imagemagick is able to do the conversion but I want to do it with ffmpeg. Imagemagick 能够进行转换,但我想使用 ffmpeg 进行转换。 Here is the all commands I have tried and all of them gives moov atom not found error.这是我尝试过的所有命令,它们都给出了 moov atom not found 错误。

ffmpeg -i /Users/ajitesh/Downloads/sample1.heif -c:v png -pix_fmt rgb48 /Users/ajitesh/Downloads/sample.png

Output Output

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f85aa813200] moov atom not found
/Users/ajitesh/Downloads/sample1.heif: Invalid data found when processing input

it seems like moov atom is actually not present by trying to extract the location of moov atom using the following command通过尝试使用以下命令提取 moov atom 的位置,似乎 moov atom 实际上不存在

ffmpeg -v trace -i /Users/ajitesh/Downloads/sample1.heif 2>&1 | grep -e type:\'mdat\' -e type:\'moov\'

Output Output

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f824c00f000] type:'mdat' parent:'root' sz: 2503083 420 2503495
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f824c00f000] type:'mdat' parent:'root' sz: 2503083 420 2503495

FFmpeg does not currently support HEIF decoding (as of 2021-01-11). FFmpeg 目前不支持 HEIF 解码(截至 2021 年 1 月 11 日)。

Check the bug report #6521: HEIF support as FFmpeg development is active and the situation may change in the future.检查错误报告#6521:HEIF 支持,因为 FFmpeg 开发处于活动状态,未来情况可能会发生变化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM