tanersener / react-native-ffmpeg

FFmpeg for react-native. Not maintained anymore. Superseded by FFmpegKit.
GNU General Public License v3.0
400 stars 51 forks source link

Android: No such filter: 'boxblur' #237

Closed andrewchae closed 3 years ago

andrewchae commented 3 years ago

Description Hi, I'm getting this error (No such filter: 'boxblur') on Android while using the min-gpl-lts package. I've also tried various other gpl packages and they are all still getting the same error. Using the min-gpl package on iOS works fine for the same code.

This is the code we are using:

let filter = [
        'split[original][copy]',
        '[copy] crop=w=ih*9/16, scale=-2:1280, setsar=1/1, setdar=9/16, boxblur=\'luma_radius=min(w,h)/5\':chroma_radius=\'min(cw,ch)/5\':luma_power=1 [blurred]'
    ]

    if (zoom !== 1) {
        const width = 720 * zoom
        const crop = (width - 720) / 2
        filter.push(`[original] scale=${width}:-2,setsar=1/1,crop=iw-${crop} [resized]`)
    } else {
        filter.push('[original] scale=720:-2,setsar=1/1 [resized]')
    }

    filter = [
        ...filter,
        '[blurred][resized] overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2'
    ]

    let args = [
        '-i', inputFile,
        '-y',
        '-filter_complex', filter.join(';'),
        '-acodec', 'aac',
        '-b:a', '192k',
        '-ac', '2',
        '-r', '60',
        '-f', 'mp4',
        '-maxrate', '25000k',
        '-bufsize', '50000k',
        '-movflags', '+faststart',
        '-pix_fmt', 'yuv420p',
        '-threads', '0',
        outputFile
    ]

    if (Platform.OS === 'ios') {
        args = [
            ...args,
            '-vcodec', 'libx264',
            '-crf', '20',
            '-preset', 'veryfast'
        ]
    }

    const rc = await RNFFmpeg.executeWithArguments(args)

Expected behavior I expect the min-gpl-lts package to allow me to use the boxblur filter.

Current behavior I get the error: No such filter: 'boxblur'

Environment

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.