k4yt3x / video2x

A lossless video/GIF/image upscaler achieved with waifu2x, Anime4K, SRMD and RealSR. Started in Hack the Valley II, 2018.
https://video2x.org
GNU Affero General Public License v3.0
9.69k stars 951 forks source link

GUI fixed -hwaccel to auto #274

Open ruevers opened 4 years ago

ruevers commented 4 years ago

Environment Information

Version Video2X 4.3.0

FFmpeg not working with Nvidia GPU using -hwaccel auto and in GUI or YAML file if you change parameter to -vsync 0 -hwaccel cuvid not working and continue forcing to -vsync 0 -hwaccel auto, which use CPU to extraction and assemble, if possible, put a field to force -vsync 0 -hwaccel cuvid for example to force use nvidia GPU in FFmpeg.

k4yt3x commented 4 years ago

You can change the method here in the config file.

image

BTW, could you please break sentences into smaller sentences the next time for readability? Also the typos.

ruevers commented 4 years ago

You can change the method here in the config file.

image

BTW, could you please break sentences into smaller sentences the next time for readability? Also the typos.

Really sorry I am not be able to be more precise, my english is very basic, but I prefer this, otherwise use translator and change too much the sense of the phrase. I had try do the change in config file before open the issue and not sucefull with this, for any reason, the code is change to auto, how can you see in this images.

video2 video1

So, no mather what the program in auto never use nvidia gpu in ffmpeg just the processor, if you fix this, the conversion will be more faster using a nvidia gpu.

ruevers commented 4 years ago

I am not a programer in python, so I not dare try chante your code, but I think the problem is in video2x_gui.py in line video3

ruevers commented 4 years ago

I think I discovery another important thing, because I am trying to do a runing in colab google for linux. If you use the parameter -pix_fmt rgba64be wich is default, not be able to run with -hwaccel cuvid, this parameter -pix_fmt rgba64be is needed or not??

If you are interested in see my cloud runing of the software, follow the link, but is a work in progress. https://colab.research.google.com/drive/1E_CexJNJfjDV36fWySDOek38k8MdoVsI?usp=sharing whit this the users can try the software whithout nvidia gpus or big cpu processing.

dgcampea commented 4 years ago
ruevers commented 4 years ago
  • What GPU are you using?
  • ffprobe output of the video (located at the Tools Tab)

The gpu is a GTX 1060

The second information I will try get next run, but I think you don´t understand, the option are overwrithed by the software, does not mether if I set cuvid, It changes to auto. in config file or not.

dgcampea commented 4 years ago

set cuvid, It changes to auto

That could be a bug but that's most likely not what's affecting you in the first place (auto should pick cuvid if available).

Your video codec might not be compatible with hardware acceleration, hence its falling back to software decoding.

ruevers commented 4 years ago

set cuvid, It changes to auto

That could be a bug but that's most likely not what's affecting you in the first place (auto should pick cuvid if available).

Your video codec might not be compatible with hardware acceleration, hence its falling back to software decoding.

That is my point, is a bug, because does not mather if I set cuvid the gui program change to auto and not use the gpu to decode ffmpeg. I use last version of vide2x and update my nvidia drivers and issue is the same.

lhanjian commented 4 years ago

My Linux FFmpeg will use 'cuda'(not cuvid) when using '-hwaccel auto'. My GPU is GTX750Ti

k4yt3x commented 4 years ago

I am not a programer in python, so I not dare try chante your code, but I think the problem is in video2x_gui.py in line video3

I see what's going on there. I might consider adding a drop down menu or a text box so you can choose the hwaccel value.

ruevers commented 4 years ago
  • What GPU are you using?
  • ffprobe output of the video (located at the Tools Tab)

Follow the fprobe

"streams": [ { "index": 0, "codec_name": "h264", "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", "profile": "Constrained Baseline", "codec_type": "video", "codec_time_base": "1001/60000", "codec_tag_string": "avc1", "codec_tag": "0x31637661", "width": 400, "height": 300, "coded_width": 400, "coded_height": 304, "closed_captions": 0, "has_b_frames": 0, "sample_aspect_ratio": "1:1", "display_aspect_ratio": "4:3", "pix_fmt": "yuv420p", "level": 21, "chroma_location": "left", "refs": 1, "is_avc": "true", "nal_length_size": "4", "r_frame_rate": "30000/1001", "avg_frame_rate": "30000/1001", "time_base": "1/30000", "start_pts": 0, "start_time": "0.000000", "duration_ts": 9290281, "duration": "309.676033", "bit_rate": "581194", "bits_per_raw_sample": "8", "nb_frames": "9281", "disposition": { "default": 1, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0 }, "tags": { "creation_time": "2020-04-13T23:15:55.000000Z", "language": "und", "handler_name": "ISO Media file produced by Google Inc. Created on: 04/13/2020." } }, { "index": 1, "codec_name": "aac", "codec_long_name": "AAC (Advanced Audio Coding)", "profile": "LC", "codec_type": "audio", "codec_time_base": "1/44100", "codec_tag_string": "mp4a", "codec_tag": "0x6134706d", "sample_fmt": "fltp", "sample_rate": "44100", "channels": 2, "channel_layout": "stereo", "bits_per_sample": 0, "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/44100", "start_pts": 0, "start_time": "0.000000", "duration_ts": 13660160, "duration": "309.754195", "bit_rate": "96001", "nb_frames": "13340", "disposition": { "default": 1, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0 }, "tags": { "creation_time": "2020-04-13T23:15:55.000000Z", "language": "und", "handler_name": "ISO Media file produced by Google Inc. Created on: 04/13/2020." } } ], "format": { "filename": "E:\video\raul.mp4", "nb_streams": 2, "nb_programs": 0, "format_name": "mov,mp4,m4a,3gp,3g2,mj2", "format_long_name": "QuickTime / MOV", "start_time": "0.000000", "duration": "309.754000", "size": "26313070", "bit_rate": "679586", "probe_score": 100, "tags": { "major_brand": "mp42", "minor_version": "0", "compatible_brands": "isommp42", "creation_time": "2020-04-13T23:15:55.000000Z" } } }

ruevers commented 4 years ago

My Linux FFmpeg will use 'cuda'(not cuvid) when using '-hwaccel auto'. My GPU is GTX750Ti

I try this 'cuda' and the issue is the same, by the way I am using windows.

donicrosby commented 3 years ago

Fixed in #373 Although due to the settings being used with ffmpeg there is a negligible speedup as all of the options use the CPU to do the encoding rather than the GPU see: #374