Thursday, 29 October 2020

Flutter Ffmpeg video compress error No such file or directory, but file exists

In a Flutter project, I'm trying to compress a video using Ffmpeg (min-gpl) and, only in iOS, I get the error

flutter: /var/mobile/Containers/Data/Application/6C20B1B1_compressed-D6BD-421B-98E3-21123BF15A04/Documents/videos/raw/VID_20201025_224514.mp4: No such file or directory

flutter: FFmpeg process exited with rc 1

, but, if I do this, right before I run the ffmpeg command,

    print(File(videoPath).existsSync().toString());

returns "true".

int rc = new FlutterFFmpeg()
    .execute(
        "-loglevel error -y -i ${videoPath} -vcodec libx264 -vprofile high -preset veryfast -b:v 1000k -maxrate 1000k -bufsize 1000k -vf \"pad=ceil(iw/2) * 2:ceil(ih/2)*2\" -threads 1 -b:a 128k ${outputPath}")
    .catchError((err) => _onCompressError(outputPath, err));

debugPrint("FFmpeg process exited with rc $rc");

I've done the integration using flutter-ffmpeg and there is indeed a video in that path. For the path I used path_provider.

Thanks in advance



from Flutter Ffmpeg video compress error No such file or directory, but file exists

No comments:

Post a Comment