Ffmpeg works really well for transcoding and you can give it options as to the format to use. I simply allowed it to do the default ffmpeg -i file.MOV file.mkv and it used h264 as the output. Very easy though to select different if desired.
I will note that it read the input very slowly ( ~ 0.1 to 0.3 x) rate while working.
Hmmm… well it might be that the “best” solution is boot in to Win 10 (which plays those hevc files fluidly), then use either ffmpeg or the transcode function of DaVinci Resolve to transcode them, and then boot back in to Fedora once they have all been transcoded.
That would seem counter-productive to me.
Using ffmpeg in linux with a script could handle it seamlessly instead of moving things back and forth. A simple script could set things up for your preferences then the coding could happen in the background while doing other things.
Flow could be download → process → listen/watch the result.
Q1 No they do not. Command 1 copys only with change of container from mkv to mp4 format.
Command 2 allows ffmpeg to select a default codec to transcode and may or may not actually change the encoding.
The file named P1460938.mkv with size 7848128
was converted to P1460938b.mp4 with size 7857700 using command 1
and converted to P1460938a.mp4 with size 7339654 using command 2.
As you can see by the size alone the commands do not do the same thing.
I usually am going from mp4 to mkv so had not previously tested the output from command 2 and almost never use command 1.
Q2. The user makes the choice depending upon preferences.
You can easily make these tests yourself to decide which is better for your needs.
Just to add to this.
The original MOV file is more than 20 times the size of the mkv (or mp4) file.
-rw-rw-r--. 1 USER USER 7848128 Jul 20 11:36 P1460938.mkv
-rw-rw-r--. 1 USER USER 183154840 Jul 20 09:39 P1460938.MOV
-rw-rw-r--. 1 USER USER 7884793 Jul 20 14:20 P1460938.mp4
I downloaded the file you linked with wget. Don’t know how you did it, but seems strange yours would be twice the size if we actually got the same file.
In fact I just downloaded it again in case there was something wrong on my end and it was exactly the same size. 183154840 bytes.
The video is encoded with HEVC, 10-bit color, 4k@59.94fps, so it’s pretty taxing to most CPUs. For example, my Intel i5-1145G7 CPU can’t play it smoothly, but the built-in Intel Iris Xe GPU can (via VA-API hardware acceleration). I’d say it should be expected for this particular video doesn’t play smoothly without hardware accelerated decoding. For nVidia GPU, try mpv --hwdec=nvdec. On Intel (and AMD), use mpv --hwdec=vaapi.
First, Thank you for the reply. It looks like you are correct. There needs to be some hardware acceleration for it to play.
I tried playing the file on Windows with task manager monitoring GPU useage and indeed, video decode jumps to 70% for my RTX 2060 when I simply play the video file with the built-in Windows Movie and TV App.
So yes, in windows the GPU is handling the decoding.
Now, can you tell me HOW I would try mpv --hwdec=nvdec?
I am not sure if it is a driver, or a library? Is it a line of text I put in a configuration file somewhere?
How do you launch mpv? From an icon in the activities menu or from the cli?
If on the cli then simply add what is noted above to your command.
If using the icon then it is likely the actual command is in the file /usr/share/applications/mpv.desktop.
If you copy that file to your local desktop (~/Desktop) then edit it similar to this it should work. There are 2 lines in that file I would modify.
First the Name which probably reads Name=mpv Media Player and should be changed so you know this is the one you are selecting when you hover the mouse over the icon. Maybe to something like this Name=mpv Media Player HW accel (or whatever you wish). The file name can be changed as well if you wish.
Then you would need to modify the Exec line from the default to add your option. The modified line would read Exec=mpv --player-operation-mode=pseudo-gui --hwdec-nvdec -- %U
I do not recommend altering the original file under /usr/share since that was installed by the app and would be removed when the app is uninstalled.
Hmmm… I am not sure what that means. Since there don’t seem to be any “desktop icons” in Gnome, do you mean if using the launcher (super Key → M → then click mpv which is how I might launch it)?
To be honest, I normally use the contextual menu by right-clicking the video file, then using the “Open with Other Application” dropdown to chose the app.
I guess my main question though is:
Can I set ALL the video applications to use the option --hwdec-nvdec any time they launch globally?
The .desktop file is the what integrates with the launcher (desktop environment). It provides the command to run and the icon representing the program etc…
For mpv it is mpv.desktop.
you can copy that file to ~/.local/share/applications, open it with your editor of choice and modify the exec line as @computersavvy described.
I would also suggest adding gnome-session-inhibit so you don’t get bit by screenblanking. That looks like: Exec=gnome-session-inhibit mpv --player-operation-mode=pseudo-gui -- %U
mpv also uses a configuration file located in ~/.config/mpv/mpv.conf`
The configuration file for your setup would look like :
vo=gpu
hwdec=nvdec
If you have multiple users on the machine and would like to do either of these for all users.
After you get the configuration file working for your user you can copy it to /etc/mpv/
for the desktop file you would want to copy it to /usr/local/share/applications/
If you want to use mpv, i’d strongly suggest checking out, mpv.io
Along those same lines there is another player called celluloid which is more or less a gtk front end for mpv. This can be setup using an mpv config file or just by adding the mpv options to: → Preferences → Miscellaneous → Extra MPV Options
I did find that this stuttered a bit when opening the file but would play smooth the second time.
The above covers mpv, for VLC under input/Codecs there should be a selection for Hardware accelerated decoding. I think it defaults to automatic, you may want to try swapping to VDPAU and seeing how that works.
Thank you very much for the detailed reply. You have given me a lot to digest here (I am still relatively new to “tinkering” in Linux, despite the fact that I have been using Linux Mint on several computers for years now.)
I will post updates (hopefully) later today, but I am out at work most of the day. I just don’t want you to feel like you took the time to write out how to do something and it got ignored.