gpt4 book ai didi

android - 为输出流打开编码器时淡入淡出视频错误 #0 :0 - maybe incorrect parameters such as bit_rate, 速率、宽度或高度

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

我正在使用以下命令为我的视频添加淡入淡出效果

{"-y", "-ss", "" + startMs / 1000, "-t", "" + (endMs - startMs) / 1000, "-i", inputPath, "-acodec", "copy", "-vf", "fade=t=in:st=0:d=5,fade=t=out:st=" + String.valueOf((endMs - startMs) / 1000 - 5) + ":d=5", outputPath};

我收到以下错误-

"Failure3.3 5 .3gpffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers\n built with gcc 4.8 (GCC)\n configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=\n libavutil 55. 17.103 / 55. 17.103\n libavcodec 57. 24.102 / 57. 24.102\n libavformat 57. 25.100 / 57. 25.100\n libavdevice 57. 0.101 / 57. 0.101\n libavfilter 6. 31.100 / 6. 31.100\n libswscale 4. 0.100 / 4. 0.100\n libswresample 2. 0.101 / 2. 0.101\n libpostproc 54. 0.100 / 54. 0.100\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/DCIM/Camera/VID_20180825_071734915.3gp':\n Metadata:\n major_brand : 3gp4\n minor_version : 0\n
compatible_brands: isom3gp4\n creation_time : 2018-08-25 01:47:47\n com.android.version: 8.0.0\n Duration: 00:00:10.83, start: 0.000000, bitrate: 17217 kb/s\n Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1920x1080, 16756 kb/s, SAR 1:1 DAR 16:9, 29.49 fps, 29.58 tbr, 90k tbn, 180k tbc (default)\n Metadata:\n rotate : 90\n
creation_time : 2018-08-25 01:47:47\n handler_name : VideoHandle\n Side data:\n displaymatrix: rotation of -90.00 degrees\n Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 128 kb/s (default)\n Metadata:\n
creation_time : 2018-08-25 01:47:47\n handler_name : SoundHandle\n[h263 @ 0xf49ff400] H.263 does not support resolutions above 2048x1152\nOutput #0, 3gp, to '/storage/emulated/0/Movies/fade_video.3gp':\n Metadata:\n
major_brand : 3gp4\n minor_version : 0\n
compatible_brands: isom3gp4\n com.android.version: 8.0.0\n
Stream #0:0(eng): Video: h263, none, q=2-31, 128 kb/s, SAR 1:1 DAR 0:0, 29.58 fps (default)\n Metadata:\n handler_name : VideoHandle\n creation_time : 2018-08-25 01:47:47\n
encoder : Lavc57.24.102 h263\n Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, 128 kb/s (default)\n
Metadata:\n creation_time : 2018-08-25 01:47:47\n
handler_name : SoundHandle\nStream mapping:\n Stream #0:0 -> #0:0 (h264 (native) -> h263 (native))\n Stream #0:1 -> #0:1 (copy)\nError while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height\n"



为什么在上述命令中导致此错误?欢迎任何帮助。

最佳答案

如日志所述,H.263 不支持高于 2048x1152 的分辨率。您的源流是 1920x1080,但它旋转了 90 度,因此 ffmpeg 将其自动旋转到 1080x1920,这不符合限制。您可以在淡入淡出后添加缩放过滤器以有条件地缩小尺寸。
scale='if(lte(iw,2048)*lte(ih,1152),iw,if(gt(dar,2048/1152),2048,2*trunc(oh*dar/2)))':'if(lte(iw,2048)*lte(ih,1152),ih,if(gt(dar,2048/1152),2*trunc(ow/dar/2),1152))'
x 和 y 表达式首先检查输入是否大于 2048x1152。如果否,请保留原始分辨率。如果是,检查输入的显示比例。如果大于 2048:1152,则将宽度缩小为 2048 并按比例调整高度,否则将高度缩小为 1152 并按比例调整宽度。 dar代表显示纵横比。

关于android - 为输出流打开编码器时淡入淡出视频错误 #0 :0 - maybe incorrect parameters such as bit_rate, 速率、宽度或高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52465359/

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