MLV App 1.14 - All in one MLV Video Post Processing App [Windows, Mac and Linux]

Started by ilia3101, July 08, 2017, 10:19:19 PM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

masc

Hehe, try out what you like and have fun! That can always help for future features! ;)

Write a path to a file:

QFile file(fileName);
file.open(QIODevice::WriteOnly);
file.write(yourPathString.toUtf8());
file.close();


Is that all you need? I have some problems to completely understand what you want to ask / to say... :(
5D3.113 | EOSM.202

Danne

Cool, will try when I get home.
My experiment is following.
I will execute my script from within Mlv App just like it's done for ffmpeg.
From inside the script I will find the path file and then cd into this folder so that my script will be executed from this folder rather than from inside Mlv App.

Preferrably the path file could be sent to /tmp folder and then my script can find it there :)

Danne

Tried your code to try and write path to file:


Coming from the world of bash I have a hard time understanding how to fix this. Is it supposed to write the selected output path into a file? Where to put it?
I tried putting the code here:
#ifdef Q_OS_MACX
        else if( ( m_codecProfile == CODEC_PRORES422ST && m_codecOption == CODEC_PRORES_AVFOUNDATION )
              || ( m_codecProfile == CODEC_PRORES4444 && m_codecOption == CODEC_PRORES_AVFOUNDATION )
              || ( m_codecProfile == CODEC_H264 && m_codecOption == CODEC_H264_AVFOUNDATION ) )
        {
            //AVFoundation
            startExportAVFoundation( m_exportQueue.first()->exportFileName() );

QFile file(fileName);
file.open(QIODevice::WriteOnly);
file.write(yourPathString.toUtf8());
file.close();


    QProcess process;
    process.startDetached("/bin/bash", QStringList()<< "-c"
                       << "chmod u=rwx HDR_MOV.command");
    process.startDetached("/bin/bash", QStringList()<< "HDR_MOV.command");
        }
#endif


Danne

Not sure what I´m doing:
QString filename = "Data.txt";
QFile file(filename);
file.open(QIODevice::WriteOnly);
file.write(QFileInfo( m_exportQueue.first()->fileName() ).absolutePath().toUtf8());
file.close();

Gets me an empty file called Data.txt inside Mlv App. I was thinking this would reveal folder path but no:
file.write(QFileInfo( m_exportQueue.first()->fileName() ).absolutePath().toUtf8());
Any clues?

Danne

Ok, closer:
    QString path = QFileInfo( m_lastSaveFileName ).absolutePath(); 
    QString filename = "/tmp/Data.txt";
    QFile file(filename);
    file.open(QIODevice::WriteOnly);
    file.write(path.toUtf8());
    file.close();

However, I need the path to where I set my exports to, the mov files. What path is that? Right now I get path to where I select my MLV files.

masc

Look the screenshot. You should not add the code to exportHandler(), because there is running a lot in parallel via signal/slot... so there may happen things you won't understand. Go to the end of startAVFoundation() and add the code there (before "emit...").
I could create the "/tmp/Data.txt", this file inherits "/Users/masc/Desktop" - the folder where I exported a file.



btw: what shall do
QStringList()<< "-c" << "chmod u=rwx HDR_MOV.command"
?
5D3.113 | EOSM.202

Danne

Hm, trying:
    QString path = QFileInfo( m_exportQueue.first()->exportFileName() ).absolutePath(); 
    QString filename = "/tmp/Data.txt";
    QFile file1(filename);
    file1.open(QIODevice::WriteOnly);
    file1.write(path.toUtf8());
    file1.close();

Compiles but program simply closes and no txt file is created. Where do you put this snippet in MainWindow.cpp? Can´t find where to put it?


QStringList()<< "-c" << "chmod u=rwx HDR_MOV.command"
Might not be working, but if it does it should give the script root privileges.

masc

You should add the code in the end of function "startExportAVFoundation()", in the latest revision I am talking about line 1824 in MainWindow.cpp.

How would be the whole call in the Terminal (where is this -c)? The script is in /usr/bash ?
5D3.113 | EOSM.202

masc

With this code:
QProcess process;
process.execute( "chmod u=rwx /usr/bash/HDR_MOV.command" );

the terminal tells:
-rwxr--r--@  1 masc  staff  49007 24 Apr 21:21 HDR_MOV.command
5D3.113 | EOSM.202

Danne

Thank you @masc!! Totally working now :)
I see you also solved chmod for my script. Even better :). I now have what I need to add the script after mov conversion is done. Too tired now but will continue tomorrow and see what I can accomplish with my HDR script :)
https://bitbucket.org/Dannephoto/magic-lantern/downloads/HDR_MOV.command


Danne

Added my HDR_MOV.command script into a version of Mlv App here:
https://bitbucket.org/Dannephoto/mlv-app-danne/downloads/Mlv_App_HDR.app.zip

I did a lot of refinements in the command. The command lives in MacOS folder at the moment.

To be able to follow changes in code I uploaded a repository in mercurial(not familiar with git, sorry):
https://bitbucket.org/Dannephoto/mlv-app-danne/overview

Commit:
https://bitbucket.org/Dannephoto/mlv-app-danne/commits/f24be5e309c4a65b6fea20013a5db9522c793c55

To test this I suggest downloading some of the shortened HDR mlv files uploaded here:
https://bitbucket.org/Dannephoto/mlv-app-danne/downloads/

How to use it
Simply run and export your MLV files as usual. Export to mov prores. Once the files are exported the script will take on and start processing your files into HDR mov files. Beware, the script will ask you to install missing dependencies and although multiprocessing it will take a while for aligning and exporting to be done.
If you want to abort processing you can do this through a notifier window which will kill align_image and other stuff going on under the hood.

This is just for fun stuff and testing. A lot more can be done here and I have no kind of agenda here. Unfortunately only for mac at the moment.
Thanks masc for helping out!

masc

Not bad Danne! The only thing I am a bit sad about is that you took it to bitbucket - so it is difficult to see the difference between the two branches.

Is it possible in principle to use the same scripts on Linux, and maybe with some changes also on Windows?

I could imagine to add a combobox to the export settings - this box shows all installed scripts in this internal MacOS folder (or installation folder for the other OSes). Installation via drag and drop into MLVApp. The user can selected between "none" and the installed scripts. After export is done, the chosen script is started (as you did now).

Does that only work for movs atm, or also for TIFF, PNG, mp4,... ? How is it: the AVFoundation exported file is no AVFoundation, but ffmpeg after the script, or?!

Pro: do a lot of fancy stuff
Contra: you won't see what you get, before in MLVApp
5D3.113 | EOSM.202

Danne

Thanks for feedback masc. And I like the idea about a combo box although I don't fully grasp the installation procedure.
Porting this to linux should be pretty straightforward but windows maybe not as swift but I think all dependencies exists for windows too. If anyone would like to work on a windows solution you are very welcome :).
I will look into github and I reupload it there when I get some time.

Suggestion. If we could work on outlining a mac solution I do what I can to fix it for linux as well.
One good thing is if one use the HDR script and chooses to abort processing we could skip the terminal notifier which kills processing in bash.

Danne

Ok masc. I uploaded to a github fork:
https://github.com/dannephoto/MLV-App
Is this correct?

I also did some git creation at bitbucket:
https://bitbucket.org/Dannephoto/mlv-app_danne
Also legit or should I bury this one?


edit: Noticed a bug. Character Ö in Köln isn´t working, making Mlv App crashing.

masc

That would be not too hard to build this combobox and provide it to your functionality. I can create all that, and I would pack all this script functions in a new class...

Thanks for the github repos. Now it is easy to see the difference.  8)

Thanks for reporting this äöü bug! I could fix it nearly everywhere - only for AVFoundation export it still does strange things. But I don't know this ObjectiveC classes, so I have to search for a solution. The problem is line 88 in avf_lib.m.
5D3.113 | EOSM.202

Danne

Combobox seems nice :). Really like the idea to attach functions not added through scripts. Thanks for being open minded.

edit:
QuoteDoes that only work for movs atm, or also for TIFF, PNG, mp4,... ? How is it: the AVFoundation exported file is no AVFoundation, but ffmpeg after the script, or?!
I could get it to fly with tiff and mp4. Maybe png, will check.
And yes, it´s back to ffmpeg prores as the end result...

masc

The äöüß bug is fixed now, also for AVFoundation export. I have to say ObjectiveC is not my language... :P
When I have some time I'll implement this script-class...
Btw: your script uses only enfuse (from hugin)? Could it be an idea to add enfuse into our package in the same way as ffmpeg? Then the user does not need to install hugin (if he don't want to)... it would work out of the box.
5D3.113 | EOSM.202

Danne

Uses both enfuse and hugin align_image_stack. Could be installed as package but quite big.
Exiftool is also in there :)

Danne


masc

Cool!
I only know to add downloads as releases. Go to release tab and create one. Then you can add the zip with the compiled app to the release.
5D3.113 | EOSM.202

Danne

Thanks masc. Not ready for any releases yet  :P.
I´m almost through making HDR work for tif files produced in Mlv App. One issue is frame rate tag. This tag seems stripped from tif files. Would you know if it´s possible to force a video frame rate tag into the tif file? Don´t want to need to use mlv_dump to drag the fps data out and then we have yet another dependency to deal with.

Danne

I think it´s better solved by sending the fps from each MLV into the tif folder created:
        //Creating a folder with the initial filename
        QString folderName = QFileInfo( fileName ).path();
        QString shortFileName = QFileInfo( fileName ).fileName();
        folderName.append( "/" )
                .append( shortFileName.left( shortFileName.lastIndexOf( "." ) ) );

        QDir dir;
        dir.mkpath( folderName );

        //we also need to know fps from the actual MLV files since tif doesn´t reveal frames per second.
        QString fps = locale.toString( getFramerate() );
        QFile file5(folderName + "/fps");
        file5.open(QIODevice::WriteOnly);
        file5.write(fps.toUtf8());
        file5.close();

        //Now add the numbered filename

bouncyball

Whoa... some scripting devel! Interesting, MLV App with built is scripting language, what if we implement the LUA there :).

Danne

Oh, LUA, I tire myself out with bash before even getting through basics about LUA unfortunately but what are you thinking here B?

Added tif support to my HDR script so all formats should work now? I can´t find png, is it in Mlv App too?:
https://github.com/dannephoto/MLV-App/commit/61139270177dabab58c52bc6d3349fd8ac3b934b

Working version:
https://bitbucket.org/Dannephoto/mlv-app-danne/downloads/MLV_App_HDR.app.zip

I realize I dont even use enfuse to merge the files but ffmpeg tblend filter together with hugin align_image_stack. I want to experiment some more with enfuse to see if it´s reliable in this workflow. Right now the align _image_stack is causing the output to flicker since enfuse is interpolating borders. This is not a problem with ffmpeg tblend The consecutive order needed to keep framerate is also problematic here when using enfuse.

I rewrote some parts quite heavily in my script and right now it will only keep the final prefixed HDR_ output file and removes the rest to save some space.

bouncyball

We dropped 16bit PNGLib support in favor of FFMPEG/TIFF because of simplicity and lesser dependency. There is only 8 bit PNG frame saving in the menu done by the QT image lib.

Without enfuse there will be one less binary dependency. So I think it's ok ;)