Page 1 of 6

[bash] autsmuxer - mkv2vob for *nix.

Posted: June 6th, 2010, 9:35 am
by sweetie
Hi,

autsmuxer is a mkv2vob CLI clone for *nix.

https://github.com/dryes/autsmuxer

## dependencies:

* libdca - http://www.videolan.org/developers/libdca.html
* mkvtoolnix - http://www.bunkus.org/videotools/mkvtoolnix/index.html
* mencoder - http://www.mplayerhq.hu/
* aften - http://aften.sourceforge.net/
* tsMuxeR - http://www.smlabs.net/tsmuxer_en.html
* spdifconvert - http://forums.slimdevices.com/showthread.php?t=19260

## usage:

* Install all dependencies, ensuring they are in $PATH.
* bash autsmuxer.sh [-options] inputfile/dir.

## notes:

* mkvtoolnix must be >5.4.0.
* DTS audio is converted to AC3 unless '--dts 1' is passed.

Re: [LiNUX/OSX - bash] MediaMux [v4 - Join multi-part AVI + Remux MKV to M2TS.]

Posted: June 9th, 2010, 10:37 am
by gazzzmoly
And could you please give step by step instructions for us stupid people.(please)      Also can this be used to make .mp4 instead of m2ts

Re: [LiNUX/OSX/BSD - bash] autsmuxer [v4 - MKV2VOB for *NiX]

Posted: June 9th, 2010, 12:54 pm
by sweetie
Once you've followed instructions in original post under HOWTO* (substituting /path/to with your actual path) you could:


(* and tested with: autsmuxer /empty/directory - will inform you of any packages required.)



If calling as a post-processor in SAB:

1) Create blank text file.

2) Paste in:

Code: Select all

#!/bin/bash

## $1 is download directory.
cd "$1"

## $5 is category. x264 TV category is named 'tv-x264'
if [ "$5" = "tv-x264" ]; then

        ## Change /path/to/autsmuxer.sh to correspond with your own path.
	
        bash /path/to/autsmuxer.sh -d "$1"
     
        ##    -d switch will remove input files.
        ##    -R switch will search subdirs for MKVs.
fi

        ##   Repeat for other categories.
3) Save text file as: pp_autsmuxer.sh

4) In terminal: chmod +x pp_autsmuxer.sh

5) Move script to SABnzbd script dir.

6) In SAB: Categories >> tv-x264 >> script: pp_autsmuxer.sh



Regarding MP4, see: mkv2mp4
autsmuxer script is designed with PS3 in mind, which supports multi-channel AC3 and DTS.
mkv2mp4 script transcodes and downmixes audio to AAC stereo - for Xbox360.




Any more queries, feel free to ask.

Re: [LiNUX/OSX/BSD - bash] MediaMux [v4 - Join multi-part AVI + Remux MKV to M2TS.]

Posted: June 10th, 2010, 1:07 pm
by gazzzmoly
hi sweetie ,


getting an incompatable audio codec error again ! ac_3 6 channel

Re: [LiNUX/OSX/BSD - bash] MediaMux [v4 - Join multi-part AVI + Remux MKV to M2TS.]

Posted: June 28th, 2010, 2:29 am
by owine
This looks like a great script.

I'm unfamiliar with scripting for SAB, so a bit more detail on customizing the script would be appreciated otherwise I may never get this to work.

Re: [LiNUX/OSX/BSD - bash] MediaMux [v4 - Join multi-part AVI + Remux MKV to M2TS.]

Posted: June 28th, 2010, 2:34 am
by owine
I am running OS X, and I've noticed issues when there are spaces in the path to the MKVs. Not sure how easy of a fix this is, but it would be a greatly appreciated one.

Re: [LiNUX/OSX/BSD - bash] MediaMux [v4 - Join multi-part AVI + Remux MKV to M2TS.]

Posted: June 28th, 2010, 9:32 am
by sweetie
It could be possible that the spaces are what was causing gazzzmoly issues. (I've noticed in logs that they're preceded by a backslash (escape key.).)

I'm not overly familiar with OSX, and haven't my laptop to hand so can't test under Linux, but you could try for calling:

Code: Select all

bash "/path/to/script.sh" -m "$(echo $1 | tr -d '\\')"
-Where $1 is input dir. if not calling from a SAB processor script.


(Can try with both double and a single backslash after the '-d'.

Also, can try with and without " around the $(*).)

Re: [LiNUX/OSX/BSD - bash] MediaMux [v4 - Join multi-part AVI + Remux MKV to M2TS.]

Posted: July 3rd, 2010, 6:03 pm
by owine
Swish:~ owine$ bash Useful\ Stuff/mediamux.sh  -m $(echo /Users/owine/Downloads/USENET/Movies/Avatar (2009)/ | tr -d '\\')
-bash: command substitution: line 1: syntax error near unexpected token `('
-bash: command substitution: line 1: `echo /Users/owine/Downloads/USENET/Movies/Avatar (2009)/ | tr -d '\\''

@@ No input directory specified.

Re: [LiNUX/OSX/BSD - bash] MediaMux [v4 - Join multi-part AVI + Remux MKV to M2TS.]

Posted: July 3rd, 2010, 6:18 pm
by sweetie
Oh, of course. Backslashes won't be there when typed.


Not to sound patronising, but tried paths (without echo | tr) inside quotes?

That's all I can think of just now.


If you pop on SABnzbd IRC we can try sort it there.

Re: [LiNUX/OSX/BSD - bash] MediaMux [v4 - MKV to TS/M2TS/BluRay/AVCHD/Demux + AVI..]

Posted: November 28th, 2010, 9:26 pm
by Jeegan
Has anyone had any luck setting this script up to run in SABNZB? I created the pp_mediamux.sh script and set it up to run in SABNZB but it just says it cannot run the script. Any ideas? TIA.

Oh yeah, I am running OSX 10.6.

Re: [LiNUX/OSX/BSD - bash] MediaMux [v4 - MKV to TS/M2TS/BluRay/AVCHD/Demux + AVI..]

Posted: November 29th, 2010, 6:16 am
by sweetie
Jeegan: did you set the path in pp_mediamux.sh in double quotes? e.g. "/home/jeegan/sh scripts/mediamux.sh"

Also be sure to set execute bit for both scripts:
chmod +x script_filename.sh

- Script definitely does run under OSX btw. Just not particularly user friendly.

Let me know how it goes.

Re: [LiNUX/OSX/BSD - bash] MediaMux [v4 - MKV to TS/M2TS/BluRay/AVCHD/Demux + AVI..]

Posted: November 29th, 2010, 9:09 am
by Jeegan
Sweetie,

I did all of that. I just seem to get an error from SABNZB saying it can't run the script. Any other ideas of that might cause that? Could this be the issue that owine was having, that it spaces in the directory name are causing a problem?

Re: [LiNUX/OSX/BSD - bash] MediaMux [v4 - MKV to TS/M2TS/BluRay/AVCHD/Demux + AVI..]

Posted: November 30th, 2010, 3:16 pm
by sweetie
I'm not sure. If memory serves, owine was able to run the script eventually, though can't recall the steps taken to fix.


For now, all I can suggest is trying to process manually, by:
bash "/path/to/mediamux.sh" -m "/folder/with/MKV/inside"

Can rule out issues with the script that way.

Re: [LiNUX/OSX/BSD - bash] MediaMux [v4 - MKV to TS/M2TS/BluRay/AVCHD/Demux + AVI..]

Posted: November 30th, 2010, 8:16 pm
by Jeegan
Right, when I run the mediamux.sh script manually, it works perfect. I would just like to have SABNZB run it for me. But yeah, the script works great when I run it. Thank you for your help though.

Re: [LiNUX/OSX/BSD - bash] MediaMux [v4 - MKV to TS/M2TS/BluRay/AVCHD/Demux + AVI..]

Posted: December 3rd, 2010, 5:45 pm
by Jeegan
Ok, figured out why SABNZB couldn't run the script. I didn't create it correctly. Fixed that, but I have a question about mediamux.sh in general. It seems like when I have .mkv files with multiple audio streams, I can't seem to choose anything except for the default track 2. When I try to specify with --m-atrack 3, I get incompatible audio codec found. This seems to be the case with any .mkv that has multiple tracks. Is it just me not knowing what I am doing? Also, is there a way to get the script to delete the old .mkv file after conversion? Sorry for all of the newb questions. Thank you for your help.