Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When used with ffmpeg leverage vaapi for much faster generation #58

Open
barolo opened this issue Apr 27, 2020 · 1 comment
Open

When used with ffmpeg leverage vaapi for much faster generation #58

barolo opened this issue Apr 27, 2020 · 1 comment

Comments

@barolo
Copy link

barolo commented Apr 27, 2020

I've been experimenting with hw accelerated ffmpeg thumbnailer via changing ffmpeg command to:

    local ffmpeg_command = {
        "ffmpeg",
        "-loglevel", "quiet",
        "-noaccurate_seek",
        "-hwaccel", "vaapi",
        "-hwaccel_device", "/dev/dri/renderD128",
        "-hwaccel_output_format", "vaapi", 
        "-ss", format_time(timestamp, ":"),
        "-i", file_path,

        "-frames:v", "1",
        "-an",

        "-vf", ("scale_vaapi=%d:%d,scale_vaapi=format=rgb32,hwdownload,format=rgb32"):format(size.w, size.h),
        "-c:v", "rawvideo",
        "-pix_fmt", "bgra",
        "-f", "rawvideo",

        "-y", output_path
    }```


And it is much much faster. could it be used when ffmpeg is picked?
@Steven79203
Copy link

I tested these same configurations but didn't worked properly without modifications. Here's my config if anyone with similar specs want to try:
CPU: 3th Gen Intel Ivybridge, GPU: Intel Ivybridge (Gen 7) Integrated Graphics

local ffmpeg_command = {
        "ffmpeg",
        --"-loglevel", "quiet",
        "-noaccurate_seek",
        "-ss", format_time(timestamp, ":"),
        "-hwaccel_output_format","vaapi",
        "-hwaccel_device","/dev/dri/renderD128",
        "-hwaccel", "vaapi",
        "-i", file_path,
        "-frames:v", "1",
        "-an",


        "-vf", ("scale_vaapi=%d:%d,scale_vaapi=format=rgb32,hwdownload,format=nv12"):format(size.w, size.h),
        "-c:v", "rawvideo",
        "-pix_fmt", "bgra",
        "-f", "rawvideo",

        "-y", output_path
}

Works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants