lisamelton / other_video_transcoding

Other tools to transcode videos.
MIT License
543 stars 24 forks source link

Option "default_mode" missing from ffmpeg in Ubuntu 20.04 #113

Closed mikaelmoutakis closed 2 years ago

mikaelmoutakis commented 2 years ago

Hi. other_transcode fails with: Transcoding... Unrecognized option 'default_mode'. Error splitting the argument list: Option not found /usr/local/bin/other-transcode: transcoding failed: title_t00.mkv on Ubuntu 20.04 using the built-in version of ffmpeg (4.2.4).

lisamelton commented 2 years ago

@mikaelmoutakis I'm sorry, but version 4.3 or later of ffmpeg is now required to run other-transcode as of the 0.9.0 release. :( The Ubuntu built-in version is very old. You should be able to find an up-to-date package here:

https://launchpad.net/ubuntu/+source/ffmpeg

skj-dev commented 2 years ago

@mikaelmoutakis

Alternatively, since you're on Linux, you can use the Docker container, if you're so inclined.

https://github.com/ttyS0/docker-other-transcode

I do need to update the README with better examples, but if you're familiar with running Docker containers, it shouldn't be too hard to tease out. If it causes you problems, feel free to give me a yell over in the docker-other-transcode repository.

lisamelton commented 2 years ago

@ttyS0 D'oh! Thank you for mentioning that. I completely forgot. 🤦‍♂️

mikaelmoutakis commented 2 years ago

Hi again! Thank you for the quick answer. It is unfortunate that you could not make a version that was backwards compatible with ffmpeg 4.2. Ubuntu 20.04 and its derivatives are probably the most popular linux desktop install.

I did not wish install the docker version, because that would have forced me to muck about with NVIDIAs own drivers. If you're installing NVIDIAs drivers manually, you have to make sure you upgrade them when you upgrade the kernel. Real bad user-experience.

Ubuntu 20.04 has a snap with ffmpeg 4.3.x. But that build does not include ffprobe...

So I tried to install the latest static build of ffmpeg. Both the build from git master and from the latest stable release (4.4). I used the following guide.

I checked that ffmpeg can transcode videos.

But when running your tool other-transcode I get the following message.

other-transcode Mulle\ Meck\ S02/title_t00.mkv Verifying "ffprobe" availability... Verifying "ffmpeg" availability... Verifying "mkvpropedit" availability... Finding encoders... Scanning media... duration = 00:17:03.36 Stream mapping: 0 = libx264 / 1500 Kbps 1 = copy Command line: ffmpeg -loglevel error -stats -i Mulle\ Meck\ S02/title_t00.mkv -map 0:0 -filter:v yadif -c:v libx264 -b:v 1500k -maxrate:v 10000k -bufsize:v 10000k -mbtree:v 0 -profile:v high -color_primaries:v bt470bg -color_trc:v bt470bg -colorspace:v fcc -metadata:s:v title\= -disposition:v default -map 0:1 -c:a:0 copy -metadata:s:a:0 title\= -disposition:a:0 default -sn -metadata:g title\= -default_mode passthrough title_t00.mkv Transcoding... [libx264 @ 0x5972100] [Eval @ 0x7ffe631916e0] Undefined constant or missing '(' in 'bt470bg' [libx264 @ 0x5972100] Unable to parse option value "bt470bg" [libx264 @ 0x5972100] Error setting option color_trc to value bt470bg. Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height /usr/local/bin/other-transcode: transcoding failed: title_t00.mkv

martinpickett commented 2 years ago

This latest error:

[libx264 @ 0x5972100] [Eval @ 0x7ffe631916e0] Undefined constant or missing '(' in 'bt470bg' [libx264 @ 0x5972100] Unable to parse option value "bt470bg" [libx264 @ 0x5972100] Error setting option color_trc to value bt470bg.

Seems similar to issue #112. It might be easier to keep track if you add your error to that thread.

Regarding your initial issue I will echo @ttyS0 by suggesting Docker. There are three main Docker variants, NVIDIA, QSV and Software. At the very least you will be able to use the software version which will force other-transcode to use the slower x264 or x265 software encoders. The NVIDIA and QSV images utilise NVIDIA and INTEL hardware encoders which are much quicker than the software encoders. To the best of my knowledge the NVIDIA and QSV Docker images contains all the drivers required, so you do not have to install them on the host system, but @ttyS0 will know for certain.

If you are not aware, the version of FFmpeg you installed most recently (from John Van Sickle's website) does not support either the NVIDIA or INTEL hardware encoders and so is equivalent to the Software Docker image mentioned above.

As a fellow Ubuntu 20.04 user I know the inconvenience of other-transcode not supporting FFmpeg 4.2.4, but @donmelton did it for good reasons. I too have tried various new ways to install FFmpeg including using the pre-built version you are currently using, I even went slightly mad and compiled the whole thing from scratch with support for QSV encoding. In the end, @ttyS0's Docker images are the best solution I have found. They are easy to install and update and, once you have your head round the odd syntax, easy to use.

I hope you find this helpful.

skj-dev commented 2 years ago

@mikaelmoutakis

Unfortunately, if you want to get the most benefit from Nvidia hardware on Linux you're going to have to muck with the Nvidia driver process and all its associated annoyances, regardless of transcoding. To that point, the Nvidia variant of the Docker container does require the NVidia Container Toolkit to be installed as a dependency, though they do provide their own Ubuntu repository for it, which removes some of the headache.

Alternatively, if you have an Intel CPU, you can utilize QSV. While not as fast as the Nvidia option, it does produce great results in general.

One advantage to the QSV approach, is there isn't anything extra to install or setup, as the Linux kernel that Ubuntu ships with automatically loads the i915 module, which provides the /dev/dri devices. All the extra Intel Media stuff is built into the Docker container.

And, as @martinpickett suggested, there's always the software encoding approach. 😄

mikaelmoutakis commented 2 years ago

Thank you very much for your reply. I appreciate the help.

Regarding your initial issue I will echo @ttyS0 by suggesting Docker.

I will try Docker then. I'm a total newbie when it comes to Docker, but you have to start somewhere. I wonder if it would be possible to package "other-transcode" as a snap or a flatpack, and include the correct version of ffmpeg and ffprobe in that package? Not that I have the skill to do that...

mikaelmoutakis commented 2 years ago

One more thing; Can I just throw some shit on NVidia? They really suck. I'm mainly a FreeBSD-user, but I have a beefy workstation running Ubuntu. The only reason is that NVidia provide the fastet OpenCL cards, and their FreeBSD driver does not support OpenCL (but the Linux one does). They really are pissing off their customers with this bullshit.