gpt4 book ai didi

macos - YUV到mp4的转换

转载 作者:行者123 更新时间:2023-12-04 22:51:18 28 4
gpt4 key购买 nike

我正在使用命令:

ffmpeg -i MovieTest.yuv -vcodec libx264 -b 1200kb -b_strategy 1 -coder 1 -qmin 10 -qmax 51 -sc_threshold 40 -flags +loop -cmp +chroma -me_range 16 -me_method hex -subq 5 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -directpred 1 -flags2 +fastpskip -dts_delta_threshold 1 -acodec libfaac -ab 128kb output.mp4 

用于 yuv 到 mp4 的转换。
这里 MovieTest.yuv 是我的输入文件,而 output.mp4 是我的输出文件。
我正在使用 h.264 编解码器(libx264)进行转换。

它可以正确转换我的大部分 yuv 文件。
但有时,转换失败并出现终端错误:
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '‪MovieTest.yuv‬':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
Duration: 00:00:06.45, start: 0.000000, bitrate: 109786 kb/s
Stream #0.0(und): Video: rawvideo, uyvy422, 640x480, 109675 kb/s, 22.31 fps, 27.25 tbr, 30k tbn, 30k tbc
Stream #0.1(und): Audio: aac, stereo, s16, 106 kb/s
[libx264 @ 0x12180da00]using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
[libx264 @ 0x12180da00]profile High, level 3.0
[libx264 @ 0x12180da00]264 - core 98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2010 - http://www.videolan.org/x264.html - options: cabac=1 ref=6 deblock=1:0:0 analyse=0x3:0x133 me=umh 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=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 constrained_intra=0 bframes=0 weightp=0 keyint=12 keyint_min=7 scenecut=40 intra_refresh=0 rc_lookahead=12 rc=abr mbtree=1 bitrate=120 ratetol=33.3 qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 ip_ratio=1.41 aq=1:1.00
[libfaac @ 0x12180e000]libfaac doesn't support this output format!
Output #0, mp4, to 'output.mp4':
Stream #0.0(und): Video: libx264, yuv420p, 640x480, q=10-51, 120 kb/s, 90k tbn, 27.25 tbc
Stream #0.1(und): Audio: libfaac, stereo, s16, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Error while opening encoder for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height

如果有人有任何想法,那是怎么回事,请帮忙。

最佳答案

我认为这是因为您的输出比特率(128kb)高于输入比特率(106kb)。

我刚刚做了一个快速测试,当我将输出高于输入时,我的失败并出现与你相同的错误 - 当我再次降低它时它会成功。

这可以解释为什么它只对某些输入失败。

如果你以某种方式编写脚本,你将不得不使用 'ffmpeg -i' 或类似 MediaInfo 的东西。首先分析您的输入源并进行相应调整。

关于macos - YUV到mp4的转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5577772/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com