[Support] Djoss - MKVToolNix


Recommended Posts

Since it's working when yo manually invoke mkvextract, the script is probably not using the function you defined, but the binary on your system (I assume one exist?).

 

When you look at the script, mkvextract is invoked like this:

nice -n $PRIORITY mkvextract timecodes_v2 "$MKVFILE" $DTSTRACK:"$TCFILE"

Try to remove the "nice -n $PRIORITY" and I'm pretty sure it will start to work.

Link to comment
5 hours ago, Djoss said:

Since it's working when yo manually invoke mkvextract, the script is probably not using the function you defined, but the binary on your system (I assume one exist?).

 

When you look at the script, mkvextract is invoked like this:


nice -n $PRIORITY mkvextract timecodes_v2 "$MKVFILE" $DTSTRACK:"$TCFILE"

Try to remove the "nice -n $PRIORITY" and I'm pretty sure it will start to work.

 

Your comment just reminded me that I tried installing mkvtoolnix as a package on unraid before I went down this path with your container,... I did indeed have mkvextract and other mkvtoolnix apps in /usr/bin, so i deleted all of them.

 

Now when I run the following, it's confirmed its' not on my system:

root@Tower:/mnt/user/movies-incoming# which mkvextract
which: no mkvextract in (.:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin)

Now when I run the script for this line that's trying to be run:

mkvextract timecodes_v2 "/mnt/user/movies-incoming/test.mkv" 1:"/mnt/user/movies-processing/test.tc"

I then got this:

nice: ‘mkvextract’: No such file or directory

I can't help but think that my manual deletion of mkvextract caused this becuase I didn't formally remove the package some other way?  (For reference, I tried installing the mkvtoolnix slckware package originally before your docker with the "installpkg" command).

 

Given this, I found the mkvtoolnix package names I installed in /var/log/packages, then ran removepkg and it seemed to successfully run. But no change in the error I'm getting above about "no such file or directory".

 

I then tried remove the "nice -n $PRIORITY" prefix you mentioned, and it worked!

 

My assumption is the way the command is run, my function isn't being called to substitute in the docker command. Is that right?

Edited by tmchow
Link to comment
23 minutes ago, tmchow said:

My assumption is the way the command is run, my function isn't being called to substitute in the docker command. Is that right?

Correct, the "mkvextract" becomes a parameter passed to the nice command instead of being a function call.

Link to comment
12 minutes ago, tmchow said:

 

Would you recommend trying to get this to work with nice within the container? Or is that irrelevant since it's within a docker?

I guess it depends if you care about adjusting the priority of mkvextract...  If you do, you can just move "nice -n $PRIORITY" in front of "docker run" calls.

 

Also, if you prefer not modifying the script, the other solution is to move the mkv* functions into separate scripts.  For example, you could add a script named "mkvextract" with the following content:

#!/bin/sh
MAPPINGS="-v /mnt/user/movies-processing:/mnt/user/movies-processing:rw -v /mnt/user/media-movies:/mnt/user/media-movies:rw -v /mnt/user/movies-incoming:/mnt/user/movies-incoming:rw"
docker run --rm $MAPPINGS jlesage/mkvtoolnix /usr/bin/mkvextract "$@"

Then just make the file executable and make sure it's inside your "$PATH".

 

Link to comment

@DjossYou've been super helpful.. I almost have everything working.  I have a question about mkvmerge and the "--track-order" argument that I'm hoping you can explain to me.

 

The script is supposed to be putting the AC3 track that's being remuxed into a new video as the first track after the video track (so the second track).  However, in my testing it looks like it's being put as the first track.  

 

The script checks for an argument that's passed in which sets `$INITIAL=1`, which then adds this argument to be invoked with `mkvmerge`:

 

        # Puts the AC3 track as the second in the file if indicated as initial
        if [ $INITIAL = 1 ]; then
                CMD="$CMD --track-order 0:1,1:0"
        fi

The full mkvmerge command that's being run is effectively the following, running on /mnt/user/movie/foo.mkv

mkvmerge --track-order 0:1,1:0 -o "/mnt/user/movie/foo.new.mkv" -a "1,2" --compression 1:none --compression 2:none --compression 0:none "/mnt/user/movie/foo.mkv" --default-track 0 --language 0:DTSLANG --track-name 0:"DTSNAME" --sync 0:DELAY --compression 0:none "/mnt/user/movie/foo.ac3"

 can't seem to find any coherent explanations how this argument works.   The MKVToolNix documentation isn't clear enough (to me) in its explanation as i look through the invocation since I can't tell what is being referenced as the "files".

 

Quote

"This option changes the order in which the tracks for an input file are created. The argument is a comma separated list of pairs IDs. Each pair contains first the file ID (FID1) which is simply the number of the file on the command line starting at 0. The second is a track ID (TID1) from that file. If some track IDs are omitted then those tracks are created after the ones given with this option have been created."

 

Edited by tmchow
Link to comment
18 hours ago, Djoss said:

From what I understand, it should take track #1 from "/mnt/user/movie/foo.mkv" followed by track #0 from "/mnt/user/movie/foo.ac3" (i.e. the audio track itself).

 

Did you check if the video has really the id 1 in /mnt/user/movie/foo.mkv?


Oh interesting.. it looks like most of the videos will have the video track as the FIRST track, so track #0.

 

So given that, it seems like 

--track-order 0:1,1:0

should be

--track-order 0:0,1:0

?

Link to comment
18 hours ago, tmchow said:

 

Oh interesting.. it looks like most of the videos will have the video track as the FIRST track, so track #0.

 

So given that, it seems like 


--track-order 0:1,1:0

should be


--track-order 0:0,1:0

?

 

Yes, it worth a try...!

Link to comment
  • 3 months later...
7 hours ago, mkono87 said:

hey,

 

I just installed in docker but when I open the webUI all i get is a white screen and it saying server disconnected.

Can you try to clear your browser's cache?  Do you have the same behavior with a different browser?

Link to comment
  • 2 months later...
  • 2 weeks later...
  • 4 months later...

Thanks again for this great docker.

 

Yesterday i realize that there is a problem with existing turkish characters on files and folders. I can type turkish chars without problem. But cant see and cant work with files and folders that have turkish chars in it.

I think this problem poped up after a update because i use this docker since the beginnig.

Can your last update cause this?

snap.png

Link to comment
3 hours ago, ikosa said:

Thanks again for this great docker.

 

Yesterday i realize that there is a problem with existing turkish characters on files and folders. I can type turkish chars without problem. But cant see and cant work with files and folders that have turkish chars in it.

I think this problem poped up after a update because i use this docker since the beginnig.

Can your last update cause this?

snap.png

Yes this is a known issue.  This is due to a change done in MKVToolNix version 29.0.0.

I will push an updated version of the container image that fixes this problem. 

Link to comment
  • 6 months later...
6 hours ago, Sophware said:

I just installed this docker. Thanks for supporting it.

 

When I open the GUI, I can't type in it. I can't change preferences like the command line options. I can't edit headers. Etc..

Did you try with another browser and/or from another device?

Link to comment
  • 5 months later...
  • 3 weeks later...

Hi guys, I recently have a problem with this container. I get the "could not be opened for writing: Open file error" error but always after it did one job without error.

When I restart the container, I'm able to get another job done before getting the error again with the next one. Have you any suggestions?

I reinstalled the docker several times, I checked permissions (but that couldn't be the problem because the first job after restart works even with the file that didn't work before) and I have no clue what to do. Thanks in advance

Link to comment
On 1/8/2020 at 1:00 PM, hschocker said:

Hi guys, I recently have a problem with this container. I get the "could not be opened for writing: Open file error" error but always after it did one job without error.

When I restart the container, I'm able to get another job done before getting the error again with the next one. Have you any suggestions?

I reinstalled the docker several times, I checked permissions (but that couldn't be the problem because the first job after restart works even with the file that didn't work before) and I have no clue what to do. Thanks in advance

Do you have anything in the container's log?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.