Code to perform the movie cuts on DM7025

  • OoZooN wrote:

    Zitat

    is it a bug or a feature, that in the cvs version of moviecut the mcut binary is not shipped with the plugin? it's located in the package enigma2-plugins, but there is no packet depend from the moviecut ipk to enigma2-plugins


    This is probably because this is my first attempt to upload things to enigma2-plugins, and I don't know of any other way of doing it.


    But are you sure it is not included? Look again in Plugins/Extensions/MovieCut/bin/.


    It all seems to be a mess. The practice seem to be to *not* include configuration files or binaries and such in the plugin ipk file, but rather collect them in the global enigma2-plugins ipk file. I wasn't aware of this practice when I wrote the control file, and even if I were I wouldn't know exactly how to describe the dependency to get the appropriate version of the enigma2-plugins package (i.e of the same date as the moviecut package). I assume that if I added the dependency, then everytime someone downloaded the moviecut ipk from the server they would automatically also receive the global enigma2-plugins package? But this also contains several configuration files for other plugins (not a good idea it seems), which means that those configuration files would be overwritten every time someone downloads my package!


    So I wanted the binary included, and made an ugly fix to fool the automatic package builder to add it there (in addition to in the global package). But then it was not recognized as a binary file, so then I added an even uglier fix to make sure it was executable when the package is first loaded.


    Well, thats the long story. I believe it works, but it certainly is not the right way of doing it. If anyone knows the right way, without the adverse effects mentioned above, I would be grateful to know it.


    Best Regards
    Anders Holst

  • Aha, now I see what you mean!


    "mcut" *is* included in the CVS version, but *not* in the ipk and tar.bz2 attached above!


    That was a pure omission. Sorry! New versions substituted above, so now they should work.


    Best Regards
    Anders Holst

  • so, after a little confusion i think i know what went wrong.


    when cvs tries to download the sources it still wants to update the old folder from your first check-in. in my source tar.gz i have these old folders including the source-data. (don't know if there are newly downloaded or cached by cvs) . so after compiling there are two mcut binaries. one is locatet in the enigma2-plugins-extensions-moviecut ipk and one in enigma2-plugins ipk but with different install pathes so that the imagebuild do not fail.

    mfg


    OoZooN


    Support für OoZooN Images gibt es auf forum.oozoon.de , nicht hier!


    Two Beer or not two Beer, thats the Question


    Aktuelle Nachrichten rund um OoZooN-Images gibt es auf Twitter

  • The above version of MovieCut, 1.2, requires the location patches that came in place 2008-06-26 (I wrote 28th above, that was slightly wrong I see now). Still, many people may have images based on versions of Enigma2 before that date but still after the skin changes on 2008-04-14.


    To make MovieCut available to them, I have made a minor "backport" of the plugin, intended for the Enigma2 2.5 branch between 2008-04-14 and 2008-06-26. The location support is "crippled" back to the pre-26th-june level, but otherwise everything should be the same in the plugin.


    Best Regards
    Anders Holst

  • Hello


    I have written two tools which may be useful in connection to MovieCut/mcut. Unfortunately they are currently only callable from the shell, i.e. using telnet or ssh.


    Both programs and their source code are included in the attached tar file. Brief descriptions are below.


    Best Regards
    Anders Holst



    mreconstructap


    In case the .ap-file is lost, or corrupted, or nonexisted because the movie comes from another platform, then the program "mreconstructap" can construct a new .ap-file corresponding to the movie. The .ap-file is used to map between time and position in the movie file, and is required to be able to use MovieCut/mcut.


    Just call it like:
    > mreconstructap movie.ts
    and it will replace the old movie.ts.ap.



    msplice


    With this program you can append movies or movie parts (from the same service), or split them apart again, or merge parts of movies in another order (for whetever use that may be).


    In more detail, msplice considers a movie as consisting of a number of parts, separated by "discontinuities" in the recorded time. Such discontinuities appear e.g. at the cut positions of MovieCut or mcut, but also sometimes when there are errors in the stream. msplice can split up one or several movies at those discontinuities and merge the parts together again in any order. In doing so it will try to clean up the cuts/discontinuities to avoid flickering and breaking up of the picture. (Note however, that if parts from several movies are appended they need to be from the same service, or the result will be unusable. Also, if you happen to use the same part twice, the dreambox will be confused and jumping and winding will not work.)


    Some examples of how to use it:


    Appending:


    If you have imported a movie in several parts from e.g. DM7000 or DM7020 and want them as one chunk, or if Enigma2 crashed and left an ongoing recording in two parts, then you can merge them as:
    > msplice -o resulting_movie.ts part1.ts part2.ts part3.ts
    Note however that you must have .ap-files for all parts, so if they come from an Enigma1 model you must use mreconstructap first on each part.


    Splitting:


    If you have merged several short movies with msplice, and want to undo that, then you can use the -s (for "split") flag:
    > msplice -s movie.ts
    The parts will be separated into movie_sec001.ts, movie_sec002.ts, etc. Note that this will not work if the merged parts are perfectly adjacent, as for several parts of a movie from Enigma1. Then there are no discontinuities any more between the parts. If you need to split it up again in smaller chunks without having discontinuities in the movie, you should use mcut instead.


    Checking and repairing:


    With the first version of mcut, the cuts vere not "clean", i.e. the picture flickered and broke up for a few frames. With msplice you can repair such previously cut movies, to get rid of the flickering. The price to pay is loss of aproximately one GOP around the cut.


    To check how many cuts a movie contains, and whether they are "clean", use the -l (for "list") flag:
    > msplice -l movie.ts
    It checks the file (without modifying it) and reports the length of each part, and tells if any cut is not clean. If there are unclean cuts in the movie, then the -r (for "repair") flag can be used to clean it up:
    > msplice -r movie.ts
    Note that this will overwrite the original movie. If you want a cleaned copy instead, use the normal form of msplice instead:
    > msplice -o cleaned_movie.ts movie.ts


    Advanced use:


    If the task involves splitting up several movies and then merge selected parts of them, this can be done in one step:
    > msplice -o resulting_movie.ts movie1.ts:1,3 movie2.ts:4-6 movie3.ts:3,2,1
    where the numbers after the colon indicate which parts of each movie to use. If the movie names are long, and each movie has to occur at several positions in the list, then aliases can be used:
    > msplice -o resulting_movie.ts A=movie1.ts B=movie2.ts A:1 B:2 A:3-5
    where A and B can be any strings not containing colons or equal signs.


    This advanced form may not be so often useful in practice but it was fun to implement...

  • myname70 wrote:

    Zitat

    If this MovieCut version wil work on DM800 as well?


    It will work partially on DM800. There are two exceptions:
    * There may be flickering between cuts on DM800. (It is finetuned for the drivers of DM7025, and those on DM800 are different.)
    * It will not work for HD recordings. (There is currently no warning if you try, but the result will be equally large or larger than the original and unviewable.)


    I have been trying to investigate a little the last few days, to see if it is possible to solve these things, but it was harder than expected, and I can't guarantee that I succeed. I will let you know if there is any progress.


    Best Regards
    Anders Holst

  • since i don't use this plugin i did not test this, but could you test if the attached file solves the crash and works properly? just remove .txt and upload it to the plugin folder.


    *EDIT* attachment removed

    Homescreen eurer Apple-Geräte noch nicht voll genug?


    dreaMote: Fernbedienung für Dreamboxen
    Mobile WOL: Wake-on-LAN Client für iOS mit optionalem Widget
    My Home Remote: Fernkontrolle für Homematic CCU/CCU2 optimiert für mobile Benutzung

    Einmal editiert, zuletzt von ritzMo ()

  • nein, ich meinte den ordner des plugins :winking_face:


    die datei als /usr/lib/enigma2/python/Plugins/Extensions/MovieCut/plugin.py ablegen. habe übrigens eine neue oben angehangen, die alte dürfte nicht funktioniert haben :smiling_face:

    Homescreen eurer Apple-Geräte noch nicht voll genug?


    dreaMote: Fernbedienung für Dreamboxen
    Mobile WOL: Wake-on-LAN Client für iOS mit optionalem Widget
    My Home Remote: Fernkontrolle für Homematic CCU/CCU2 optimiert für mobile Benutzung

  • Yes, it seems that someone has played with the interface to eConsoleAppContainer, the class used to spawn processes in python. Without having the possibility to test it right now (I have an older version), I would also suggest something along ritzMo's solution.


    However, the difference between ritzMo's two versions was a star before self.queue[0][1] on line 236:

    Zitat

    self.container.execute(*self.queue[0][1])


    ritzMo claims this version with the star would not have worked, but it is the one of the two versions I would believe most in.


    Please test it, both with and without star, and report back, and I will be update the plugin accordingly.


    Best Regards
    Anders Holst

  • well, one of them should work - maybe i should have either tried it or kept both up... or just go the safe way and use a single argument which contains the whole command :winking_face:

    Homescreen eurer Apple-Geräte noch nicht voll genug?


    dreaMote: Fernbedienung für Dreamboxen
    Mobile WOL: Wake-on-LAN Client für iOS mit optionalem Widget
    My Home Remote: Fernkontrolle für Homematic CCU/CCU2 optimiert für mobile Benutzung

    Einmal editiert, zuletzt von ritzMo ()

  • Zitat

    or just go the safe way and use a single argument which contains the whole command


    (Note that the command contains one or more filenames, which usually contains spaces and may also contain several other strange characters with special meanings to the shell. To quote all such special characters the right way and concatenate all arguments into a string that can be correctly parsed and split up again in separate arguments by sh, seems to me like a painful and risky detour. I'm very happy that the possibility to supply several arguments instead of just one concatenated string was put back again after its one week removal. Unfortunate though that the format changed.)


    Anders

  • In CVS von Heute 19.11.2008 Ich habe diesen error


    Cutting failed for movie "007.James.Bond.Quantum.Of.Solace": Bad arguments


    ciao
    DecimaMAS


    P.S. mit "Place the cut movie in a new file ending with "cut"

    Let's all get up and dance to a song....

    Einmal editiert, zuletzt von DecimaMAS ()

  • Hello DecimaMAS and diablo7878,


    Together your bug reports make sense: It seems that there is a bug in the new eConsoleAppContainer code which swallows the first argument after the program name. I will report this bug.


    Until it is fixed, you can apply this temporary fix to MovieCut/plugin.py (which adds an extra dummy argument in the position that is removed by the bug). Please remember to remove the fix once the real bug is fixed. (MovieCut should complain with a "Bad arguments" message again when this happens, so it should be "safe", but just don't complain to me when that happens... :smiling_face:



    Best Regards
    Anders Holst

  • Hi,


    Your tools seems very usefull. Unfortunately, I always receive "Bad arguments" on DM800 (******2 3.9) (it's not an HD movie).


    Would you please let me know where you get cutlist file in mcut for options 1 or 2 ?




    regards,


    Secac3