MLV Lite - The sweet taste of MLV with none of the extra calories™

Lua scripting updated


Twitter: @autoexec_bin    Facebook: magiclantern.firmware    Live chat: [email protected]

Want to help with Magic Lantern development, but have no coding skills?

Author Topic: MLV Viewer to view .mlv (and .raw) files on windows (C#)  (Read 164924 times)

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 2702
MLV Viewer to view .mlv (and .raw) files on windows (C#)
« on: September 22, 2013, 01:25:04 AM »
here is a _very_ simple and hackish MLV viewer to check your footage
it is also available as an OSX-App


it will read uncompressed MLV files and display the frames with just a few frames per second.
this tool was programmed in C# on windows, but it uses nothing windows-specific, so it should run on any OS using mono. (positive reports from linux and mac os x)

please remind:
 - these tools are just a PROOF OF CONCEPT
 - it is not meant as productional tool
 - i used it to check what is necessary to decode and view RAW/MLV files, its just my playground
 - it has bugs!
 - it will most likely not be continued
 - i shared it as a last resort tool in case you need something like that

MLVViewSharp:


notes:
 - just drop the .mlv or .m00, .raw, .r01, ... file into the program window
 - shows the video in full res using bilinear demosaicing
 - other debayering methods (e.g. fast ones) are available (right click onto image)
 - ramps exposure up/down if there is under/overexposure (so it may not be accurate enough for some of you)
 - has no white balance algorithm
 - just tested on 5D3, other cameras have different bayer patterns - didnt check them yet
 - it uses the coefficients from the raw info block, so color weighting should be correct caused trouble, disabled
 - the scene is scaled to TV black and white levels (16..235) for a better looking playback
 - updated to work with files that have less bpp than 14 (e.g. when used mlv_dump to reduce size)
 - supports both .mlv and old .raw file format

it has a white balancing feature:
 - press and hold SHIFT
 - press LEFT mouse button
 - image will get displayed 1:1
 - move to where you have gray level
 - release LEFT mouse button
it will pick a 8x8 pixel area and use this as white balance reference after debayering and kelvin correction.

camera color matrices are also used now, which should result in better colors

to disable all correction post processing:
 - right click to get context menu
 - there is an option to disable color correction

MLVBrowseSharp:


 - just select the folder to browse on the left pane
 - you can select multiple files on the right pane as you are used to (CTRL click etc)
 - the only thing you can do yet, is RIGHT CLICK and choose anything you want
 - for opening using MLV Viewer, please asign the .mlv extension to MLVViewSharp.exe
 - for every file visible, it creates a thread, so this might overload your computer when you have several hundreds of files in one directory (i hope you sort your footage better than this...)
 - selected files play back in maximum speed, unselected play slower (1 fps)
 - selecting a file causes it to play back from the beginning
 - you cannot set WB or debayering in the preview window (its simple to add, but i dont understand why someone would need that)

 - when a file is selected, you can CLICK and HOLD the left mouse button on the icon and DRAG left and right to seek in the file

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1410
  • 5DM3 / 7D
Re: [experimental] MLV Player to view .mlv files on windows (C#)
« Reply #1 on: September 22, 2013, 01:34:10 AM »
Than must be you playing with EOSM... ;)  Nice looking kid! ;D

The first version seem to run a bit faster..
Not much change in the colors from previous version.  The brightness change seem a bit slower now.
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 2702
Re: [experimental] MLV Viewer to view .mlv files on windows (C#)
« Reply #2 on: September 22, 2013, 01:35:47 AM »
right. here the notes from the other thread:

now it supports resizing and different debayering algorithms.
parts of it are faster now, others are slower.
in the end its about the same speed as the version before ;)

okay maybe it is a bit slower now - default debayering is full size bilinear filtering.
do a right click and select half/quarter etc resolution. then it will be faster ;)

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1410
  • 5DM3 / 7D
Re: [experimental] MLV Viewer to view .mlv files on windows (C#)
« Reply #3 on: September 22, 2013, 02:25:34 AM »
All functions tested well.. 1/2 is pretty good compromise between speed and resolution.
In Bilinear mode with windows 7 64 bit 4 cores CPU at 20% max at 45%.  Any way to speed it up?
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X


RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1410
  • 5DM3 / 7D
Re: [experimental] MLV Viewer to view .mlv files on windows (C#)
« Reply #5 on: September 22, 2013, 02:49:43 AM »
I think it is a great tool.  No post processing required to review the shots and also saves a lot of space needed for all the dngs etc.
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X


Andy600

  • Moderator
  • Hero Member
  • *****
  • Posts: 1755
  • Have you tried turning it off and on again?
Re: [experimental] MLV Viewer to view .mlv files on windows (C#)
« Reply #7 on: September 22, 2013, 12:32:55 PM »
Just tried the update with mlv recorded on the 50D. Everything is green ;D and much slower playback. The original player worked well.
Colorist working with Davinci Resolve, Baselight, Nuke, After Effects & Premier Pro. Occasional Sunday afternoon DOP. Developer of Cinelog-C Colorspace Management and LUTs - www.cinelogdcp.com

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 2702
Re: [experimental] MLV Viewer to view .mlv files on windows (C#)
« Reply #8 on: September 22, 2013, 04:44:43 PM »
Can you dump one frame into a separate frame using 'mlv_dump -f1 - o out.mlv in.mlv' and upload using upload.g3gg0.de?

The default demosaic algorithm is bilinear.  Just right click and select half res to have faster decoding.

Andy600

  • Moderator
  • Hero Member
  • *****
  • Posts: 1755
  • Have you tried turning it off and on again?
Re: [experimental] MLV Viewer to view .mlv files on windows (C#)
« Reply #9 on: September 22, 2013, 05:07:17 PM »
Uploaded. It should be there now :)
Colorist working with Davinci Resolve, Baselight, Nuke, After Effects & Premier Pro. Occasional Sunday afternoon DOP. Developer of Cinelog-C Colorspace Management and LUTs - www.cinelogdcp.com

Doyle4

  • Hero Member
  • *****
  • Posts: 690
  • Canon 5DRAWii & 600Dual-Iso
Re: [experimental] MLV Viewer to view .mlv files on windows (C#)
« Reply #10 on: September 22, 2013, 05:54:56 PM »
Possible to download the mlv raw module anywhere for latest nightly on 600d/5d2?

Thanks.

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 2702
Re: [experimental] MLV Viewer to view .mlv files on windows (C#)
« Reply #11 on: September 22, 2013, 10:07:02 PM »
i changed these things:

 - disabled camera matrix from raw info, as i dont really understand how to use it
 - added saturation code and pushed colors a bit
 - changed code to use LUT which is a bit faster

so the 50D footage should work. just the colors might not look perfect

maxotics

  • Hero Member
  • *****
  • Posts: 501
Re: [experimental] MLV Viewer to view .mlv files on windows (C#)
« Reply #12 on: September 22, 2013, 11:26:04 PM »
Hi, do you have this as open-source?  Thanks!


maxotics

  • Hero Member
  • *****
  • Posts: 501
Re: [experimental] MLV Viewer to view .mlv files on windows (C#)
« Reply #14 on: September 23, 2013, 12:17:52 AM »
Thanks g3gg0.  Please let me know when it is.  No rush, of course.  I think the MLV format has tons of potential and would love to help out.  Naturally, I'd like to use it with my 50D. 

Another thing that is driving me nuts is the focus pixel problem with the EOS-M (if it can shoot MLV? reliably).  I don't have the time to learn Java and fork PDR.  I'm too old for C :)  C# I can do (barely).  I'm hoping through your code I can figure out some solutions for that. 

Or, maybe I can help you with some domestic UI stuff.  C# is not beneath me :)


maxotics

  • Hero Member
  • *****
  • Posts: 501
Re: [experimental] MLV Viewer to view .mlv files on windows (C#)
« Reply #16 on: September 23, 2013, 02:39:51 AM »
The EOS-M, and other new Canon cameras that use the new hybrid focus system, set aside some pixels for focus.  When ML captures the RAW it captures these pixel values which usually appear as pink dots (because they are mostly red-pixels de-bayered).  Anyway, PDR uses start/end locations, with offsets, to go through a RAW or DNG file to remove them (before bebayering).  Unfortunately, I still see these pixels in my videos, the green and blue ones.  I think I know what the reasons are (there are more pixels than PDR takes care of), but it's a complicated subject and the original PDR devs are not around, though Mixer2 is coming back and Rewind is pretty knowledgeable. 

I believe a better strategy is to use a static sensor map, calibrate it to the crop, or whatever section of the sensor is used, and go through and "deaden" these pixels if they seem to be fired, which also seems to only happen if the camera is focused on the area or there is no detail (over-exposed). 

I started trying to do this through .NET, but there is no RAW library to make it easy for me.  Even DNGs/TIFFs are not easy.  So I'm hoping that by looking at what you did I may be able to modify it to follow this strategy.  Another great thing about MLV is you'll have the crop mode, camera, etc., stuff you need to know before you apply the routine for deadening the focus pixels.

As more Canon cameras are hacked, and the newer models come out, I believe this problem will become more pronounced and I won't seem so crazy to keep going on and on about it :)





g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 2702
Re: [experimental] MLV Viewer to view .mlv files on windows (C#)
« Reply #18 on: September 23, 2013, 08:57:16 PM »
I believe a better strategy is to use a static sensor map, calibrate it to the crop, or whatever section of the sensor is used, and go through and "deaden" these pixels if they seem to be fired, which also seems to only happen if the camera is focused on the area or there is no detail (over-exposed). 

easy to do. i can add support to mlv_dump.
the only question is how to specify the map.

maxotics

  • Hero Member
  • *****
  • Posts: 501
Re: [experimental] MLV Viewer to view .mlv (and .raw) files on windows (C#)
« Reply #19 on: September 23, 2013, 09:47:59 PM »
Found source, thanks.  Will work on static location file.  If you need something specific let me know. 
« Last Edit: September 23, 2013, 10:31:57 PM by maxotics »

arrinkiiii

  • Hero Member
  • *****
  • Posts: 1077
  • ML ADDICTED 7D
Re: [experimental] MLV Viewer to view .mlv (and .raw) files on windows (C#)
« Reply #20 on: September 24, 2013, 12:15:07 AM »


"ramps exposure up/down if there is under/overexposure (so it may not be accurate enough for some of you)"

-It's not possible to have a check/uncheck box or in the right key mouse to have te possibility to enable/unable the ramps exposure?

 

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1410
  • 5DM3 / 7D
Re: [experimental] MLV Viewer to view .mlv files on windows (C#)
« Reply #21 on: September 24, 2013, 05:01:50 PM »
ok, uploaded a version of the viewer that supports LEGACY .RAW files.
so it is useful for the non-mlv builds too ;)
Ohh Yes!  That is sweet!  I tested some raw files, worker very well..
Thank you!
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1410
  • 5DM3 / 7D
Re: [experimental] MLV Viewer to view .mlv (and .raw) files on windows (C#)
« Reply #22 on: September 25, 2013, 01:38:27 AM »
Just found that it crashes at 1/8 resolution.. 

Again this is a great tool for quick checking of the video files.
It could be even better if it ran a bit faster, although the slider works fantastic so it is easy to just skip forward!!  <-- Congrats nicely done!!
It could be a bit better if the contrast could be lowered a bit.

Could not get proper playback for multiple spanned raw files, xxx.raw and xxx.r00 and xxx.r01.  It worked well after they got joined but if I play any of the  pieces got lots of pink frames, and off sequence playback.
« Last Edit: September 25, 2013, 04:50:56 AM by RenatoPhoto »
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

bart

  • Senior
  • ****
  • Posts: 391
Re: [experimental] MLV Viewer to view .mlv (and .raw) files on windows (C#)
« Reply #23 on: September 25, 2013, 09:02:14 AM »
Very nice work! Easy quick review now saves so much time

tecgen

  • New to the forum
  • *
  • Posts: 45
Re: [experimental] MLV Viewer to view .mlv (and .raw) files on windows (C#)
« Reply #24 on: September 27, 2013, 11:33:36 AM »
Nice work. Can you please provide your C# source code? Maybe we can port it to Java and run it on OSX, Linux and Windows.

best regards
Marco
Canon 5D Mark II, 50D, 550D/Rebel T2i, EF 40mm f/2.8 STM, Sigma 18-35mm f/1.8, EF 85 f1.8, EF 135 f2.8 SF, Zoom H2n