-1

I have a video cropper working fine to all videos I tested, but a video from s20 ultra, gives me some error in FFmpeg, i don't really know if the video is oversize or not my source code https://github.com/rushidevmurari/RushiCropVideo/blob/213166834b0bc6ce83ab3f4ac494f261a57d7436/app/src/main/java/com/androworld/allinonevideoeditor/videocrop/VideoCropActivity.java

I got these link but nothing good to my work Error when cropping video using FFMPEG

  [graph 0 input from stream 0:0 @ 0x7673807a4b40] sws_param option is deprecated and ignored
    [Parsed_crop_0 @ 0x7673807a4c80] Invalid too big or non positive size for width '3840' or height '1920'
    [Parsed_crop_0 @ 0x7673807a4c80] Failed to configure input pad on Parsed_crop_0
    Error reinitializing filters!
    Failed to inject frame into filter network: Invalid argument
    Error while processing the decoded data for stream #0:0
    Conversion failed!

my command

I/System.out: "-y" "-ss" "0" "-t" "31" "-i" "/storage/emulated/0/Download/20210227_175547.mp4" "-strict" "experimental" "-vf" "crop=w=3837:h=2160:x=1:y=-2070" "-r" "15" "-ab" "128k" "-vcodec" "mpeg4" "-acodec" "copy" "-b:v" "2500k" "-sample_fmt" "s16" "-ss" "0" "-t" "31" "/storage/emulated/0/VEditor/VideoCroper/20210227_175547-0-13.mp4"

I/mobile-ffmpeg: Loading mobile-ffmpeg.

my full log https://ghostbin.co/paste/s2qdw

1 Answers1

0

ffmpeg is auto rotating the video due to the rotate side data, so it becomes 2160x3840 before being cropped resulting in the error. You can tell it not to auto rotate with the -noautorotate input option.

I/System.out: "-y" "-noautorotate" "-ss" "0" "-t" "31" "-i" "/storage/emulated/0/Download/20210227_175547.mp4" "-vf" "crop=w=3837:h=2160:x=1:y=-2070" "-r" "15" "-vcodec" "mpeg4" "-acodec" "copy" "-b:v" "2500k" "/storage/emulated/0/VEditor/VideoCroper/20210227_175547-0-13.mp4"

I removed the options that don't do anything.

llogan
  • 121,796
  • 28
  • 232
  • 243