[bash] autsmuxer - mkv2vob for *nix.

Come up with a useful post-processing script? Share it here!
sweetie
Full Member
Full Member
Posts: 117
Joined: May 10th, 2009, 10:47 am

[bash] autsmuxer - mkv2vob for *nix.

Post 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.
Last edited by sweetie on June 6th, 2012, 2:40 pm, edited 3 times in total.
gazzzmoly
Release Testers
Release Testers
Posts: 27
Joined: May 15th, 2009, 9:46 am

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

Post 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
sweetie
Full Member
Full Member
Posts: 117
Joined: May 10th, 2009, 10:47 am

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

Post 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.
Last edited by sweetie on February 14th, 2011, 11:28 am, edited 1 time in total.
gazzzmoly
Release Testers
Release Testers
Posts: 27
Joined: May 15th, 2009, 9:46 am

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

Post by gazzzmoly »

hi sweetie ,


getting an incompatable audio codec error again ! ac_3 6 channel
owine
Newbie
Newbie
Posts: 8
Joined: November 30th, 2009, 8:03 pm

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

Post 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.
owine
Newbie
Newbie
Posts: 8
Joined: November 30th, 2009, 8:03 pm

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

Post 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.
sweetie
Full Member
Full Member
Posts: 117
Joined: May 10th, 2009, 10:47 am

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

Post 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 $(*).)
Last edited by sweetie on June 29th, 2010, 10:09 am, edited 1 time in total.
owine
Newbie
Newbie
Posts: 8
Joined: November 30th, 2009, 8:03 pm

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

Post 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.
sweetie
Full Member
Full Member
Posts: 117
Joined: May 10th, 2009, 10:47 am

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

Post 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.
Jeegan
Newbie
Newbie
Posts: 11
Joined: November 28th, 2010, 9:13 pm

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

Post 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.
Last edited by Jeegan on November 28th, 2010, 9:58 pm, edited 1 time in total.
sweetie
Full Member
Full Member
Posts: 117
Joined: May 10th, 2009, 10:47 am

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

Post 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.
Last edited by sweetie on November 29th, 2010, 6:20 am, edited 1 time in total.
Jeegan
Newbie
Newbie
Posts: 11
Joined: November 28th, 2010, 9:13 pm

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

Post 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?
sweetie
Full Member
Full Member
Posts: 117
Joined: May 10th, 2009, 10:47 am

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

Post 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.
Jeegan
Newbie
Newbie
Posts: 11
Joined: November 28th, 2010, 9:13 pm

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

Post 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.
Jeegan
Newbie
Newbie
Posts: 11
Joined: November 28th, 2010, 9:13 pm

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

Post 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.
Post Reply