[FFmpeg-user] Flutter FFmpeg

Ted Park kumowoon1025 at gmail.com
Thu Apr 16 06:57:50 EEST 2020


> ```
>  int resultCode = await _ffmpeg.executeWithArguments([
>        "-noautorotate",
>        "-i",
>        fileToCompress.path,
>        "-movflags",
>        "+faststart",
>        "-vcodec",
>        "libx264",
>        "-crf",
>        "<DYNAMIC VAR - options : 18, 20, 24, 28, 31>",
>        '-preset:v',
>        '<DYNAMIC VAR - options : "veryfast","faster">',
>        "-vf",
>        "format=yuv420p",
>        result.path
>      ]);
> ```
> **Current behaviour**
> This works well on android (testing with a oneplus 6) as it always seems to compress the file to <20MB in a reasonable time. However when i test this on IOS (Iphone SE) the imagepicker seems to compress the video first e.g. 150MB to 25MB. Which I then attempt to compress the 25MB again with above command with params "veryfast" and 18.
> The file always gets larger that the original 25mb and it takes forever to execute (>3min). Similar behaviour is experienced when I use different params e.g. 24 and faster.

Someone else recently uploaded an iPhone recording that qtfaststart completely fubar'ed, I think something to do with the export/share option adding a bunch of top-level metadata atoms after the moov? 

Could you possibly try importing the file doing your best not to let iOS alter it, and compare it to the file you transferred using the original method? If you're on a mac, a USB cable and Image Capture app should work, but drag the file somewhere, instead of importing it into Photos or other library.

Ted Park

More information about the ffmpeg-user mailing list