[英]ffmpeg for android, out of memory on decoding rotate mp4 file with openh264
I try to trim a .mp4
file which metadata
info contains rotate info, but I failed with the error information. 我尝试整理一个
.mp4
文件,该文件的metadata
信息包含旋转信息,但是由于错误信息而失败。
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2018-10-09T09:40:53.000000Z
location : +39.8983+116.4145/
location-eng : +39.8983+116.4145/
com.android.version: 6.0
Duration: 00:00:10.56, start: 0.000000, bitrate: 8671 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 8563 kb/s, SAR 1:1 DAR 16:9, 30.01 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
rotate : 180
creation_time : 2018-10-09T09:40:53.000000Z
handler_name : VideoHandle
Side data:
displaymatrix: rotation of -180.00 degrees
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
creation_time : 2018-10-09T09:40:53.000000Z
handler_name : SoundHandle
ffmpeg -y -i 1.mp4 -threads 4 -b:v 2000k -vcodec libopenh264 -acodec copy -ss 0 -t 3 -f mp4 -movflags faststart -strict -2 ./output.mp4
Error reinitializing filters!
Failed to inject frame into filter network: Out of memory
Error while processing the decoded data for stream #0:0
Then I found this answer: ffmpeg-for-android-out-of-memory , after i added -noautorotate
command to my cmd, the video is trimmed successful. 然后我找到了这个答案: ffmpeg-for-android-out-of-memory ,在我向cmd添加
-noautorotate
命令后,视频被成功修剪。
If I use -vcodec copy
instead of -vcodec libopenh264
, the result also is ok, I wonder if there is a bug when libopenh264
decode with ffmpeg's autorotate function. 如果我使用
-vcodec copy
而不是-vcodec libopenh264
,结果也可以,我想知道当使用ffmpeg的自动旋转功能对libopenh264
解码时是否存在错误。
I wipe the video's rotate info from metadata with -metadata:s:v:0
command, the newly video can be trimmed successful with the origin cmd :( 我使用
-metadata:s:v:0
命令从元数据中-metadata:s:v:0
了视频的旋转信息,可以使用原始cmd :(
The error message is misleading. 该错误信息是令人误解的。 Due to your usage of
--disable-filters
you need to manually enable the hflip/vflip filters: 由于使用了
--disable-filters
,因此需要手动启用hflip / vflip过滤器:
--enable-filter=aresample,crop,hflip,scale,transpose,vflip
Some filters (such as the format filter) will be automatically enabled in this case. 在这种情况下,某些过滤器(例如格式过滤器)将自动启用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.