VideoHelp Forum
+ Reply to Thread
Results 1 to 16 of 16
Thread
  1. Hi,

    I need to adjust to contrast of some mkv file I have tried this code:


    Code:
    ffmpeg -y -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -i title00.mkv  -c:v hevc_nvenc -b:v 5M  -vf eq=contrast=1.0   output.mkv
    but I get this error:

    Code:
    Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0:0' and the filter 'auto_scaler_0'
    Error reinitializing filters!
    Failed to inject frame into filter network: Function not implemented
    Error while processing the decoded data for stream #0:0


    If I run the some line without "-vf eq=contrast=1.0":

    Code:
    ffmpeg -y -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -i title00.mkv  -c:v hevc_nvenc -b:v 5M    output.mkv

    the command work and don't show any error message but don't allow me to adjust the contrast.

    There is a way to modify the contrast with nvidia hevc_nvenc codec ?

    Thanks !
    Quote Quote  
  2. I don't use hevc_nvenc but try adding "-pix_fmt yuv420p" after "-vsync 0".
    Quote Quote  
  3. Remove "-hwaccel_output_format cuda " when you want to apply software based filters.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  4. Thank you, unfortunatenly if I add "-pix_fmt yuv420p" after "-vsync 0" I get

    Code:
    Option pixel_format not found.
    If I remove "-hwaccel_output_format cuda" (and I don't change northing else) the speed is slower and change from 18x to 9x.

    Probably encode via software.

    I need to process 6 TB of video.

    There is another way ?
    Quote Quote  
  5. Option pixel_format not found.
    looks like you mistyped, 'pix_fmt' should be used not 'pixel_format'

    There is another way ?
    I think not.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  6. Originally Posted by marco000 View Post
    If I remove "-hwaccel_output_format cuda" (and I don't change northing else) the speed is slower and change from 18x to 9x.

    Probably encode via software.
    From what I've read (since my earlier reply) that option leaves the decompressed video in video memory. The CPU can't access that memory so CPU filters cannot be used on it. Removing that option causes the decompressed video to be copied back to CPU memory so the CPU can access it. Then when it's ready to be compressed it is copied back to video memory. That's the cause of the slowdown. Switching to CPU encoding would likely be a much bigger drop in performance (depending on encoder and settings).

    https://developer.nvidia.com/blog/nvidia-ffmpeg-transcoding-guide/

    Originally Posted by marco000 View Post
    There is another way ?
    I don't now if there's any way to get the GPU to perform the contrast adjustment.
    Quote Quote  
  7. Last I checked (ffmpeg -filters) there were only hardware filters for overlay, yadif, thumbnail and scale,....
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  8. If the contrast or other setting is not make by GPU, this is not a problem becouse it is a fast operation.

    The most important think is the encode / decode that must be done by GPU otherwise will be a high drop of performace.

    Hope exist a solution.
    Quote Quote  
  9. Originally Posted by Selur View Post
    Last I checked (ffmpeg -filters) there were only hardware filters for overlay, yadif, thumbnail and scale,....
    Thanks !

    how I can get this list ?
    Quote Quote  
  10. I only saw scale_npp and transpose_npp in the ffmpeg filters doc:

    https://ffmpeg.org/ffmpeg-filters.html#scale_005fnpp
    https://ffmpeg.org/ffmpeg-filters.html#transpose_005fnpp

    Originally Posted by marco000 View Post
    If the contrast or other setting is not make by GPU, this is not a problem becouse it is a fast operation.
    It's the copy operations that are slowing it down:

    Copy decompressed frame from video memory to CPU memory, apply CPU eq filter, copy frame from CPU memory back to GPU memory for compression.
    Quote Quote  
  11. just to let you known I have found the solution:

    -vf hwdownload,format=nv12,eq=contrast=1,hwupload_cuda


    in short: Add "hwdownload,format=nv12," before and ",hwupload_cuda" after my filter and work perfectly.

    Thanks !
    Quote Quote  
  12. How does the speed compare?
    Quote Quote  
  13. I assumed that this is what ffmpeg should have done in the background when without "-hwaccel_output_format cuda",....
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  14. here full command line:

    ffmpeg -y -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -i title00.mkv -an -sn -c:v:0 hevc_nvenc -cq 30 -vf hwdownload,format=nv12,eq=contrast=1.03,hwupload_c uda output_ottimale.mkv

    there is no any speed drop (for some strange reason in this post cut "hwupload_cuda").

    Only for my curiosity:

    Someone have experience about option like these:

    -rc-lookahead 32 -spatial-aq 1 ?

    someone tell that improve the quality but I don't known if is true or not ? I have GTX 1060 6GB video card
    Quote Quote  
  15. you might want to read: https://docs.nvidia.com/video-technologies/video-codec-sdk/pdf/Using_FFmpeg_with_NVIDI...celeration.pdf
    Both Lookahead and Adaptive Quantization (AQ) are explained there,...
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  16. Thanks !! I wlll follow this pdf file
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!