-
Notifications
You must be signed in to change notification settings - Fork 200
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
Where can i add -vf 'scale_qsv=w=1920:h=1080:format=nv12' #1666
Comments
Looks like adding it to postopts works Is there a way for me to only convert only if the source pix_fmt is not |
@mdhiggins I wonder if these issues are because of ffmpeg 5+? I just tried vaapi instead of qsv and i got the same error trying to convert 10bit hevc to h264: |
@mdhiggins it seems that for quicksync the |
Also when transcoding 10bit to 8bit, the pix_fmt option needs to be nv12 with qsv. other options won't work. |
So it looks like this issue is multifactorial First problem is that the QSV protcol in SMA doesn't have a specific override like VAAPI or NVENC to handle the resizing scalar options and insert the proper filters, I just added a variant of this based on the way NVEnvc is implemented so see if that helps The other issue is your approach to inserting this information. With this update and with the behavior of the other codecs you don't need to force the filter using post opts as it will get injected when appropriate Your pix_fmt shouldn't be nv12 since this is more of a transitional format to move between the hardware encoder/decoder and not a valid final output format, and the above update should inject nv12 as the format transiently See if that works, if not I have another approach more similar to the way the VAAPI codec injects the filters that I can try. I unfortunately do not have a QSV device available for testing |
thanks i'll try this out today. I'm aiming to convert all files to 8bit h264. if that's the case, what pix_fmt should i use in order to use qsv? |
@mdhiggins still getting some errors and i'm happy to test out as much as you would like. I tried the following ways:
Here are the different errors and the generated ffmpeg commands: pix_fmt blank:
ffmpeg command:
pix_fmt=yuv420p
ffmpeg command:
pix_fmt=nv12:
ffmpeg command:
|
@mdhiggins any ideas what i could be doing wrong here? |
Haven't had free time to work on this. Could you post a sample of a working version of the command you're looking for and I'll try to tweak things to target that |
this seems to work to convert 10bit HEVC to 8bit h264:
|
Hm so this command is not ideal because you're not specifying any sort of output format, you're just letting it pick defaults. What pix_fmt does this ultimately output? nv12 is just a transitional format so the final pix_fmt here would be out of user control. We would need to come up with a command that allows that to be specified otherwise we are forcing everyone to drop hdr |
@mdhiggins I'm not really sure tbh, the command above is the only thing i could get to get quicksync working (as verified by intel_gpu_top). Are there any other pix_fmt i should try? I have an |
What was the pix fmt that was created using your sample command? Should be able to pull this from ffprobe |
@mdhiggins Here is the output for ffprobe. it looks like it is
|
Pix_fmt should be supported and is included in the QSV documentation https://trac.ffmpeg.org/wiki/Hardware/QuickSync I'll see if I can find a solution |
I'm seeing similar issues with NVENC :( I'm doing a similar thing - converting 10bit HDR HEVC => 8bit h264 - just using NVENC vs QSV. I did a bunch of digging and experimentation... Trying different combinations of scaling filters, format filters, etc. The lowest-touch change I was able to come up with was:
Like I said, I tried TONS of combinations such as hwdownloading, converting to nv12 or yuv420p, re-hwuploading, etc etc. But the above is the only thing that worked for my file. |
Alright, so trying to find a way to implement this dynamically, that's my first attempt I added a subclass of the nvenc for h265 that will override the default scaler to scale_cuda instead of scale_npp; so now if you configure your codecs to be either h265_nvenc_cuda or hevc_nvenc_cuda it will use that scaler Now similar to how vaapi is handled I'm also reading and pulling the pix_fmt data from the settings and if that's specified it's including that in the filter using the sample filter string you provided. I don't have any nvidia hardware readily available to test this on so let me know if it works. If it get close but you have to tweak the final ffmpeg command generated to get it to behave let me know and I can try and adjust Open to suggestions too if you think there's a better way to implement this stuff; the hardware acceleration implementations have made this project quite the headache its hard to have a general solution that works for everyone Edit: if we get this working I'll update the nvenc h264 classes as well |
This is analgous (albeit re: conversions TO 265...) to a previous issue with pix-fmt... I have used
and
...leaving the pix-fmt emtpy |
Sorry for jumping in here, but it looks like the error I'm getting with SMA and using cuda, cuvid is similar. This error only appears in SMA when I scale down to 720p "No such filter: 'scale_npp'" /usr/bin/ffmpeg -hwaccels
|
Describe the bug
I'm trying to convert all videos to h264. but when converting hevc files i'm getting errors. I have hardware decoding and encoding working by using the following ffmpeg command:
Command or context you are trying to run
./automator/manual.py -a -nd -i input.mkv
autoProcess.ini settings
Log files
FFMpeg headers
System Information
Expected behavior
hevc_qsv
is used for decoding andh264_qsv
is used for encodingAdditional context
I have it working with the following ffmpeg command:
The text was updated successfully, but these errors were encountered: