Hello dear community,
I am a really newbie with ffmpeg.
However I could figure it out, how to mux a video and a audio track together with ffmpeg.
But what I would like to do is, to manage it with the Lavcodec DXVA2.
This is possible with avidemux for example.
However the problem is, that avidemux doesnīt accept all of my 4k-movies.
And here I found an explanation, how this would be possible (see below)
However with my slight knowledge, I coudnīt figure it out, how I could implement this instruction.
I donīt know, what they mean with dxva2api.h header, a MinGW or a pacman repository
I would be really thankfull, when someboy could explain me this with easier words.
-----------------------------
DXVA2
Direct-X Video Acceleration API, developed by Microsoft (supports Windows and XBox360).
Several decoders are currently supported, in particular H.264, MPEG-2, VC-1 and WMV 3.
DXVA2 hardware acceleration only works on Windows. In order to build FFmpeg with DXVA2 support, you need to install the dxva2api.h header. For MinGW this can be done by downloading the header maintained by VLC and installing it in the include path (for example in /usr/include/).
For MinGW64, dxva2api.h is provided by default. One way to install mingw-w64 is through a pacman repository, and can be installed using one of the two following commands, depending on the architecture:
pacman -S mingw-w64-i686-gcc
pacman -S mingw-w64-x86_64-gcc
To enable DXVA2, use the --enable-dxva2 ffmpeg configure switch.
To test decoding, use the following command:
ffmpeg -hwaccel dxva2 -threads 1 -i INPUT -f null - -benchmark
+ Reply to Thread
Results 1 to 14 of 14
-
-
DXVA would only be used to decode or encode the video. If you're just muxing you don't need it and it would offer no benefit.
-
You can verify hw acceleration supported by your ffmpeg with help of:
Code:ffmpeg.exe -hwaccels
-
Thank you for your hints.
The point for me, why I would like to do the mux process with DXVA2 (not DXVA) is, that I see a difference in picture quality, when I compare libav, DXVA and DXVA2, after I have muxed the same movie.
But, with this command, you have posted me, I assume I can only verify DXVA.
But what I need is a command to verify DXVA2 -
Command was for verifying what is supported by your ffmpeg (apropos your question about flags for compiling ffmpeg) - verification is quite simple:
Code:@set filename=%1 @echo --- @echo -nohwaccel / cpu- @ffmpeg -y -hide_banner -loglevel 16 -t 300 -stats -i %filename% -f null - -benchmark @echo ... @echo -hwaccel dxva2- @ffmpeg -y -hide_banner -loglevel 16 -hwaccel dxva2 -t 300 -stats -i %filename% -f null - -benchmark @echo ... @echo -hwaccel d3d11va- @ffmpeg -y -hide_banner -loglevel 16 -hwaccel d3d11va -t 300 -stats -i %filename% -f null - -benchmark @echo ... @echo -hwaccel qsv- @ffmpeg -y -hide_banner -loglevel 16 -hwaccel qsv -t 300 -stats -i %filename% -f null - -benchmark @echo ... @echo -hwaccel opencl- @ffmpeg -y -hide_banner -loglevel 16 -hwaccel opencl -t 300 -stats -i %filename% -f null - -benchmark @echo ... @echo -hwaccel vulkan- @ffmpeg -y -hide_banner -loglevel 16 -hwaccel vulkan -t 300 -stats -i %filename% -f null - -benchmark @echo ... @echo -hwaccel cuda- @ffmpeg -y -hide_banner -loglevel 16 -hwaccel cuda -t 300 -stats -i %filename% -f null - -benchmark @echo ---
but as pointed by zing269
If you are using hwaccel this mean you decode and/or decode something - muxing is just special form of bitstream copy so if your goal is to mux then you are doing something wrong -
I have read this indeed many times, that there should be no difference.
However I have seen this difference whenever I compare videos, which are muxed with libav, or DXVA2.
And thank you pandy for your advice.
I have found this command line, to do this job.
ffmpeg -hwaccel dxva2 -i 5.m2ts -c copy 5.mkv
But I canīt really understand, which codes from you I have to use.
So if my file has the name 5.m2ts for example, and I want to mux this file with DXVA2 into mkv, how
should I do it in your opinion?
Furthermore, avidemux seems to do the same with their software.
I can see the setting with DXVA2, when I mux the m2ts file into mkv. -
Pandy's batch file is for benchmarking the various decoders, not remuxing.
If you see a difference before and after remuxing it's because of the way the player handles the different containers or different flagging of levels and color matrix. Not because the video stream has changed in any way. Using your command line compare the output of:
Code:ffmpeg -i 5.m2ts -c copy 5-dxva.mkv ffmpeg -hwaccel dxva2 -i 5.m2ts -c copy 5+dxva.mkv
Why don't you upload a short sample before and after your remux with avidemux. We'll tell you why they look different when you play them. -
Ah, I understand.
And it is really nice to hear for a change it can be possible and it isnīt a mere delusion.
Here I have for you 2 files of the same clip.
https://workupload.com/archive/8rsAAuvp
avidemux should be the file with the better quality.
I use the mediaplayerclassic to watch them and I know, for the most people the difference isnīt obvious.
But what I can recognise is, how can ich describe it, a less 3d effect.
It seems to me, that the clip, I have muxed with mkvtoonix has less contrast, compare with avidemux.
In minute 3:05 for example.
The action is more plastic, vivid, forground and background lift off more from each other by watching the avidemux file, instead of mkvtoolnix.
Isnīt it really recognizable? -
I have forgotten to say.
The HDR function should be on, otherwise the colours are a little pale and the difference isnīt evident. -
The two videos render (with tone mapping) the same here with MPCBE and VLC. I can't get MPCHC to tone map but it renders both the same (low contrast and washed out colors). I demuxed the videos to raw h.265 streams -- the two were 100 percent identical up to the point where one ended (one is a little longer than the other).
How are you comparing the two videos? Two instances of the same media player side by side? Be careful with that -- the same player playing the same video can look different when used that way (especially on older computers) because one may get hardware decoding and display, the other software. Two different media players? Different players may use different tone mapping -- so that could account for differences.
In post #7 you appear to be remuxing from m2ts to mkv. But you uploaded two mkv files for comparison.
Are you really using Media Player Classic? Last updated in 2010?
VLC playing the two videos (display reduced to 50 percent so the images fit on screen):
[Attachment 62449 - Click to enlarge]
[Attachment 62450 - Click to enlarge] -
My dear friend,
I am indeed overwhelmed about your efforts.
I uploaded two muxed videos, for which I have used two different softwares, because my own problem was, that I could see this slight quality difference, whenever I have compared them with each other.
I have always compared them with this mpc-player, not at the same time, but one after another.
However, it is strange. Now, it seems to be the first time (after years), that I canīt recognise a difference any more, when I compare these two videos I have given to you for example.
But I have to say, I played a bit with many pc settings.
So, it could be, but I havenīt a clue which one this could be, this changed it to the better.
Another idea I could have for this change.
Your friendly ear could help me coming out of my own illusion.
For any reason, you helped me out with your professional expertise and huge friendliness.
And for this I am very very thankful.
However, maybe you could help me out with another little question.
Do you know a command line, which I have to write into ffmpeg, when I want to convert one audio track,
into a dts track with the following parameters?
Codec: DTS
Samplerate: 48000
Channels: 5.1
Rate: 1508
Bits/sample: 24
Volume: 6db
Furthermore I would need a second command line, with which I can convert an audio track
into the same dts track with the same parameters, within a movie, without I have to extract
the audio beforehand. -
The basic command for encoding DTS would be something like:
Code:ffmpeg -i input.ac3 -strict -2 -c:a dts output.dts
This post from Pandy contains some audio filtering and dts encoding:
https://forum.videohelp.com/threads/386092-Encoding-audio-in-DTS-in-multi-channels-wit...eg#post2563701 -
Thank you very much.
In this case, I will try my luck with a new thread.
However this thread, you have shown me could already give me some very importent hints.
Similar Threads
-
ffmpeg - output metadata, add/remove modification then add it to the video
By kalemvar1 in forum Video ConversionReplies: 3Last Post: 30th Jul 2021, 01:29 -
how do i add libx264 and hevc to ffmpeg when i compile ffmpeg for ubuntu 21
By oduodui in forum Newbie / General discussionsReplies: 2Last Post: 17th Jul 2021, 04:12 -
how to re-add original audio delay back into a 2-inputfile ffmpeg transcode
By hydra3333 in forum Newbie / General discussionsReplies: 0Last Post: 30th Jul 2020, 01:30 -
converted video by ffmpeg, plays video and audio,but audio overtakes
By jraju in forum Newbie / General discussionsReplies: 1Last Post: 5th Dec 2019, 00:59 -
How to add a time stamp below of a screen capture from a video in ffmpeg?
By Chemist116 in forum Newbie / General discussionsReplies: 11Last Post: 2nd Jun 2017, 15:08