[WINDOWS] simple right clic menu mlv dump batch

Started by piloui, February 17, 2014, 12:25:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

piloui

Hi there,

I'm trying to create a simple batch, for selecting, right clic and "DNGing" mlv files


@echo off
for %%a in (*.MLV) do ( md "%%~na" 2>nul )&( path_to_mlv_dump\mlv_dump.exe -o %%~na\%%~na_ --dng %%~na.MLV )


It simply creates a directory for each MLV file and then exctracts dngs in it with appropriate names. My .bat file is placed in "C:\Users\NAME\AppData\Roaming\Microsoft\Windows\SendTo"

Then i can right clic my mlvs, in the contextual menu choose sent to > 01_mvl_dum.bat  ( 01 prefix is for placing it at the top of the list )

Works pretty well but :

1: extracts all the mlv present in the folder, i'd like to make it only for selected ones

2: i'd like to add a progress info, like we had with raw2dng, some kind of ( "NAME OF THE MLV" extraction running : current frame / total frames )

Don't know if it's hard to do despite my web research. Any ideas please ?

Thanks ;)

piloui

I tried again but i realized the progress % probably cannot be achieved in .bat because it's not my .bat progress but mlv_dump.exe progress.
Concerning the option to extract only the slected .MLV, still no success :/

So why am i trying to do a bacth mlv to dng while we can find tons of others exemples here do you ask ?
Just because none of them seems to offer a subfolder creation, which helps a lot, belive me, for mlv + sound.

Why ?

As you may have noticed, .wav extracted from mlv are a bit longer tha dng sequence. Thanks to davinci resolve lite, the option auto sync with time code allows you to cut and attach the sound properly with the corresponding dngs. But you MUST have each corresponding dngs+wav in a different bin.

So extracting your dng+wav in subfolders allows you inside resolve to right clic and "import with subfolders and create bins", and then right clic and "auto sync " on each sub bins. Anyway, i'll make a video to explain this clearer.

EDIT : for selected files only :

@echo off
for %%a in ( %* ) do ( md "%%~na" 2>nul )&( path_to_mlv_dump\mlv_dump.exe -o %%~na\%%~na_ --dng %%~na.MLV )

piloui

Updated with progress bar



I cannot test mlv_dump.exe progress, so i simply calculate the total frames number divided by the current frames number in subfolder during extraction.

01_mlv_dump.cmd + mlv_dump_progress.cmd

01_mlv_dump.cmd :


@echo off
TITLE MLV dump 1.0
setlocal
setlocal enabledelayedexpansion

for %%a in ( %* ) do (
:subfolders creation
md "%%~na" 2>nul
:index creation
path_to_mlv_dump\mlv_dump.exe -x %%~na.MLV
set filename=%%~na
:total frames number extraction
for /f "tokens=2 delims=;= " %%P in ('path_to_mlv_dump\mlv_dump.exe -x %%~na.MLV ^| find "Processed"') do (
set tframe=%%P
)
:progress bar launch
START path_to_mlv_dump_progress\mlv_dump_progress.cmd
:dng extraction
path_to_mlv_dump\mlv_dump.exe -o !filename!\!filename!_ --dng !filename!.MLV
)
endlocal enabledelayedexpansion
endlocal
exit




mlv_dump_progress.cmd :


@echo off
:window size
mode con: cols=40 lines=6
setlocal enabledelayedexpansion
TITLE Extracting !filename!.MLV
:LOOP
set count=0
for %%B in ( !filename!\*.dng ) do (
:extracted frames counter
set /a count=count+1
)
set /a bar=!count!*20/!tframe!
set /a space=20-!bar!
FOR /L %%C IN (1,1,!bar!) DO (
   set bar=!bar!²
)
FOR /L %%C IN (1,1,!space!!) DO (
   set space=!space!
)
cls
echo.
set /a progress=!count!*100/!tframe!
:progress / total
echo  !count!/!tframe! frames
:progress bar + %
echo           ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo  Progress  ²!bar:~2! !space:~2!  !progress!%%
echo           ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
IF "!count!"=="!tframe!" goto END
goto LOOP
:END
endlocal enabledelayedexpansion
exit


Same process :

Place 01_mlv_dump.cmd in "C:\Users\NAME\AppData\Roaming\Microsoft\Windows\SendTo"
Place mlv_dump_progress.cmd where you want and update the directoy in 01_mlv_dump.cmd

Select all the .mlv you want to extract, right clic, sent to , 01_mlv_dump.cmd. ( it behaves like a "drag and drop" ). Each SELECTED mlv will be extracted one after another in queue rather than all together in a LONG process. DNG are extracted in a subfolder named after the original file.

Next steps :
Existing file check > skip, resume or overwrite
Log file creation

I get what i wanted, some kind of .rar extraction process, simple and efficient.

piloui

Hi there,

Little up.
Is mlv_dump.exe still a viable solution to extract DNGs please ?
I cant see anything wrong for now but i'd like to have somme feed back.

Thanks.

;)

g3gg0

with "--batch" you can get some progress messages

B: blocks
V: video frames
A: audio frames
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

RenatoPhoto

If you use Windows, this is a useful and efficient command to run mlv_dump.  Thanks piloui

From above I use the code:

@echo off
for %%a in ( %* ) do ( md "%%~na" 2>nul )&( path_to_mlv_dump\mlv_dump.exe -o %%~na\%%~na_ --dng %%~na.MLV )


To turn it into command just copy to notepad and save it as cmd. 

Now place it in windows "C:\Users\NAME\AppData\Roaming\Microsoft\Windows\SendTo"

Use it as explained above:

"Select any of the .mlv you want to extract, right clic, sent to , 01_mlv_dump.cmd. ( it behaves like a "drag and drop" ). Each SELECTED mlv will be extracted one after another in queue rather than all together in a LONG process. DNG are extracted in a subfolder named after the original file."

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

ShootMeAlready

Just to to last comment for Windows newbies

path_to_mlv_dump must be replaced with an actual file directory that contains the mlv_dump.exe

Easiest way to do that, is find the folder in file manager, go to top bar box, select the last sub-directory,  right-click on 'copy address'

Example:
"C:\Users\Bubba\Videos\Videos\Projects\Magic Lantern\RAW Converter"

If you have spaces in your directories you'll want to put in double quotes like above.

If you know how to find your system variables, then you probably aren't a newbie, so I wont talk about that.
T3i+ML & 70D.112+ML, Tokina 11-16 2.8, Sigma 18-35 1.8, 50-150 II 2.8, 50 1.4, Canon 28 1.8, 35 2, 85 1.8 "Shoot Wide and Prosper"

garry23

Hope someone can tell where I'm going wrong, as I haven't played with .cmd files before.

All I wish to do is convert .mlvs to dngs.

I created a .cmd: here it is:

@echo off
for %%a in ( %* ) do ( md "%%~na" 2>nul )&( "C:\Users\Garry\Documents\MLV_Processing\mlv_dump.exe" -o %%~na\%%~na_ --dng %%~na.MLV )


I have a folder in my Docs area (Win 10) called MLV_processing.

I place a test .mlv file there.

I drag that .mlv to the .cmd file above.

The cmd window opens and starts to run.

It stops with an error can't find xxxx.M00 (where xxxx is my .mlv file name).

I get an Win error that .exe has stopped.

As I say, I hope someone can help the really stupid person  :D

ShootMeAlready

gary you put double quotes around the EXE file.

double quotes are only for the directory & sub-directories.

mlv_dump.exe cant be in thedouble quote. Look at the example

Example:
"C:\Users\Bubba\Videos\Videos\Projects\Magic Lantern\RAW Converter\"mlv_dump.exe
T3i+ML & 70D.112+ML, Tokina 11-16 2.8, Sigma 18-35 1.8, 50-150 II 2.8, 50 1.4, Canon 28 1.8, 35 2, 85 1.8 "Shoot Wide and Prosper"

garry23

@shootmealready

Many thanks. I'll give that a go.

Cheers

Garry

RenatoPhoto

@garry: here is my batch command which I put on the "SendTo" directory for quick conversion to dng:
https://drive.google.com/file/d/0B9z8Y0rg-pu8b2FKOEdqb0lGSms/view?usp=sharing

You will need to edit with the correct directory to your mlv_dump directory.  To do so just open it with Notes, change it and then save it.
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

garry23


canneloni

Is it only me or does it not work when mlvdump is in C:\Program Files ? After i moved it to C: it worked fine.
100D.100B ; Canon 18-55 STM ; Canon 50 1,8 II ; Canon 75-300 4,0 - 5,6 III ; Sigma 17-50 2,8

NoCp_Albert

@RenatoPhoto

I still work with MLV-Mystic but would try the MLV-Dumper for Windows now. I use your batch command and try the MLV-Dumper exe. in different folders, C:, E:, the Dumper started and makes all new Subfolders but without DNG.

My command line
- @echo off
for %%a in (*.MLV) do ( md "%%~na" 2>nul )&( "C:\MLV-Dump\"mlv_dump.exe -o %%~na\%%~na_ --dng %%~na.MLV )

I get the attached message out for all Files -  +  MLV Dumper v1.0
-----------------

Mode of operation:
   - Input MLV file: 'M20-0924.MLV'
   - Enforcing 14bpp for DNG output
   - Convert to DNG frames
   - Output into 'M20-0924\M20-0924_'
File M20-0924.MLV opened
File M20-0924.M00 not existing.
File M20-0924.IDX opened (XREF)
XREF table contains 381 entries
Processing...

After I close the Windows Message Dumper continius for all Files with

MLV Dumper v1.0
-----------------

Mode of operation:
   - Input MLV file: 'M20-0958.MLV'
   - Enforcing 14bpp for DNG output
   - Convert to DNG frames
   - Output into 'M20-0958\M20-0958_'
File M20-0958.MLV opened
File M20-0958.M00 not existing.
File M20-0958.IDX opened (XREF)
XREF table contains 772 entries
Processing...
Reached EOF of chunk 248/1 after 2 blocks total. This should never happen or your index file is wrong.
Processed 0 video frames
Done


Help will be gratefully accepted 

EOS 5D3 -113,-123, EOS 7D2, EOS 400, Lens EF16-35 f4 L, EF35 f2 IS, EF85 f1.8, EF 24-105 f4 L, EF 100-400 L II, EF 600 f4 L, Samyang 14mm f2.8, Canon Tc 1,4III, Kenko Tc 1,4 DGC

Walter Schulz

Please clarify:
Do you run the command via "Send to ..." in context menu or are you dropping an MLV file onto the cmd?

RenatoPhoto

@NoCp_Albert

I noticed that in your comand you have "C:\MLV-Dump\"mlv_dump.exe
Why do you use " "
If you have the mlv_dump.exe in the C:\MLV-Dump\ directory then the command line should be:

@echo off
for %%a in (*.MLV) do ( md "%%~na" 2>nul )&(C:\MLV-Dump\mlv_dump.exe -o %%~na\%%~na_ --dng %%~na.MLV )

Also you must leave the command prompt open until it finishes the process.. it should close by itself.

You can use this batch.cmd in two ways.  One is to directly drop the mlv to it or to put in in the "windows send to directory" as explained above.

Hope that helps
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

NoCp_Albert

 @Walter

I use "Send To" in context Menu.  I made a screnshot as png but don´t find the way to insert so I made copy from the message i get.
EOS 5D3 -113,-123, EOS 7D2, EOS 400, Lens EF16-35 f4 L, EF35 f2 IS, EF85 f1.8, EF 24-105 f4 L, EF 100-400 L II, EF 600 f4 L, Samyang 14mm f2.8, Canon Tc 1,4III, Kenko Tc 1,4 DGC

NoCp_Albert

@RenatoPhoto

I just change my existing Command Line in Notepad against your new Command Line and if I start the prozess with "Sent to" batch-mlv.cmd  i get the same Message as with the old and Windows stop the App

If I take the MLV File direct to MLV_dump.exe is exactly the same stop
EOS 5D3 -113,-123, EOS 7D2, EOS 400, Lens EF16-35 f4 L, EF35 f2 IS, EF85 f1.8, EF 24-105 f4 L, EF 100-400 L II, EF 600 f4 L, Samyang 14mm f2.8, Canon Tc 1,4III, Kenko Tc 1,4 DGC

RenatoPhoto

... do not close the message window, let the process finish.
It may take a couple of minutes depending on the size of the file and the speed of the computer.
The command window closes by itself. 
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

NoCp_Albert

@RenatoPhoto

I try and wait  more than 10 minutes, nothing is happens. The Message ar in German -

[Main Instruction]
mlv_dump.exe funktioniert nicht mehr

[Content]
Das Programm wird aufgrund eines Problems nicht richtig ausgeführt. Das Programm wird geschlossen und Sie werden benachrichtigt, wenn eine Lösung verfügbar ist.

[Programm schließen]

Edit: Today I try again and with this command Line mlv-dump runs:

C:\Users\alber\AppData\Roaming\Microsoft\Windows\SendTo\batch-mlv,cmd

@echo off
for %%a in (*.MLV) do ( md "%%~na" 2>nul )&("G:\4.0 Magic Lantern Bearbeitung\4.9 MLV-Dump\"mlv_dump.exe -o %%~na\%%~na_ --dng %%~na.MLV )

My System is Windows 10 PRO 64-Bit

Thank you @Renatophoto for your support.


EOS 5D3 -113,-123, EOS 7D2, EOS 400, Lens EF16-35 f4 L, EF35 f2 IS, EF85 f1.8, EF 24-105 f4 L, EF 100-400 L II, EF 600 f4 L, Samyang 14mm f2.8, Canon Tc 1,4III, Kenko Tc 1,4 DGC

RenatoPhoto

Well it looks like in Windows 10 you need to use the quotation marks "" around the path portion of the command line.
I use it win Windows 7 ultimate and do not use  quotation marks.
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

Walter Schulz

If there are blanks in your path: Use quotation marks
If there are no blanks in your path: Use quotation marks or not.
Or force use of Short File Names (SFN) instead of LFN.

WX works like W7 in this regard.

canneloni

Thanks Walter, now i can use mlv_dump in "C:\Program Files\MLVDump". Will try if it works the same way with mlvfs and the right click option.

EDIT: Works with mlvfs too, thanks again!  :)
100D.100B ; Canon 18-55 STM ; Canon 50 1,8 II ; Canon 75-300 4,0 - 5,6 III ; Sigma 17-50 2,8

RenatoPhoto

Thanks Walter, that explains very well all the problems regarding the quotation marks some people experienced with this command.
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

The batch command works well for me.  But sometimes I just want to convert a single file so I tried to create a command file to be added to the "Send To" directory so I can right click on the file and use the send to command to converted to dng in its own directory.

Since I am not a coder I am having a hard time making such command file.  After struggling for hours I got my command to work in creating the directory for the file but always the dng get extrated to the lower directory instead of the new directory.

Here is the code:
@echo off
ECHO "%~1"
set str="%~1"
set dir=%str:.MLV=%
md %dir%
E:\Downloads\00-ML\15-mlv-dump\000000-1-11-2017-utilities\mlv_dump.exe -o "%dir%" --dng %str%
cmd


The output of the mlv_dump indicates that the output is going to the correct directory but the dng do not go to that directory.
Here is the output of mlv_dump:

"F:\00-carol\M04-0953.MLV"

MLV Dumper v1.0
-----------------

Mode of operation:
   - Input MLV file: 'F:\00-carol\M04-0953.MLV'
   - Enforcing 14bpp for DNG output
   - Convert to DNG frames
   - Output into 'F:\00-carol\M04-0953'
File F:\00-carol\M04-0953.MLV opened
File F:\00-carol\M04-0953.M00 not existing.
Processing...


Vertical stripes correction:
  1.00000  0.99428  0.99554  0.98544  0.99348  0.98932  0.99408  1.00008
Cold pixels : 0
Reached end of chunk 1/1 after 352 blocks
Processed 98 video frames
Done

Note:  I tried with and without quotation marks on the dir and str variables but there is not change..
I suspect the problem was solved on the original batch command with the strange addition of  %%~na\%%~na_  just after the -o??
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