Page 1 of 2

BRAW Player for Win

PostPosted: Tue Jun 04, 2019 9:12 am
by Hendrik Proosa
After some downtime I discovered I don't have that much time to improve my little braw player project right now so I put up current version for everyone to try. Maybe it is useful for someone, if not for something else then for quick viewing of braw files and their metadata.

Find the install folder .zip here: http://www.kalderafx.com/vfx/brawplayer/

There is a small readme.txt file too, read it to get an overview of what works and what not. If you find a bug (that is not already in readme) or it doesn't work at all, post problem description here.

A bit old video (UI has changed a bit) but shows basic usage of player:


PS. In case someone wants to chat privately about the app or feels like buying me a beer in Paypal, my email is hendrik [at] kalderafx.com

Re: BRAW Player for Win

PostPosted: Tue Jun 04, 2019 10:11 am
by Hendrik Proosa
Some more information about it (also in readme).

Current version is built against BRAW SDK version 1.3, meaning it should be able to decode newer files also. Currently only CPU decode works, but player automatically changes decoding resolution behind the scenes if viewer size is smaller, so to get faster playback just resize the window. It is also possible to manually set decode resolution using combobox in UI.

INSTALLATION
Just run the application executable. For loading files, File->Open or drag-drop to application window.

USAGE
Play the file and fiddle with settings. If knob is active, values can be changed by scrolling mouse button. To reset a setting, right click on slider.

Press M for metadata overlay, it displays all meta read from file, including dynamically changing meta.
Press D for debug data, it doesn't show much useful though.
Press G for gamut plot. Not useful, also wrong with any other gamut-gamma than linear XYZ.
Press V to toggle through viewer modes: full data, minimal player, video only. Has some layout issues.
Press T to show timecode in playhead TC knob. Might be wrong, check metadata, there is correct tc for frame.

Use mouse scroll button for zooming and left button for panning the viewer. Double-click left button to reset view.

Viewer gain and gamma affect the final decoded image. Decoding precision affects decoder output data format, it is clear that decoder outputs unclipped data in float mode and clipped data in int mode. Viewer LUT combo is just a test, doesn't do anything right.

WHAT WORKS
It opens and plays braw files :D Most of development settings should work, also dynamic data from sidecar files (change "Update from sidecar" to "on every frame" for dynamic data). Dynamic data means that exposure, iso etc (not all, but some properties) can be animated in sidecar. There is little documentation about this feature, bang on BMD-s door for better docs.

WHAT DOES NOT WORK
No audio. No GPU decode (settings are there in decoder device combo but not effective). Might crash randomly. Might do something else wrong. Export of trimmed braw or sidecar do not work yet.

KNOWN BUGS
Drag-drop something else than .braw will crash.
Timecode value shown in knob is sometimes wrong.
Gamut plot is incorrect for anything but linear XYZ.
GPU decode not working.

OTHER STUFF
For customization of UI appearance, fiddle with stylesheet.txt file in application dir.

Re: BRAW Player for Win

PostPosted: Tue Jun 04, 2019 10:23 am
by Hendrik Proosa
Example of how to use dynamically changing development settings in sidecar file. To get it update in player, set "Update from sidecar" combo (in player settings group) to "On every frame":
Code: Select all
{
    "tone_curve_contrast": 1.500000,
   "tone_curve_saturation": 1.600000,
   "tone_curve_midpoint": 0.300000,
   "tone_curve_highlights": 0.650000,
   "tone_curve_shadows": 2.000000,
    "tone_curve_video_black_level": 1,
   "viewing_gamma": "Blackmagic Design Custom",
   "viewing_gamut": "Blackmagic Design",
   "viewing_bmdgen": 4,
   "exposure": {
        "12:01:40:04": 0.400000,
        "12:01:41:04": 0.600000,
        "12:01:42:04": 0.800000,
        "12:01:43:04": 1.000000,
        "12:01:44:04": 1.200000
   },
   "white_balance_kelvin": {
      "12:01:40:04": 4000,
        "12:01:41:04": 4500,
        "12:01:42:04": 5000,
        "12:01:43:04": 5500
   },
   "white_balance_tint": {
      "12:01:40:04": -20
   },
   "iso": {
      "12:01:40:04": 800
   }
}

Re: BRAW Player for Win

PostPosted: Wed Jun 19, 2019 5:50 pm
by Hendrik Proosa
I just found out that there might be some additional metadata in braw file that is retrievable on frame level. I'll try to make new version soon and add that also.

Re: BRAW Player for Win

PostPosted: Mon Jun 24, 2019 8:17 pm
by Cameron Porter
This is a LIFESAVER. Thank you so much!

Re: BRAW Player for Win

PostPosted: Mon Jun 24, 2019 9:33 pm
by Cameron Porter
One of our machines has an AMD graphics card, and when we try to launch we get an error that says nvcuda.dll is missing and it won't launch. We tried just dropping in the dll into the sys32 folder, but now it just says it failed to launch.

Anything obvious I'm missing? Thanks!

Re: BRAW Player for Win

PostPosted: Tue Jun 25, 2019 12:01 pm
by Hendrik Proosa
Cameron Porter wrote:One of our machines has an AMD graphics card, and when we try to launch we get an error that says nvcuda.dll is missing and it won't launch. We tried just dropping in the dll into the sys32 folder, but now it just says it failed to launch.

Anything obvious I'm missing? Thanks!

I put up new version (find it from same link in first post), try that, hopefully it fixes the error. Some rudimentary GPU compute probing that was happening might have triggered the message.

Whats new in current version:
- Fixed direct .braw file opening bug, now player can be set as default application for loading .braw files;
- Frame level metadata now available;
- Fragment and vertex shaders fully exposed for viewer OpenGL widget, see shaders/ subdir;
- Removed some cuda probing code that might trigger missing cuda lib error with AMD cards (not tested if works though)

Simple path messup bug prevented opening files directly through os by setting player as default application. Fixed the loading and also problems with stylesheet and icons. It should now work as expected.

Frame level metadata exposes some stuff not visible on clip level, mainly frame-processing attributes and also some lens and cam information (aperture, internal_nd, distance, shutter_value etc).

Regarding shaders, as viewer surface is drawn with opengl, user can now use fragment shader to do any image processing one wishes, for example apply custom color transforms and whatnot. Just code them in fragment shader and fire away!

Re: BRAW Player for Win

PostPosted: Tue Jun 25, 2019 11:35 pm
by Cameron Porter
Thanks again, sir! We'll test it and report the results.

Re: BRAW Player for Win

PostPosted: Tue Jun 25, 2019 11:58 pm
by Cameron Porter
Working great! Thanks again!

Re: BRAW Player for Win

PostPosted: Wed Jun 26, 2019 6:24 am
by Hendrik Proosa
Cameron Porter wrote:Working great! Thanks again!

It works on that machine with AMD card also? Strange that it didn't work before though, I used sdk methods from example code for detecting if cuda pipeline processing is possible, this shouldn't need to use cuda itself...

Re: BRAW Player for Win

PostPosted: Thu Jun 27, 2019 1:44 pm
by Hendrik Proosa
Fiddled a bit with viewer shader stuff and made a few new frag shader examples. New version is uploaded and can be found under link in first post (download the latest updated from ftp folder).

And I also made a small demo video where I outline basic functionality and also some more obscure stuff like dynamic metadata in sidecar file and viewer opengl fragment shaders:

Re: BRAW Player for Win

PostPosted: Fri Jun 28, 2019 9:47 am
by Hendrik Proosa
In case someone is wondering what custom viewer shaders could be useful for, here is a small example. In about ten minutes I wrote a shader for displaying rgb parade overlay:
CropperCapture[306].jpg
CropperCapture[306].jpg (438.23 KiB) Viewed 31997 times


And shader code for anyone interested to try. It contains new uniform value "decoderesolution" which is available in new version uploaded today.
Code: Select all
#version 150 core
uniform sampler2D tex;
uniform vec2 resolution;
uniform vec2 decoderesolution;
uniform float exposure;
uniform float gamma;
uniform int bitdepth;
uniform int lut;
uniform float lutweight;
in vec2 fragTexCoord;

vec4 applyViewerGrade(vec4 basecolor)
{
    vec4 color = basecolor;
   
    // General exposure and gamma adjustments
    color = color * pow(2, exposure);
    color.r = pow(color.r, gamma);
    color.g = pow(color.g, gamma);
    color.b = pow(color.b, gamma);
   
    return color;
}

void main(void)
{
    vec4 color = texture2D(tex, fragTexCoord);
    vec4 finalcolor = color;
   
    float numSteps = decoderesolution.y;
    float stepSize = 1.0 / numSteps;
    for (int y = 0; y < numSteps; y++)
    {
        vec2 uv = vec2(fragTexCoord.x, stepSize * y);
        vec4 sc = texture2D(tex, uv);
        float box = floor((1.0 - fragTexCoord.y) * numSteps) / numSteps;
        if ((floor(sc.r * numSteps) / numSteps) == box)
            finalcolor.r = 1.0;
        if ((floor(sc.g * numSteps) / numSteps) == box)
            finalcolor.g = 1.0;
        if ((floor(sc.b * numSteps) / numSteps) == box)
            finalcolor.b = 1.0;
    }

    // Apply weighting and viewer grade
    gl_FragColor = mix(applyViewerGrade(color), applyViewerGrade(finalcolor), lutweight);
};

Re: BRAW Player for Win

PostPosted: Fri Jun 28, 2019 3:24 pm
by deezid
Works perfectly fine on Linux too, using Cuda!
Even in fullscreen.

Set it as default player for Braw, Drag and Drop works as well.

Great work!


Edit:
Is .cube LUT support possible?

Edit2: With the parade turned on it stutters on my machine. Seems to have a strong level of detail - maybe too much :D

Re: BRAW Player for Win

PostPosted: Fri Jun 28, 2019 4:46 pm
by Li Chenghan
I don't see the preview and sound on my computer

Re: BRAW Player for Win

PostPosted: Sat Jun 29, 2019 6:32 am
by Hendrik Proosa
deezid wrote:Works perfectly fine on Linux too, using Cuda!
Even in fullscreen.

Set it as default player for Braw, Drag and Drop works as well.

Great work!

Edit:
Is .cube LUT support possible?

Edit2: With the parade turned on it stutters on my machine. Seems to have a strong level of detail - maybe too much :D

I wonder how you run win executable on linux? Cuda decode does nothing, it falls back to cpu.
.cube luts not currently supported, it takes a bit of fiddling to get them working
You can change the parade quantization in shader, see the line where 'decoderesolution' uniform is used and change that value. Something like 100 will give you an idea what it does:
Code: Select all
float numSteps = 100.0;


Li Chenghan wrote:I don't see the preview and sound on my computer

There is no audio decode. What do you mean by preview?

Re: BRAW Player for Win

PostPosted: Sun Jun 30, 2019 3:43 pm
by deezid
[quote="Hendrik Proosa]
I wonder how you run win executable on linux? Cuda decode does nothing, it falls back to cpu.
.cube luts not currently supported, it takes a bit of fiddling to get them working
You can change the parade quantization in shader, see the line where 'decoderesolution' uniform is used and change that value. Something like 100 will give you an idea what it does:
Code: Select all
float numSteps = 100.0;
[/quote]

Noticed that Cuda didn't do anything, same speed with CPU and Cuda set.
Running the exe file with Wine and there are no problems to report. It's really fast as well.

The shader code works. Less resolution means faster speeds ;)

Re: BRAW Player for Win

PostPosted: Sun Jun 30, 2019 4:56 pm
by Hendrik Proosa
Nice to hear it can also play in Linux!

About that parade, as is apparent from shader code, it samples a number of pixels in the same column as output pixel is and that line changed the step size of sampling. In original code it was every decoded line, when it is set lower loop runs faster thus making shader faster. But downside is that not all pixels are sampled anymore. In current code sampling and value binning were also tied, so with lower values, parade columns also got more "boxy".

Re: BRAW Player for Win

PostPosted: Thu Jul 04, 2019 2:00 pm
by Hendrik Proosa
WHATS NEW in v0.3.0 (released 190704)
Rudimentary audio playback. There are buffering issues which must be sorted (audio is choppy and cracking) but speech is audible and thus somewhat usable. Audio plays during scrubbing too and conforms to framerate changes (plays slower or faster).

Removed notification about BMD Custom and development settings, it messed up the layout.

---------------------------------------------------------------------------

Other plans:
I want to add RGBA channel toggles but I must use internal draw buffer for this to run another pass through additional viewer shader and it will take some fiddling.

Viewer should ideally zoom to mouse cursor position (currently zoom is from center of image which is annoying), takes some math gymnastics but should be easy to achieve.

GPU decode... been planning this for some time now, must do.

Re: BRAW Player for Win

PostPosted: Wed Sep 11, 2019 2:32 am
by Ben Slavens
Hi! Great software. The player is much more feature-rich than Blackmagic's own BRaw Player for Windows. Any plans to keep developing it?

Re: BRAW Player for Win

PostPosted: Thu Sep 12, 2019 8:20 am
by Hendrik Proosa
Ben Slavens wrote:Hi! Great software. The player is much more feature-rich than Blackmagic's own BRaw Player for Windows. Any plans to keep developing it?

Thank you, nice to hear you like it!

I'm beginning a massive project and unfortunately don't have much spare time, but I'll try to squeeze a few hours in for SDK update some time between today and never 8-)

Re: BRAW Player for Win

PostPosted: Sat Nov 02, 2019 9:53 am
by Andhropa
Hi Hendrik,

Using your great software to watch recently shot footage. Thanks for the rudimentary audio, it is footage of a music recording, so this helps a lot in navigating through many files.

Any chances of the I/O functionality being added in the future? Running Win 7, so i can't install resolve yet :?

At least for now, i can watch and listen to the footage, thanks to you!

Re: BRAW Player for Win

PostPosted: Mon Nov 11, 2019 9:13 pm
by Hendrik Proosa
Andhropa wrote:Hi Hendrik,

Using your great software to watch recently shot footage. Thanks for the rudimentary audio, it is footage of a music recording, so this helps a lot in navigating through many files.

Any chances of the I/O functionality being added in the future? Running Win 7, so i can't install resolve yet :?

At least for now, i can watch and listen to the footage, thanks to you!

Thank you for kind words, nice to hear you find it useful. Can you describe what you mean by I/O functionality? Transcoding to some other format?

Re: BRAW Player for Win

PostPosted: Mon Nov 11, 2019 10:52 pm
by antoine
Congratulations on your BRAW Player Hendrik and thanks for your work !

Re: BRAW Player for Win

PostPosted: Mon Nov 18, 2019 4:47 pm
by Michael Kropfberger
would be great to try out brawplayer_v190604, but fails with "nvcuda.dll"
I have the BRAW SDK 1.5.2 installed, using a Radeon VII GPU.

Re: BRAW Player for Win

PostPosted: Mon Nov 18, 2019 5:50 pm
by Hendrik Proosa
Version format is YYMMDD so last version currently is 190704.

Re: BRAW Player for Win

PostPosted: Mon Nov 18, 2019 6:02 pm
by Michael Kropfberger
me = stupid


works, great!

Re: BRAW Player for Win

PostPosted: Wed Jun 17, 2020 3:17 pm
by Hendrik Proosa
First update to BRAW SDK version 1.7 is up, I created new page for releases, which can be found here:
https://gitlab.com/hendrikproosa/braw-player-public/-/releases

Current version for Windows only, as before, but I'll see if I can produce one for Linux too.

This is the base upgrade version, with some features not working (audio, was crappy before anyway) and might crash. Upside is that up do date SDK should be able to decode all .braw files.

Re: BRAW Player for Win

PostPosted: Thu Jun 18, 2020 1:20 pm
by Hendrik Proosa
Got into small vibe again, since timeline IO marking is there, braw trimming is imminent 8-)
brawplayer_timelineIO.jpg
brawplayer_timelineIO.jpg (31.51 KiB) Viewed 23228 times


Next version will also have restored (but still crappy) audio, zoom to mouse cursor and other convenience functions.

Re: BRAW Player for Win

PostPosted: Tue Jun 23, 2020 2:41 pm
by jd_becker
Very promising project. With improved stability and performance i would love to use it in the future :).
Some stuff I noticed: I don't get the correct playback speed with my 29.97 material. When I set the FPS to 50 it looks and sounds about right. Also, the 'Edit' 'View' and 'Help' don't do anything. Also, when I press escape the viewer and the controls disappear and the program crashes as I try to load a new file. What is supposed to happen here?

Some stuff I would love to see in the future:
  • Possibility to listen to the different embedded audio channels (a feature desperately missing from the Resolve Media Page as well).
  • Resolve style keyboard commands, especially JKL for playback (why don't more/all media players have this?) and Z to zoom viewer to fit.

Re: BRAW Player for Win

PostPosted: Wed Jun 24, 2020 4:55 pm
by Hendrik Proosa
Hi, thanks for feedback. The playback engine is currently a bit bonkers and doesn't play as it should (I have issues with timer and asynchronous decode mechanism), I must rewrite some stuff there. Menus are placeholders, there is nothing there yet. Pressing esc shouldn't actually do anything, crash is a bug reminescent from some faulty code, I will remove the key binding.

Resolve keyboard commands is a good idea, I'll add it. Z for fit also, but you can currently do fit by double-clicking with left mouse button too.

Re: BRAW Player for Win

PostPosted: Fri Jul 10, 2020 10:28 am
by Hendrik Proosa
A quick overview of new version I'm prepping and will upload soon, these things are already added and working:
- braw trimming, both from UI and from command line 8-)
- frame caching to RAM for faster playback;
- zoom to mouse cursor location in viewer;
- improvements to keyboard shortcuts;

GPU decode and audio are again lingering, this stuff makes my head hurt a bit, but RAM caching should remedy playback speed problems.

Some simpler stuff in waiting list or in progress:
- zoom timeline ruler (to best see the stuff when frame range is long);
- export sidecar file with current processing settings;
- selectable-copyable metadata viewer;
- export metadata to file;
- viewer shaders mechanism overhaul.

Re: BRAW Player for Win

PostPosted: Wed Jul 15, 2020 10:48 am
by Hendrik Proosa
Bells and whistles! New version v0.5.0 is up and can be found from Releases page in Braw Player public repository: https://gitlab.com/hendrikproosa/braw-player-public

WHATS NEW in v0.5.0
--------------------------------
  • Support for Braw SDK v1.8, so supports braw files from the newest cameras and sources.
  • Braw trimming, mark IO points in timeline and export or trim directly from command line job.
  • Command line arguments! Launch player from command line with specified file and IO points or trim new braw file straight from terminal. See COMMAND LINE section in readme for information.
  • Overhaul of decoding engine, including caching mechanism (still in progress though), braw trimming and other improvements. No GPU decode still. Audio engine currently disabled, I will work on it again soon.
  • Metadata viewer now allows copying values, in case one wants to save them as text.
  • Keymap got some modifications (JKL keys etc), see keymap help (press H in viewer).

As usual, if it breaks you get to keep the pieces. If something is broken, feel free to write problem description here.

Should also run in Linux just fine with wine64, tried myself in Centos 7.7

brawplayer_v0.5.0_gui_eyecandy.jpg
brawplayer_v0.5.0_gui_eyecandy.jpg (655.16 KiB) Viewed 22655 times

Re: BRAW Player for Win

PostPosted: Wed Jul 15, 2020 2:23 pm
by Hendrik Proosa
Caching mechanism seems to be a bit buggy. If you get a bad allocation error printed in console, try running from command line like this:
brawplayer.exe -cache 1

If it shows an image after launching player like this, please report your system RAM amount and if possible, try to test at which cache level (increase the number, default value is 100) does it start to fail. Thanks!

Re: BRAW Player for Win

PostPosted: Mon Aug 10, 2020 9:30 am
by Hendrik Proosa
It lives! Braw SDK 2.0 beta for win that opens 12K Ursa files.
brawplayer_v0.6.0_gui_eyecandy.jpg
brawplayer_v0.6.0_gui_eyecandy.jpg (609.22 KiB) Viewed 22276 times

Re: BRAW Player for Win

PostPosted: Thu Aug 27, 2020 12:39 pm
by Hendrik Proosa
New version v.0.6.0 can be found from release section in public repo:
https://gitlab.com/hendrikproosa/braw-p ... -/releases

Main feature is support for Braw SDK v2.0 beta 2, which enables 12K braw file playback.
Also added timeline zooming, which by itself isn't much but lays some foundation for more playback controls like play within zoomed range etc. Also makes it easier to see what range is selected etc.

Messed quite some time with overhauling viewer process so that view shader would be separated from user shaders but didn't get it working properly yet, so disabled it. Goal is to add possibility to view separate RGB channels and change viewer exposure and gain independent of what user shader is doing.

NOTE about 12K braw
If it crashes with allocation errors, run from command line with cache argument, like this, to force down ram caching: brawplayer.exe -cache 1

When running player in Linux with wine64 it crashes with 12K files, not sure yet why because same files work under Win.

Re: BRAW Player for Win

PostPosted: Thu Aug 27, 2020 6:10 pm
by JackJones1337
Terrific, it seems the author is a real pro! I always liked creative works like these.

https://fixthephoto.com/online-photoshop-editor.html

Re: BRAW Player for Win

PostPosted: Sun Aug 30, 2020 10:34 am
by Joshua_G
Is there an executable v0.6.0?

Re: BRAW Player for Win

PostPosted: Sun Aug 30, 2020 11:23 am
by Hendrik Proosa
Joshua_G wrote:Is there an executable v0.6.0?

Download the archive from release page, it contains program directory. It is named source because gitlab packages the repo on release with this name, but public repo actually contains compiled binaries.

Re: BRAW Player for Win

PostPosted: Mon Aug 31, 2020 11:06 am
by Joshua_G
Thanks.

Re: BRAW Player for Win

PostPosted: Mon Aug 31, 2020 11:14 am
by Hendrik Proosa
Joshua_G wrote:Thanks.

No problem ;) let me know how it works (or if it doesn’t), I try to improve it over time.

Re: BRAW Player for Win

PostPosted: Sun Sep 20, 2020 8:18 am
by Hendrik Proosa
Thanks to other curious people in the software development subforum and Captain Hook’s code examples and help I think I finally understood how exactly the GPU decode and OpenGL interop works, so will start adding gpu decoding path finally 8-) Memory management needs an overhaul because 12K files seem to kick my players butt.

Sound is still on the back seat because it made my head hurt bad. I think I have to use some other library for sound playback, OpenAL has crossed my mind, and also do some kind of audio buffering to prevent the crackling.

Current fixlist (things that suck):
- caching resilience for high res files (12K);
- braw trimming based on timecode values, not just frames;
- audio
- shading mechanism, separation of viewer and processing shaders
- play in to out

Some more ideas I have:
- metadata export to text files, both single frame and sequence;
- keyable parameters and sidecar export to capture the changes (raw parameter keying);
- playlist with possible edl import;
- multi-trim (select multiple ranges in timeline and trim all to separate files);
- naming tokens for trimming and saving (metadata keys and other variables as file and folder nime elements), basically trim templates.

Re: BRAW Player for Win

PostPosted: Mon Oct 26, 2020 9:08 pm
by Ben Slavens
I love your braw player! I hope you keep on updating it when you have time, because it seems like Blackmagic is not interested in giving their player and functionality whatsoever beyond simple playback...One note, I am working with 3K Anamorphic (2x) footage I shot recently, and it seems that there is no way to desqueeze the footage in your player. I could just go into Resolve and do it there, but it would be nice just have the option to desqieeze the view for 2x, 1.5x, and 1.33x Anamorphic lenses shot in the 3K Ana mode when just looking to quickly reference footage.

Thanks for all your time and awesome contributions!

Re: BRAW Player for Win

PostPosted: Mon Oct 26, 2020 10:17 pm
by Hendrik Proosa
Thanks for feedback! Glad you find it useful!

Scaling for this kind of situations has crossed my mind, but in the meantime one workaround could be a shader that desqueezes the image. I’ll try to give an example tomorrow when back at desk.

Re: BRAW Player for Win

PostPosted: Tue Oct 27, 2020 11:37 am
by antoine
Ben Slavens wrote:I love your braw player! I hope you keep on updating it when you have time, because it seems like Blackmagic is not interested in giving their player and functionality whatsoever beyond simple playback...One note, I am working with 3K Anamorphic (2x) footage I shot recently, and it seems that there is no way to desqueeze the footage in your player. I could just go into Resolve and do it there, but it would be nice just have the option to desqieeze the view for 2x, 1.5x, and 1.33x Anamorphic lenses shot in the 3K Ana mode when just looking to quickly reference footage.

Hi Ben,
Could you share with us such a file ? Thanks

Re: BRAW Player for Win

PostPosted: Tue Oct 27, 2020 6:08 pm
by Hendrik Proosa
Hi, try this shader as a workaround for viewing anamorphic files. Save it into a file with .frag extension and place it into /shaders folder under application main folder (there are all the other shaders located too, so you can modify any of them). Change the scalingRatio variable value according to necessary scaling. Value 1.0 applies no scaling, value 2.0 squeezes image vertically 2x. It isn't technically correct, should actually stretch horizontally but for player it makes a bit more sense visually.

Shader is reloaded when selecting it from combobox so you can modify it in text editor and simply change to some other shader and back in player to see the change when trying different scaling values.

Code: Select all
#version 150 core
uniform sampler2D tex;
uniform vec2 resolution;
uniform float exposure;
uniform float gamma;
uniform int bitdepth;
uniform int lut;
uniform float lutweight;
in vec2 fragTexCoord;

vec4 applyViewerGrade(vec4 basecolor)
{
    vec4 color = basecolor;

    // General exposure and gamma adjustments
    color = color * pow(2, exposure);
    color.r = pow(color.r, gamma);
    color.g = pow(color.g, gamma);
    color.b = pow(color.b, gamma);

    return color;
}

void main(void)
{
    // Sample from base coords
    vec4 color = texture2D(tex, fragTexCoord);


    // *****************************************************
    // Change this value to set different scaling ratio. If 1.0, no scaling is applied
    // *****************************************************
    float scalingRatio = 2.0;


    float newHeight = 1.0 / scalingRatio;
    float newBlanking = (1.0 - newHeight) * 0.5;

    // Sample from modified uv coords
    vec2 newuv = vec2(fragTexCoord.x, fragTexCoord.y * scalingRatio - scalingRatio * newBlanking);
    vec4 finalcolor = texture2D(tex, newuv);


    // Blank outside image to mask the wraparound
    if (fragTexCoord.y < newBlanking)
        finalcolor = vec4(0.0);

    if (newuv.y > 1.0)
        finalcolor = vec4(0.0);


    // Apply weighting and viewer grade
    gl_FragColor = mix(applyViewerGrade(color), applyViewerGrade(finalcolor), lutweight);
};


This is how the Rabbit ear clones test clip looks like with desqueeze view LUT and 1.5 scaling factor:
braw_player_desqueeze.png
braw_player_desqueeze.png (811.26 KiB) Viewed 20487 times

Not sure what the actual squeezing factor should be for it, file metadata tells it is supposed to have 2.40 aspect but original clip aspect isn't really related to that value. I think one option would be to calculate current aspect from width/height, compare it with metadata and apply the remaining as additional desqueeze scaling. And I also discovered that I should force-add original width and height to metadata because some clips don't have it in braw metadata so meta view doesn't show them.

Re: BRAW Player for Win

PostPosted: Fri Mar 19, 2021 10:11 am
by Hendrik Proosa
Quite some time has passed now but I try to get back to improving the player some more.

What I have in mind:
- update BRAW SDK to latest version (2.1 beta 3 as of now)
- GPU decode (CUDA first, then I'll see if OpenCL comes along)
- better audio playback (will switch to OpenAL, should make it easier)
- better trimming (make it more useful, including multi-selects from gui)
- sidecar file saving, with dynamically changing parameters (yes, this means animation curves)
- shader system overhaul, separation of effects from gamma/gain shader
- maybe try DCTL effects too...
- possibly multi-clip playlist/timeline, I'd like to look into OTIO
- playback engine rework, I'd like to get it a bit more performant

So new version might drop somewhere between now and never 8-)

Re: BRAW Player for Win

PostPosted: Fri Mar 19, 2021 10:28 am
by Michael Kropfberger
never say never :)
thanks for your effort!

IO like your priorization, allthough I think, BRAW SDK is top, but then audio...
GPU on single clips seems a little "over the top", imho... but what do I know from my small BMPCC 4K world :)

greets
Mike

Re: BRAW Player for Win

PostPosted: Fri Mar 19, 2021 11:47 am
by Hendrik Proosa
Thanks for your thoughts Michael! This list is not that much of a priority list as "I'd like to have this and that", so audio will probably be higher in my priorities :) I had to mess with audio a bit for a plugin I wrote recently so I have that area warmed up already. I will probably visualize audio waveforms too if I get to it.

Re: BRAW Player for Win

PostPosted: Fri Mar 19, 2021 12:07 pm
by Michael Kropfberger
havent tested yet, but what's about multi audio streams and visual (clap) audio sync to sidecar?

Re: BRAW Player for Win

PostPosted: Fri Mar 19, 2021 12:32 pm
by Hendrik Proosa
Michael Kropfberger wrote:havent tested yet, but what's about multi audio streams and visual (clap) audio sync to sidecar?

What do you mean exactly? Sidecar file has no audio related overrides as far as I know.