axcore / tartube

A GUI front-end for youtube-dl, partly based on youtube-dl-gui and written in Python 3 / Gtk 3
GNU Lesser General Public License v2.1
1.92k stars 105 forks source link

Allow the use of custom commands for FFmpeg #600

Closed ADRick-C closed 5 months ago

ADRick-C commented 7 months ago

I have been using this program frequently, right now I am a film student, and I use a lot of you tube content for my projects. However, a bottleneck in my workflow is waiting for video transcoding by CPU. I looked in the ffmpeg options to enable gpu acceleration, but despite using the NVIDIA options, the cpu still does all the work. I uninstalled and reinstalled Tartube, but instead of installing the tartube ffmpeg, I used a version with the hardware acceleration libraries built in, enabled the gpu options in tartube, and same problem cpu is doing all work. I tried the custom ffmpeg , and ran a command line from its location in the program files, to check the operation, I used the command prompt that tartube generates from video config (just modify the input and output file so that it was local), and did not work, the tartube ffmpeg settings for NVIDIA are obsolete, and using a custom and up to date command prompt, the transcoding works on gpu perfectly.

I just need to be able to enter my command prompt on ffmpeg tartub config, to be able to use my GPU, since it overcomes the speed by 3x of my CPU for this purpose. The program does not allow to enter a custom command built from scratch. I tried the json config file, but it lacks of all modern transcoding ffmpeg options for nvidia gpus.

The command I want to use is this:

ffmpeg -y -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -i source.ext -c:a copy -c:v h264_nvenc -preset p6 -tune hq -b:v 15M -bufsize 10M -maxrate 20M -qmin 0 -g 250 -bf 3 -b_ref_mode middle -temporal-aq 1 -rc-lookahead 20 -i_qfactor 0.75 -b_qfactor 1.1 source.mp4

"source.ext" i changed this option, cause is the video file source from tartube. "source.mp4" i changed its from .ext to mp4 cause all files will be h264.

For testing only need change "source.ext" for name and format from input file.

Thankyou

axcore commented 7 months ago

I have added that in v2.4.433. It is uploaded only to Github and Pypi.

The change seems to be what you need, but if not, I can tweak the code again.

the tartube ffmpeg settings for NVIDIA are obsolete

As mentioned in related issues, the FFmpeg options window is based on a separate piece of software, because I'm not very familiar with the use of FFmpeg. If you would like to suggest changes to the layout of the window, in order to remove anything that's obsolete, then I can add those changes (providing all the code).

ADRick-C commented 7 months ago

I am not a developer, i tried to build form Pypi source but this error appers. How can i get the beta version 2.4.433?. Or can build it in windows from source code?

Captura de pantalla 2023-11-22 211815

If you would like to suggest changes to the layout of the window, in order to remove anything that's

Sure, i could build command prompts for different transcoding quality, av1 or hevc for nvidia. The only options i reccomend to change are the intial bit rate and the maxium bit rate. Other options are alredy set following nvidia reccomended p6 profile for quality in the command. Resolution is the same a input file.

axcore commented 7 months ago

On Windows, Tartube can't be installed with Pypi. Try this instead: https://github.com/axcore/tartube#update-tartube-on-ms-windows

axcore commented 5 months ago

Custom FFmpeg commands are available in today's release, v2.5.0. (You can use the normal Windows installers.)