MLV-App
MLV-App copied to clipboard
AVFoundation h.265 export
I just remembered how the AVFoundation library has h265... maybe we could compile a version on a new macOS machine with that enabled? - can there be a macro like IF MACOS VERSION > 10.11 or something?
I remembver @masc4ii commented it out due to not compiling on old macs.
I think we could a macOS download for new one and the older one?
Also seems like dark mode would be supported this way
Could you have a try? Commited... but I am on 10.9 here, so I don't see what happens.
Thanks, but I have lost my wireless mouse so my iMac is useless, can't test today :cry:
Will be able to soon hopefully. Maybe @dannephoto can try?
On vacay atm but will try and see if I can get some time to look into this.
h.265 working nicely on 10.14!
Compressor Name : Lavc57.89.100 libx265
Just tested, short export- Nice, nice!
7 second clip. 897kb! Crazy good compression: https://bitbucket.org/Dannephoto/magic-lantern/downloads/h265.mov
Also: https://www.magiclantern.fm/forum/index.php?topic=20025.msg213777#msg213777
Question. What is the h265 setting used? https://trac.ffmpeg.org/wiki/Encode/H.265
We could find sweet spot and get highest quality output. Seems now it is set to lowest? Auto mode? Maybe two options, high quality(lower compression) and auto quality(higher compression)
edit: checking code. AVfoundation preset? One filesize only? Well, let´s just keep it as is then. Good web format.
The "new" h.265 added here is AVFoundation, the ffmpeg h.265 presets were added longtime ago. AVFoundation works on MAC only, and you need XCode for 10.13+. That's why I can't test what Ilia and I implemented. Select it with the options comboBox.
The ffmpeg setting used is ...-c:v libx265 -preset medium -crf 24...
Do not know about Apple but ffmpeg uses open source x265 code and it is far the best encoder for h265 at the moment.
We are using constant rate factor and 24 is the good bet. Can be lowered for even better result.
Aha, good, can tweak and test. I also tested h264 encoder and it seems we have more headroom here as well. When set correctly this encoder yields as good if not better end viewing results as prores. I found some good output setting that is used for smooth alisasing filter. Maybe use that one.
EDIT:
Guys. We absolutely get super results with:
libx265 -preset medium -crf 10
Could this be set as default instead?
While checking this one might as well be changed:
libx264 -preset medium -crf 10
EDIT: For some shitty reason I can only preview fisrt frames with h265 encoder set to libx265 -preset medium -crf 10. Then freeze. Sigh. more testing. Looks super though.
h264 works marvellous with libx264 -preset medium -crf 10.
libx265 -preset medium -crf 14 works, go figure!
Conclusion:
libx264 -preset medium -crf 10
libx265 -preset medium -crf 14
Both are goooood!
Ok, realize I was testing ffmpeg h265 preset along with ffmpeg h264 preset above. The refined settings are valid(and imo needed) to get high quality output with ffmpeg h264 and h265 options.
About avfoundation h265 codec I can´t seem to find it so I don´t think it was compiled or I am doing something wrong. I work in Mojave 10.14 here so op should work. First. Where do I find "comboBox" :)?
It should look like this:
But you only see it, if you use a Apple SDK since 10.13. In compiler output you should find, which SDK is used. Here, I see this:
.../usr/local/opt/llvm/bin/clang++ -headerpad_max_install_names -stdlib=libc++ -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk...
--> to old.
I suspected this. Will look into it but every time I fiddle around with sdk versions it's like starting a nuclear melt down...
Tried out your ffmpeg setting... h265 shows the first two images only... I think my laptop is too old for such games 😄
Tried playing back Danne’s H.265 on 10.14 which wouldn’t play back because QT isn’t supported. Hmm?
Sent from my iPhone XR
On Mar 22, 2019, at 11:11 AM, masc4ii [email protected] wrote:
Tried out your ffmpeg setting... h265 shows the first two images only... I think my laptop is too old for such games 😄
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Hehe... yepp... Quicktime doesn't support this, same problem here. VLC is able to playback (if machine is fast enough).
What setting was applied crf 14? I think crf 18 is usable but after this shadows will break too much for both codecs @masc.
Yepp. Okay. h265 @crf18 works. h264 @crf14 works too. Will commit.
Hm, getting this when compiling:
Project WARNING: Qt has only been tested with version 10.13 of the platform SDK, you're using 10.14.1.
Project WARNING: This is an unsupported configuration. You may experience build issues, and by using
Project WARNING: the 10.14.1 SDK you are opting in to new features that Qt has not been prepared for.
Project WARNING: Please downgrade the SDK you use to build your app to version 10.13, or configure
Project WARNING: with CONFIG+=sdk_no_version_check when running qmake to silence this warning.
ANd seeing this:
/usr/local/opt/llvm/bin/clang -c -pipe -fopenmp -O2 -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk
Well, good luck on downgrading, sigh...
Ups... no fun. 😢 Sorry. But good to know.
I tested by copying from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
into /Library/Developer/CommandLineTools/SDKs/
and got 10.13 in there and it compiles without errors now. But no extra h265 setting in the roll down menu, hmmmm
Strange. Unfortunately I can't test myself. But I thought that #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
works for this. You cleaned all the project before comiling, I think...
Seems I can comment out:
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
if( index == CODEC_H265 )
{
ui->comboBoxOption->addItem( QString( "Apple AVFoundation" ) );
}
#endif
Into:
ui->comboBoxOption->addItem( QString( "Apple AVFoundation" ) );
And it gets me the AV foundation in the combobox. It exports only to mkv but seems to work. Unclear...
So somthing not wirking with #if #endif?
I don't know if you get what you think you get. This line exists very often in other code files too. Maybe you get an ffmpeg file. MKV don't sounds like AVFoundation.
yeah, most likely ffmpeg file. Seems to be same size when comparing to ffmpeg so it´s not getting the av foundation stuff...
Hey guys!
x265 constant rate lower than 18 is real overkill. This produces huge files with very small almost unnoticeable improvement in quality (bitrate is higher and decoder straggles on lowend CPUs). I really needed to have this option for quick preview clips or for sharing purpose so 18 is the lowest for that matter. Otherwise I would export prores.
@masc: if we really need to go lower than 18, let's make option for selecting the quality. Edit: I think the text field to insert directly rate factor will be the easiest solution. Saving the value into program settings. With default 20.
It is at 18 now. If lower I can't playback the files... 😄
I think the text field to insert directly rate factor will be the easiest solution. Saving the value into program settings. With default 20.
Well both h264 and h265 are possible end formats meaning they could end up being used for high quality viewing purposes or as mentioned by bouncyball for fast previewing(low quality). Both should be available if possible.
I think there can be two settings for each code: websized highqual Or something similar. No need for manual bitrate selection imo.
What settings number for websized do you recommend?
Or something similar. No need for manual bitrate selection imo.
This is not a bitrate, it's rate (can be interpreted as quality) factor and IS extremely straight forward.
Range is between 0-51. 0 - lossless, 51 - worst quality. The sane range is 18-28.
I think the dumbest user can use this approach without issues :grin:
Edit: can be implemented as quality slider IMO.