Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Ability to Import, Edit, and Export HDR,HDR10+,HDR12,or HDR enhanced Videos #151

Open
ferdnyc opened this issue Jul 28, 2018 · 1 comment

Comments

@ferdnyc
Copy link
Contributor

ferdnyc commented Jul 28, 2018

(This suggestion is copied from OpenShot/openshot-qt issue #1921, a suggestion by user @Corruptinator. I've tried to reapply the original formatting as much as possible, apologies if I missed any.)

Is your feature request related to a problem? Please describe.
Lately I noticed that some online video services such as Youtube and Vimeo supports HDR for video uploads. Openshot currently edits SDR videos and that there is potential to implementing HDR editing capabilities.

Describe the solution you'd like
I was wondering if it's possible for Openshot can become capable of importing and editing SDR Videos or HDR videos that can either undergo: A. SDR-to-HDR conversion edit process, or B. HDR color correction. Then afterwards they can be exported to format compatable video files such as MP4 (h264), MOV (Quicktime), HEVC(h265), or Matroska (MKV).

Also to make Openshot capable of editing HDR, a few things should be considered. The viewport should be updated to be able to see HDR videos though a different compatable colorspace (e.g. rec. 2020) and or different modification to allow any monitor to see the actual HDR footage updated and or edited,

I'm sure there are also other details I'm missing but I figure I point out what would be a neat additional feature that Openshot could support. This could allow a lot of video editors to benefit editing videos in HDR.

Describe alternatives you've considered
I've been messing around with FFMPEG and found out through trials of Hit and Miss process of finding out on how to reexport and or render videos into HDR, this also works for original videos that were originally SDR, but can be converted into HDR through FFMPEG. Though the result isn't true HDR, instead this is more of a Pseudo HDR technique.

Additional context
If by any chance anybody wants to see what I've experimented in FFMPEG, just in case you might need additional information or ideas on how HDR encoding could possibly work in Openshot:

This is for rendering HDR to h264:
ffmpeg -i render1.mkv -c:v libx264 -preset ultrafast -crf 5 -pix_fmt yuv420p10le -x264-params "colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(40000000,400):max-cll=1000,400" final.mkv

For HEVC(h265): [More ideal for storage conversion, but takes more time and processing for encoding]
ffmpeg -i untitledAalt.mkv -c:v libx265 -tag:v hvc1 -preset ultrafast -crf 5 -pix_fmt yuv420p10le -x265-params "colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(40000000,400):max-cll=1000,400" HEVC_final.mkv

Note:
yuv420p10le is the pixel format used for HDR at 10-bit, there are others that could work but not certain which is used for HDR 12-bit or 14-bit.

in the "-x265-params" or "-x264-params" area, the following are implemented to enable HDR and viewable on an HDR compatable monitor or television:
colorprim=bt2020
transfer=smpte2084
colormatrix=bt2020nc
master-display=G(x,y)B(x,y)R(x,y)WP(x,y)L(max,min)
max-cll=1000,400

There is more info to each part through this link: https://ffmpeg.org/pipermail/ffmpeg-user/2016-December/034649.html

I would love to create HDR videos not only for editing purposes but just for the fun and learning process.

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Jul 28, 2018

(My reply:)

@Corruptinator — Thanks much for both the excellent suggestion, and the detailed technical information that accompanies it. It's certainly something that would be interesting to explore.

One of the major barriers to this, at the moment, would probably be the fact that our libopenshot library only officially supports up to FFMpeg 3.2. (It builds against 3.4 as well, and can be patched to compile with 3.5 / 4.0, updating the code that's no longer compatible, but AIUI libopenshot doesn't make use of any of the features from versions newer than 3.2. In fact, FFmpeg 3.2 support was only added in late March of this year.) But it sounds like, from reading the messages in that very informative email thread you linked to, that some of the features being used were pretty bleeding-edge FFMpeg even at the time (which, in December 2016, would've meant the upcoming first release of the FFMpeg 3.2 series, on 2017-01-24).

I also notice that Andy Furniss noted1, "Your libx265 will need to be compiled for 10bit encoding." Presumably that's true of libx264 as well, when encoding to HDR. We'd have to check the status of the library/libraries distributed with various builds of OpenShot. Our AppImage builds currently distribute with FFMpeg 1.x, and no x265 support at all, which will be a difficulty at least on Linux. Generally our x265 support is fairly poor right now, AIUI, so even getting that sorted out may be a necessary first step to enabling 10-bit color support.

What all this boils down to is, I think it's a great suggestion, and I agree it would be an interesting capability for OpenShot. I think there are significant things that would need to happen within both libopenshot and OpenShot itself, to make that happen, but they're not an impossibility especially if one of the core libopenshot developers decided to pick up the feature and run with it.

Because I suspect that this would first need to be sorted out in libopenshot, before we could even think about adding the necessary support to OpenShot itself, I'm going to take the liberty of passing your suggestion over to that project as well, so that both sides of the equation will be able to consider/address it.

Notes

  1. I noticed a link, in the footer of one of those messages, that provides a view of the entire conversation thread, especially helpful since it spans more than one month of the mailing list archives. My link above to Andy Furniss' comments actually leads to his message in that thread view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant