[Support] Djoss - MKVToolNix


Recommended Posts

  • 2 weeks later...
  • 3 weeks later...
On 16.11.2017 at 10:09 PM, alturismo said:

 

really worked ;)

 

thanks ... couldnt imagine that ll help

hi, the issue with 1006 in browser still happen all the time just as note, always have to clear browser cache for this docker.

 

may an idea how to solve this ?

 

websock.js:292 WebSocket connection to 'ws://192.168.1.2:7805/websockify' failed: Error during WebSocket handshake: Unexpected response code: 502
open @ websock.js:292
_connect @ rfb.js:346
_updateState @ rfb.js:488
connect @ rfb.js:243
start @ ui.js:65
(anonymous) @ (index):64
j @ jquery.min.js?v=75e3e79854:2
k @ jquery.min.js?v=75e3e79854:2
util.js:218 WebSocket on-close event
Util.Warn @ util.js:218
(anonymous) @ rfb.js:193
(anonymous) @ websock.js:320
util.js:220  Msg: Server disconnected (code: 1006)

Link to comment
13 minutes ago, Djoss said:

Which browser are you using?  Which version and OS?

 

issue is still only in chrome, already changed from stable to beta chrome, same behavior, works on start when chrome is fresh, also works when chrome is completely cleared,

sometimes works when i only clear data from current site (F12 and hold refresh) ...

 

on vnc, edge, and guacamole (same chrome) its always good ... only direct web access on this container ending up here with this.

 

OS, win 10 x64, chrome also x64

Link to comment

In the MakeMKV support thread you told me how to call MakeMKV from within a Perl script:


 

docker exec MakeMKV env HOME=/config /opt/makemkv/bin/makemkvcon [args...]

What's the correspronding call for the tool mkvpropedit in the MKVToolNix docker? The following doesn't work:

 

docker exec MKVToolNix env HOME=/config /opt/mkvtoolnix/bin/mkvpropedit [args...]

 

Many thanks in advance.

 

 

 

Link to comment
4 hours ago, hawihoney said:

In the MakeMKV support thread you told me how to call MakeMKV from within a Perl script:


 


docker exec MakeMKV env HOME=/config /opt/makemkv/bin/makemkvcon [args...]

What's the correspronding call for the tool mkvpropedit in the MKVToolNix docker? The following doesn't work:

 


docker exec MKVToolNix env HOME=/config /opt/mkvtoolnix/bin/mkvpropedit [args...]

 

Many thanks in advance.

 

 

 

 

It is:

 

docker exec MKVToolNix /usr/bin/mkvpropedit [args...]

 

Link to comment
On 20.12.2017 at 5:23 PM, Djoss said:

What is the exact Chrome version?

When you start and it's working, what you do to make it fails?

 

currently running

 

Google Chrome ist auf dem neuesten Stand.
Version 64.0.3282.39 (Offizieller Build) beta (64-Bit)
 
but as i said, i tried crossover chrome versions ...
 
and what i do, thats my problem, i cant tell ... example, now while im typing i just opened and voila, now its working, im pretty sure, 1 - 3 days and it wont open anymore ...
without any changes to unraid, docker, ... just happens ...
all i can tell, this mashine is the "busy" one .... so alot of sites opened in browser ...
 
sorry i cant tell more about it, but i cant force the error.
Link to comment
  • 2 weeks later...
On 12/21/2017 at 3:25 PM, alturismo said:

 

currently running

 

Google Chrome ist auf dem neuesten Stand.
Version 64.0.3282.39 (Offizieller Build) beta (64-Bit)
 
but as i said, i tried crossover chrome versions ...
 
and what i do, thats my problem, i cant tell ... example, now while im typing i just opened and voila, now its working, im pretty sure, 1 - 3 days and it wont open anymore ...
without any changes to unraid, docker, ... just happens ...
all i can tell, this mashine is the "busy" one .... so alot of sites opened in browser ...
 
sorry i cant tell more about it, but i cant force the error.

Next time you reproduce the issue, can you provide content of the cookies using Chrome developer tools?

Link to comment
1 hour ago, Djoss said:

Next time you reproduce the issue, can you provide content of the cookies using Chrome developer tools?

 

it worked a few days and now it aint working anymore for a few days ;) even after reboots and so on.

 

may a hint what you could need ? no idea how to show content of the cookie ...

 

in dev console from chrome, some websocket error ... but when i now go ahead and use hostname instead ip it works ...

 

i guess may cause i have alot 192.168.1.2:xxxx adresses connecting to docker from this mashine, still should work but thats may the reason ...

cause using apache guacamole always works, vnc viewer always works, just as note ... i really have no clue and can hardly say "THEN" it is happening,

always by time after ...

 

image.png.7dd0e74c2c77b68e7ba69c72edf2d69b.pngimage.png.786608bee825d6cacdc9a5633e7ce00f.png

 

Starting UI...
util.js:218  Msg: noVNC ready: native WebSockets, canvas rendering
Util.Warn @ util.js:218
util.js:218 
Util.Warn @ util.js:218
websock.js:292 WebSocket connection to 'ws://192.168.1.2:7805/websockify' failed: Error during WebSocket handshake: Unexpected response code: 502
open @ websock.js:292
util.js:218 WebSocket on-error event
Util.Warn @ util.js:218
util.js:218 WebSocket on-close event
Util.Warn @ util.js:218
util.js:220  Msg: Server disconnected (code: 1006)
Util.Error @ util.js:220
util.js:218 
Util.Warn @ util.js:218

 

image.png.c82a6afe04c0c94918b51173738ec627.png

Link to comment
  • 4 weeks later...

I'm brand new to MKVToolNix.. never used it, but am now encountering an issue where I need to do some conversion of videos to deal with a new AV setup that can't support DTS.

 

In my search for easy ways to convert DTS to AC3, I came across this script:

https://github.com/JakeWharton/mkvdts2ac3

 

It's dependencies are ffmepg, mkvtoolnix and rsync.

 

Basically i need to be able to script this thing via command line, and being new to MKVtoolnix, I installed this container and saw it only had a GUI.  So i'm confused at how this is supposed to all work together.

 

Can anyone give me some basic pointers?

Link to comment

How are you planning to use the script?  Do you want to run the whole script inside a container or you just want mkvtoolnix executables from the container?

 

The other solution that could be easier is to use HandBrake (https://forums.lime-technology.com/topic/57420-support-handbrake/).  You could define a preset that converts DTS tracks and copy everything else.  Then you can use the watch folder to automatically convert your videos.

Link to comment
27 minutes ago, Djoss said:

How are you planning to use the script?  Do you want to run the whole script inside a container or you just want mkvtoolnix executables from the container?

 

The other solution that could be easier is to use HandBrake (https://forums.lime-technology.com/topic/57420-support-handbrake/).  You could define a preset that converts DTS tracks and copy everything else.  Then you can use the watch folder to automatically convert your videos.

 

I'm actually not sure.. i think i prefer to try to script the thing, hence how i got to that script i linked to since it takes care of so many specific DTS-->AC3 conversion issues.  My thought was to script outside of the container, but not opposed to running it from within the container.  From what I can tell, your container doesn't contain ffmpeg nor rsync which the script requires in addition to mkvtoolnix.  Wanna add them to your container? :)

 

However, I"m not opposed to using Handbrake, i didn't think it was the best thing suited for the job, but maybe I'm wrong.

 

Basically, what I want to do, is convert all my current videos that are DTS to AC3, then as I add new videos, if they have DTS, do a conversion at the time I copy into my library.

Edited by tmchow
Link to comment

Using HandBrake seems to be a solution that requires less work on your side.

 

Else, I guess you need to modify the script to invoke mkvtoolnix of the container.  For example, for mkvmerge, you could add this function:

mkvmerge() {
    docker run --rm jlesage/mkvtoolnix /usr/bin/mkvmerge "$@"
}

You also need one for mkvextract and mkvinfo.

But what about ffmpeg ?  Will you use another container for it?

Link to comment
5 hours ago, Djoss said:

Using HandBrake seems to be a solution that requires less work on your side.

 

Else, I guess you need to modify the script to invoke mkvtoolnix of the container.  For example, for mkvmerge, you could add this function:


mkvmerge() {
    docker run --rm jlesage/mkvtoolnix /usr/bin/mkvmerge "$@"
}

You also need one for mkvextract and mkvinfo.

But what about ffmpeg ?  Will you use another container for it?

 

I have ffmpeg working on my system using the ffmpeg static libraries.. wrote some shell scripts to make sure it's downloaded regularly to get updates and copies into /usr/sbin, as well as handling system reboots.  So i'm covered there.

 

With handbrake, i dug into it, and noticed you maintain a container for it, so thanks :)

 

I'm trying to do the minimum amount of work to convert the DTS to AC3 without extracting the audio, converting the audio to AC3 and then muxing the audio back to .mkv.  I've found I can easily do it with ffmpeg using command like this:

/usr/sbin/ffmpeg -i video.mkv -map 0 -vcodec copy -scodec copy -acodec ac3 -b:a 640k video-AC3.mkv

However, this doesn't handle all the possible cases, such as stuff with 6 channel DTS and mapping it to 5.1, etc etc. Hence why I found that mkvtoolnix script that everyone seems to say is the gold standard.  Dunno if handbrake is better.

 

According to this thread on github (https://github.com/HandBrake/HandBrake/issues/264), Handbrake will never just passthrough video as it's against their goals of the product. So processing video with it would take way too long since it has to transcode video.

 

If I go through the route of using the scripts and invoking it how you suggested using the mkvtoolnix container, how do I even use it? It's a super basic question and out of scope of your container since it's a separate script, but wanted to ask in case you can provide pointers. When I start your mkvtoolnix container, I see a UI and no way to use scripts or command line even so I'm a bit lost.

 

I think i'm figuring this out slowly, and thanks for the tip on writing that function to add to the original script to call into the docker container. I wouldn't have thought of that, so it's brilliantly simple to avoid massive changes throughout the entire script.

 

However, I think this might not work if I'm trying to work on a file that's outside of the container.

 

For example, if I run this command, I get an error because it can't find the file (since it sits in the unraid system, not within the container or accessible by the container). 
 

root@Tower:/boot/scripts/mkvdts2ac3# docker run --rm jlesage/mkvtoolnix /usr/bin/mkvmerge -i "test.mkv"
Error: The file 'test.mkv' could not be opened for reading: open file error.

I thought the way to do this was to add a container mapping so the docker container could access same files I'm working on outside the container.  However after mucking with this, it's not working. I realized that I don't understand the "docker run --rm" command you gave :)

 

The normal way I've run processes within a container is using this syntax:

docker exec -it <container name> <command>

 So running this works, assuming I mapped /foobar/ to the local file system so it can operate on a file.

 

docker exec -it MKVToolNix /usr/bin/mkvmerge -i "/foobar/test.mkv"

Is there a better way of doing this so I do'nt have to muck with mappings?  Ideally I want to just have the mkvmerge/mkvinfo/mkvextract to be able to run in the context of my main unraid system, as if it's not in a docker. 

 

ugh.

 

Edited by tmchow
Link to comment
5 hours ago, tmchow said:

According to this thread on github (https://github.com/HandBrake/HandBrake/issues/264), Handbrake will never just passthrough video as it's against their goals of the product. So processing video with it would take way too long since it has to transcode video.

 

Yeah sorry you are right.  Not sure why I though HandBrake has the ability to copy the video...

 

5 hours ago, tmchow said:

However, I think this might not work if I'm trying to work on a file that's outside of the container.

 

For example, if I run this command, I get an error because it can't find the file (since it sits in the unraid system, not within the container or accessible by the container). 
 


root@Tower:/boot/scripts/mkvdts2ac3# docker run --rm jlesage/mkvtoolnix /usr/bin/mkvmerge -i "test.mkv"
Error: The file 'test.mkv' could not be opened for reading: open file error.

I thought the way to do this was to add a container mapping so the docker container could access same files I'm working on outside the container.  However after mucking with this, it's not working. I realized that I don't understand the "docker run --rm" command you gave :)

 

The normal way I've run processes within a container is using this syntax:


docker exec -it <container name> <command>

 So running this works, assuming I mapped /foobar/ to the local file system so it can operate on a file.

 


docker exec -it MKVToolNix /usr/bin/mkvmerge -i "/foobar/test.mkv"

Is there a better way of doing this so I do'nt have to muck with mappings?  Ideally I want to just have the mkvmerge/mkvinfo/mkvextract to be able to run in the context of my main unraid system, as if it's not in a docker. 

 

Using "docker exec" implies that the container is running.  Since it's not something required, you can only use "docker run", which will create the container, run the command and then exit/destroy the container.  In this scenario, only the command will be executed and no long-lived processes and UI will run.

 

However, in both cases, you need to handle volume mapping.  If the script is able to work with absolute paths, you just need to use a mapping that is the same as the host.  This way, path to the file is the same on the host and inside the container.

 

For example, if the file to convert is located on the host at /mnt/user/videos/myvideo.mkv, you could use the following command:

docker run --rm -v /mnt/user/videos:/mnt/users/videos:rw jlesage/mkvtoolnix /usr/bin/mkvmerge "$@"

If you want the mapping to be more generic, you use "-v /mnt/user:/mnt/user:rw" instead.

 

Link to comment
17 hours ago, Djoss said:

 

Yeah sorry you are right.  Not sure why I though HandBrake has the ability to copy the video...

 

 

Using "docker exec" implies that the container is running.  Since it's not something required, you can only use "docker run", which will create the container, run the command and then exit/destroy the container.  In this scenario, only the command will be executed and no long-lived processes and UI will run.

 

However, in both cases, you need to handle volume mapping.  If the script is able to work with absolute paths, you just need to use a mapping that is the same as the host.  This way, path to the file is the same on the host and inside the container.

 

For example, if the file to convert is located on the host at /mnt/user/videos/myvideo.mkv, you could use the following command:


docker run --rm -v /mnt/user/videos:/mnt/users/videos:rw jlesage/mkvtoolnix /usr/bin/mkvmerge "$@"

If you want the mapping to be more generic, you use "-v /mnt/user:/mnt/user:rw" instead.

 

 

Okay.. i've gotten closer. Thanks for help so far.

 

Done some tests and the mapping trick you suggested works great.  However, when running mkvmerge, I'm getting this error:


 

mkvextract: error while loading shared libraries: libboost_regex.so.1.59.0: cannot open shared object file: No such file or directory

This is odd, because it's running from within your container right?  Shouldn't all the dependencies be working within it?

Link to comment
7 hours ago, tmchow said:

This is odd, because it's running from within your container right?  Shouldn't all the dependencies be working within it?

 

Yes it should work.  Which parameters you pass to the docker command?

 

Also, is it working if you run:

docker run --rm jlesage/mkvtoolnix /usr/bin/mkvmerge

 

Link to comment
17 hours ago, Djoss said:

 

Yes it should work.  Which parameters you pass to the docker command?

 

Also, is it working if you run:


docker run --rm jlesage/mkvtoolnix /usr/bin/mkvmerge

 

 

The mkvdts2ac3 script has a debug mode where its verbose in it's output.  Looks like mkvinfo and mkvmerge are working and it's failing at mkvextract.

 

Recall, I've added the following code in the script:

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"

mkvextract() {
    docker run --rm $MAPPINGS jlesage/mkvtoolnix /usr/bin/mkvextract "$@"
}

Running this command works to output the param list since nothing is passed in, (which is expected):

docker run --rm jlesage/mkvtoolnix /usr/bin/mkvextract

Running this also works (just wanted to test that there were no obvious issues in my syntax passing in the mappings:

docker run --rm -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 jlesage/mkvtoolnix /usr/bin/mkvextract

 

The command in the debug log of the mkvdts2ac3 script is this:

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

This results in this error:

 

mkvextract: error while loading shared libraries: libboost_regex.so.1.59.0: cannot open shared object file: No such file or directory
RESULT:DELAY=0

 

If I fully expand this factoring in my script additions to work with your docker container, I ran this and oddly it works.. this should be the exact same command that's run in the script:

docker run --rm -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 jlesage/mkvtoolnix /usr/bin/mkvextract timecodes_v2 "/mnt/user/movies-incoming/test.mkv" 1:"/mnt/user/movies-processing/test.tc"

Progress: 100%

 

No idea how to explain this...

 

---

 

Here is a full copy and paste of what's in my console when i run the script.. 

root@Tower:/mnt/user/movies-processing# /boot/scripts/mkvdts2ac3/mkvdts2ac3.sh -i -d --debug /mnt/user/movies-incoming/test.mkv
mkvdts2ac3-1.6.0 - by Jake Wharton <jakewharton@gmail.com> and
                      Chris Hoekstra <chris.hoekstra@gmail.com>

MKV FILE: /mnt/user/movies-incoming/test.mkv
DTS FILE: /mnt/user/movies-processing/test.dts
AC3 FILE: /mnt/user/movies-processing/test.ac3
TIMECODE: /mnt/user/movies-processing/test.tc
NEW FILE: /mnt/user/movies-processing/test.new.mkv
WORKING DIRECTORY: /mnt/user/movies-processing

Find first DTS track in MKV file.
> mkvmerge -i "/mnt/user/movies-incoming/test.mkv" | grep -m 1 "audio (DTS)" | cut -d : -f 1 | cut -d " " -f 3

RESULT:DTSTRACK=1

Extract track information for selected DTS track.
> mkvinfo "/mnt/user/movies-incoming/test.mkv"

RESULT:INFO=
|  + Track number: 1 (track ID for mkvmerge & mkvextract: 0)
|  + Track UID: 1
|  + Track type: video
|  + Enabled: 1
|  + Default track flag: 1
|  + Forced track flag: 0
|  + Lacing flag: 0
|  + Minimum cache: 1
|  + Timestamp scale: 1
|  + Maximum block additional ID: 0
|  + Codec ID: V_MPEG4/ISO/AVC
|  + Codec decode all: 1
|  + Codec's private data: size 42 (h.264 profile: High @L4.1)
|  + Default duration: 00:00:00.041708299 (23.976 frames/fields per second for a video track)
|  + Language: eng
|  + Name: Video: x264_L4.1 @ 7183 Kbps
|  + Video track
|   + Pixel width: 1280
|   + Pixel height: 534
|   + Interlaced: 0
|   + Display width: 1280
|   + Display height: 534
| + Track
|  + Track number: 2 (track ID for mkvmerge & mkvextract: 1)

Extract language from track info.
> echo "$INFO" | grep -m 1 \"Language\" | cut -d \" \" -f 5

RESULT:DTSLANG=eng

Extract name for selected DTS track. Change DTS to AC3 and update bitrate if present.
> echo "$INFO" | grep -m 1 "Name" | cut -d " " -f 5- | sed "s/DTS/AC3/" | awk '{gsub(/[0-9]+(\.[0-9]+)?(M|K)bps/,448Kbps)}1'

RESULT:DTSNAME=Video: x264_L4.1 @ 7183 Kbps

Extract timecode information for the audio track.
> mkvextract timecodes_v2 "/mnt/user/movies-incoming/test.mkv" 1:"/mnt/user/movies-processing/test.tc"
> sed -n "2p" "/mnt/user/movies-processing/test.tc"
> rm -f "/mnt/user/movies-processing/test.tc"

Extracting Timecodes:
mkvextract: error while loading shared libraries: libboost_regex.so.1.59.0: cannot open shared object file: No such file or directory
RESULT:DELAY=0

 

Edited by tmchow
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.