June 8, 2013

Easily Convert Magic Lantern RAW to CinemaDNG with RAWMagic

There have been a few programs floating around to convert the .RAW files from Magic Lantern on the PC and Mac, but getting the files into a usable form takes a little bit of effort, as these programs were turning the files into DNG first, which aren't compatible with programs like DaVinci Resolve (since DNG is a stills format). Now we have a better solution as Thomas Worth from Rarevision (who created 5DtoRGB) has created a program called RAWMagic to get After Effects and Resolve-supported CinemaDNG files straight from the .RAW camera originals.

Here is Thomas on how simple RAWMagic actually is to use (it's currently Mac-only at this point):

I finally got around to writing an easy-to-use CinemaDNG converter for Canon 5D Mk III RAW video files. The CinemaDNG writer code was written from scratch to generate proper CinemaDNG files, so they should work with DaVinci Resolve without the need to convert to TIFF, etc.

Operation is as simple as dragging your RAW files onto the app's main window and then clicking "Convert" (just like with 5DtoRGB, but with no options since these are RAW files). So, you'll drop your files into the batch window, start the conversion and get one directory per clip full of Resolve-ready CinemaDNG files.

He also posted a photo of the files working in Resolve:

It's only 100% compatible with the Canon 5D Mark III, Mark II, and 50D, but just like everything else, this is very, very early Beta stuff. The other converter for the Mac, RAW2DNG, only gets you part of the way there, but this solution actually gives fully working CinemaDNG files, and I imagine will probably be capable of converting to other formats at some point in the future.

We will likely see much more development on this program, and I have no doubt it's going to become one of the go-to solutions for getting these files into a usable form right away. There are still more bugs to work out, but just for testing, this should make things that much quicker in post, especially as you won't have to really jump through any hoops -- it's now very similar to the Blackmagic Cinema Camera RAW workflow. Also, since Resolve Lite, the free version of DaVinci, supports up to 1080, you will be getting everything all of the cameras will be shooting.

If you don't already have Resolve, you can get it over on the Blackmagic Support Page. You can find RAWMagic 1.0 Beta 3 here (will try to update if there are newer versions released), and you can find the entire forum topic about it here.

Links:

[via 5DtoRGB Twitter]

[Disclosure: Blackmagic is a No Film School advertiser]

Your Comment

15 Comments

June 8, 2013

-3
Reply

From my understanding cineform will work also and be just as effective if not more? Any insight? Thanks

June 8, 2013

0
Reply
Anthony Marino

Yes Cineform should work great, but it does cost $300 to handle the RAW files. I think that's going to be more steep than most people want to pay just to mess around with their camera files. I'll look into it more as the firmware becomes more stable.

June 8, 2013

-1
Reply
avatar
Joe Marine
Editor-at-Large
Shooter/Writer/Director

It would be interesting to know if cineform compresses to the same exact file size. If its smaller that could offset the 300 bucks and save you on disc space. Appreciate the reply Joe and I'm seeing firsthand (it's my new facebook) ha...this site is really developing into a must read, very informative and entertaining medium, you guys and gals are awesome. Thanks

June 8, 2013

0
Reply
Anthony Marino

Glad you appreciate it. :)

Yes file sizes are much smaller. I think it will be worth it for some people, but since things are still so unstable at this point I don't know that I'd recommend people go out and get it just for the Canon Magic Lantern. I'm definitely going to try to get my hands on it as I guess there is beta software that makes the conversion easier with ML RAW.

June 8, 2013

-1
Reply
avatar
Joe Marine
Editor-at-Large
Shooter/Writer/Director

Mac only for now.

June 8, 2013

1
Reply

I've been using Lightroom to edit all the files and I don't see how it is so difficult. I mean, it's raw we're talking about. You will need to do grading anyway. Literally takes me 2 mins to uncompress all the raw files in different folders to get an image sequence I can then open in Lightroom(or Adobe CameraRaw whichever you prefer).

June 8, 2013

-2
Reply
Hubert

You've been converting DNGs in Lightroom, this directly converts to Cineform, this way it eliminates an entire step out of the workflow, its is not only easier, but more convenient, especially if you need to bring it to a managable size and don't have time to grade/convert in lightroom

June 8, 2013

-2
Reply

Still no raw->cinemadng for win users?

June 15, 2013

-1
Reply
Martin

I just wrote up a quick little batch file (Windows/DOS) onto which you can drag your .RAW files, and, so long as you have raw2dng in your path, it will create a sub-directory in the same folder with the name of the file you drag and dropped and will put all the .DNG files in there, and name them the same as the original file name, plus a dash '-' and then file number (e.g. M31-1900-000003.dng)

These are the contents of my MLRAW2DNG.BAT file:
set FILENAME=%~n1
MD %FILENAME%
raw2dng %1 %FILENAME%\%FILENAME%-

November 9, 2013

1
Reply

Actually, here's a more complete batch file, and description.

I just wrote up a quick little batch file (Windows/DOS) onto which you can drag your .RAW files, and, so long as you have raw2dng in your path, it will create a sub-directory in the same folder with the name of the file you drag and dropped and will put all the .DNG files in there, and name them the same as the original file name, plus a dash '-' and then file number (e.g. M31-1900-000003.dng)

This is just a little time-saver for me. I have the .BAT file on my desktop, and all I have to do is drag and drop one .RAW file at a time onto the batch file, and that'll create all the folder for me, and give me a good nomenclature. The folders are created in the same folder as the original .RAW files. You must have raw2dng in your PATH.

I did this because when I ran EyeFrame Converter, it went ahead and created TIFF files alongside the .DNG files, and I couldn't figure out how to tell it to not do that, and I wanted the .DNG files to end up in the same location, but in a subfolder.

These are the contents of my MLRAW2DNG.BAT file:
:Loop
IF "%1"=="" GOTO Continue
set FILENAME=%~n1
MD %FILENAME%
raw2dng %1 %FILENAME%\%FILENAME%-
SHIFT
GOTO Loop
:Continue

November 9, 2013

0
Reply

And I changed my mind!! This wasn't doing exactly what I wanted, so I'm writing a VBscript which you can run directly in Windows.

This is not complete, as I want to add the additional options on the menu, but for those who don't care, here you have the current incarnation. I also copied some functions I found on the Internet, and left those credits in there.

Save the following text as a .VBS file and then you can drag and drop your files from the CF card onto it:

[code]'Batch file to Copy and Convert ML Raw footage to a specified location using drag and drop
' By Val Gameiro
Option Explicit

Dim arg, newarg(), projname, destfolder, wshShell, i, response, objShell, objFolder, objFolderItem
Dim bullit, intIndex, argcount
Set arg = WScript.Arguments
bullit = Chr(10) & " " & Chr(149) & " "
argcount = arg.Count

' Input Project name to create folder? Or just for EXIFTOOL?
projname = UserInput( "Enter project name: " )
If projname = "" Then WScript.Quit

' Select where to store the files and conversions
Const DESKTOP = &H10&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(DESKTOP)
Set objFolderItem = objFolder.Self
'Wscript.Echo objFolderItem.Path
destfolder = BrowseFolder( "objFolderItem.Path", False )
If destfolder = "" Then WScript.Quit

' Select Conversion option
Do
response = InputBox("Select conversion format:" & Chr(10) & bullit & "1) CinemaDNG (RAW2DNG)" & bullit & "2) CinemaDNG (DCRAW)" & bullit & "3) GoPro CineForm" & bullit & "4) Quit" & Chr(10), "Enter option number:")
If response = "" Then WScript.Quit 'Detect Cancel
If IsNumeric(response) Then Exit Do 'Detect value response.
MsgBox "You must enter a numeric value.", 48, "Invalid Entry"
Loop
If response = 4 Then WScript.Quit
'MsgBox "The user chose :" & response, 64, "Yay!"

' Copy files and notify it's done, so user can remove card
Set wshShell = WScript.CreateObject ("WSCript.shell")
i = 0
ReDim newarg(argcount)
Dim components, objFileCopy, objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
While i < argcount
'MsgBox "xcopy """ & arg(i) & """ " & """" & destfolder & """" & " /V /Q"
wshshell.Run "xcopy """ & arg(i) & """ " & """" & destfolder & """" & " /V /Q"
'MsgBox "Error: " & Err.Number
If Err.Number = 0 Then
components = Split(arg(i), "\")
newarg(i) = destfolder & "\" & components(Ubound(components))
'Wscript.Echo "File name: " & newarg(i)
' Uncomment the next line to automatically delete the file
End If
i = i + 1
Wend
Msgbox "Files have been copied, you can now erase and remove the card/media"

' Convert files
' Include option to put DNGs in Subfolder, or same folder as .RAW
i = 0
Dim fullfilename, filename, tofile, filepath
While i < argcount
Select Case response
Case 1
components = Split(newarg(i), "\")
fullfilename = components(Ubound(components)) 'including .ext
filename = Left(fullfilename, InStrRev(fullfilename, ".")-1)
filepath = Replace(newarg(i), fullfilename, "")
'MsgBox "md """ & filepath & "DNG"""
tofile = Replace(newarg(i), fullfilename, filename)
'wshshell.Run "md """ & filepath & "\DNG"""
'tofile = Replace(newarg(i), fullfilename, "DNG\" & filename)
'MsgBox fullfilename & " / " & tofile & "-"""
MsgBox "raw2dng """ & newarg(i) & """ " & """" & tofile & "-"""
'wshshell.Run "%comspec% /k " & "raw2dng """ & newarg(i) & """ " & """" & tofile & "-"""
wshshell.Run "raw2dng """ & newarg(i) & """ " & """" & tofile & "-"""
Case 2
End Select
i = i + 1
Wend

' exiftool -ReelName=%%REELNAME%% *.DNG -overwrite_original_in_place

' House cleaning
Set arg = Nothing
WScript.quit

Function BrowseFolder( myStartLocation, blnSimpleDialog )
' This function generates a Browse Folder dialog
' and returns the selected folder as a string.
'
' Arguments:
' myStartLocation [string] start folder for dialog, or "My Computer", or
' empty string to open in "Desktop\My Documents"
' blnSimpleDialog [boolean] if False, an additional text field will be
' displayed where the folder can be selected
' by typing the fully qualified path
'
' Returns: [string] the fully qualified path to the selected folder
'
' Based on the Hey Scripting Guys article
' "How Can I Show Users a Dialog Box That Only Lets Them Select Folders?"
' http://www.microsoft.com/technet/scriptcenter/resources/qanda/jun05/hey0...
'
' Function written by Rob van der Woude
' http://www.robvanderwoude.com
Const MY_COMPUTER = &H11&
Const WINDOW_HANDLE = 0 ' Must ALWAYS be 0

Dim numOptions, objFolder, objFolderItem
Dim objPath, objShell, strPath, strPrompt

' Set the options for the dialog window
strPrompt = "Select a folder to store files:"
If blnSimpleDialog = True Then
numOptions = 0 ' Simple dialog
Else
numOptions = &H10& ' Additional text field to type folder path
End If

' Create a Windows Shell object
Set objShell = CreateObject( "Shell.Application" )

' If specified, convert "My Computer" to a valid
' path for the Windows Shell's BrowseFolder method
If UCase( myStartLocation ) = "MY COMPUTER" Then
Set objFolder = objShell.Namespace( MY_COMPUTER )
Set objFolderItem = objFolder.Self
strPath = objFolderItem.Path
Else
strPath = myStartLocation
End If

Set objFolder = objShell.BrowseForFolder( WINDOW_HANDLE, strPrompt, _
numOptions, strPath )

' Quit if no folder was selected
If objFolder Is Nothing Then
BrowseFolder = ""
Exit Function
End If

' Retrieve the path of the selected folder
Set objFolderItem = objFolder.Self
objPath = objFolderItem.Path

' Return the path of the selected folder
BrowseFolder = objPath
End Function

Function UserInput( myPrompt )
' This function prompts the user for some input.
' When the script runs in CSCRIPT.EXE, StdIn is used,
' otherwise the VBScript InputBox( ) function is used.
' myPrompt is the the text used to prompt the user for input.
' The function returns the input typed either on StdIn or in InputBox( ).
' Written by Rob van der Woude
' http://www.robvanderwoude.com
' Check if the script runs in CSCRIPT.EXE
If UCase( Right( WScript.FullName, 12 ) ) = "\CSCRIPT.EXE" Then
' If so, use StdIn and StdOut
WScript.StdOut.Write myPrompt & " "
UserInput = WScript.StdIn.ReadLine
Else
' If not, use InputBox( )
UserInput = InputBox( myPrompt )
End If
End Function[/code]

November 10, 2013

3
Reply

Here is an updated version, including transcoding into CineForm, but you'll need to have the GoPro Studio installed, and find the RAW2GPCF in the magic lantern forums.

'Batch file to Copy and Convert ML Raw footage to a specified location using drag and drop
' By Val Gameiro
Option Explicit

Dim arg, newarg(), projname, destfolder, wshShell, i, response, objShell, objFolder, objFolderItem
Dim bullit, intIndex, argcount
Set arg = WScript.Arguments
bullit = Chr(10) & " " & Chr(149) & " "
argcount = arg.Count

' Input Project name to create folder? Or just for EXIFTOOL?
projname = UserInput( "Enter project name: " )
If projname = "" Then WScript.Quit

' Select where to store the files and conversions
Const DESKTOP = &H10&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(DESKTOP)
Set objFolderItem = objFolder.Self
'Wscript.Echo objFolderItem.Path
destfolder = BrowseFolder( "objFolderItem.Path", False )
If destfolder = "" Then WScript.Quit

' Select Conversion option
Do
response = InputBox("Select conversion format:" & Chr(10) & bullit & "1) CinemaDNG (RAW2DNG)" & bullit & "2) GoPro CineForm .AVI compressed" & bullit & "4) Quit" & Chr(10), "Enter option number:")
If response = "" Then WScript.Quit 'Detect Cancel
If IsNumeric(response) Then Exit Do 'Detect value response.
MsgBox "You must enter a numeric value.", 48, "Invalid Entry"
Loop
If response = 4 Then WScript.Quit
'MsgBox "The user chose :" & response, 64, "Yay!"

' Copy files and notify it's done, so user can remove card
Set wshShell = WScript.CreateObject ("WSCript.shell")
i = 0
ReDim newarg(argcount)
Dim components, objFileCopy, objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
While i < argcount
'MsgBox "xcopy """ & arg(i) & """ " & """" & destfolder & """" & " /V /Q"
wshshell.Run "xcopy """ & arg(i) & """ " & """" & destfolder & """" & " /V /Q"
'MsgBox "Error: " & Err.Number
If Err.Number = 0 Then
components = Split(arg(i), "\")
newarg(i) = destfolder & "\" & components(Ubound(components))
'Wscript.Echo "File name: " & newarg(i)
' Uncomment the next line to automatically delete the file
End If
i = i + 1
Wend
Msgbox "Files have been copied, you can now erase and remove the card/media"

' Convert files
' Include option to put DNGs in Subfolder, or same folder as .RAW
i = 0
Dim fullfilename, filename, tofile, filepath
While i < argcount
Select Case response
Case 1 ' Using RAW2DNG
components = Split(newarg(i), "\")
fullfilename = components(Ubound(components)) 'including .ext
filename = Left(fullfilename, InStrRev(fullfilename, ".")-1)
'filepath = Replace(newarg(i), fullfilename, "")
'MsgBox "md """ & filepath & "DNG"""
tofile = Replace(newarg(i), fullfilename, filename)
'wshshell.Run "md """ & filepath & "\DNG"""
'tofile = Replace(newarg(i), fullfilename, "DNG\" & filename)
'MsgBox fullfilename & " / " & tofile & "-"""
MsgBox "raw2dng """ & newarg(i) & """ " & """" & tofile & "-"""
'wshshell.Run "%comspec% /k " & "raw2dng """ & newarg(i) & """ " & """" & tofile & "-"""
wshshell.Run "raw2dng """ & newarg(i) & """ " & """" & tofile & "-"""
Case 2 ' Using RAW2CF from CineForm Tools 422
components = Split(newarg(i), "\")
fullfilename = components(Ubound(components)) 'including .ext
filename = Left(fullfilename, InStrRev(fullfilename, ".")-1)
'filepath = Replace(newarg(i), fullfilename, "")
'MsgBox "md """ & filepath & "DNG"""
tofile = Replace(newarg(i), fullfilename, filename)
'MsgBox fullfilename & " / " & tofile & "-"""
MsgBox "raw2gpcf """ & newarg(i) & """ " & """" & tofile & ".avi"""
wshshell.Run "raw2gpcf """ & newarg(i) & """ " & """" & tofile & ".avi"""
End Select
i = i + 1
Wend

' exiftool -ReelName=%%REELNAME%% *.DNG -overwrite_original_in_place

' House cleaning
Set arg = Nothing
WScript.quit

Function BrowseFolder( myStartLocation, blnSimpleDialog )
' This function generates a Browse Folder dialog
' and returns the selected folder as a string.
'
' Arguments:
' myStartLocation [string] start folder for dialog, or "My Computer", or
' empty string to open in "Desktop\My Documents"
' blnSimpleDialog [boolean] if False, an additional text field will be
' displayed where the folder can be selected
' by typing the fully qualified path
'
' Returns: [string] the fully qualified path to the selected folder
'
' Based on the Hey Scripting Guys article
' "How Can I Show Users a Dialog Box That Only Lets Them Select Folders?"
' http://www.microsoft.com/technet/scriptcenter/resources/qanda/jun05/hey0...
'
' Function written by Rob van der Woude
' http://www.robvanderwoude.com
Const MY_COMPUTER = &H11&
Const WINDOW_HANDLE = 0 ' Must ALWAYS be 0

Dim numOptions, objFolder, objFolderItem
Dim objPath, objShell, strPath, strPrompt

' Set the options for the dialog window
strPrompt = "Select a folder to store files:"
If blnSimpleDialog = True Then
numOptions = 0 ' Simple dialog
Else
numOptions = &H10& ' Additional text field to type folder path
End If

' Create a Windows Shell object
Set objShell = CreateObject( "Shell.Application" )

' If specified, convert "My Computer" to a valid
' path for the Windows Shell's BrowseFolder method
If UCase( myStartLocation ) = "MY COMPUTER" Then
Set objFolder = objShell.Namespace( MY_COMPUTER )
Set objFolderItem = objFolder.Self
strPath = objFolderItem.Path
Else
strPath = myStartLocation
End If

Set objFolder = objShell.BrowseForFolder( WINDOW_HANDLE, strPrompt, _
numOptions, strPath )

' Quit if no folder was selected
If objFolder Is Nothing Then
BrowseFolder = ""
Exit Function
End If

' Retrieve the path of the selected folder
Set objFolderItem = objFolder.Self
objPath = objFolderItem.Path

' Return the path of the selected folder
BrowseFolder = objPath
End Function

Function UserInput( myPrompt )
' This function prompts the user for some input.
' When the script runs in CSCRIPT.EXE, StdIn is used,
' otherwise the VBScript InputBox( ) function is used.
' myPrompt is the the text used to prompt the user for input.
' The function returns the input typed either on StdIn or in InputBox( ).
' Written by Rob van der Woude
' http://www.robvanderwoude.com
' Check if the script runs in CSCRIPT.EXE
If UCase( Right( WScript.FullName, 12 ) ) = "\CSCRIPT.EXE" Then
' If so, use StdIn and StdOut
WScript.StdOut.Write myPrompt & " "
UserInput = WScript.StdIn.ReadLine
Else
' If not, use InputBox( )
UserInput = InputBox( myPrompt )
End If
End Function

November 10, 2013

-2
Reply

I agree that LR is great for grading, but Resolve gives you soooo many more options when it comes to tracking and compositing. My process is actually closer to what I did in the days of 35mm.

Pre-process > Backup > Colour > Match audio > Edit

There's obviously more, but takes a fraction of a fraction of the time it took with film. :|

February 6, 2014

-1
Reply
Mark