[PP-Script] mkvdts2ac3 - how to make this nzbget script?

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
clintonhall
Posts: 449
Joined: 15 Dec 2012, 01:52
Location: Australia
Contact:

Re: [PP-Script] mkvdts2ac3 - how to make this nzbget script?

Post by clintonhall » 05 Dec 2013, 19:41

Is there any file in /mnt/disk1/share/test/
If so, what is it called?

It should be creating the new mkv there, and then moving this to the original file location... But the newly remuxed appears no to be where the script thinks it is!

Does the user that is running this script (running nzbget) have full write permissions in /mnt/disk1/share/test/?

jackiass2
Posts: 42
Joined: 19 Nov 2013, 12:07

Re: [PP-Script] mkvdts2ac3 - how to make this nzbget script?

Post by jackiass2 » 05 Dec 2013, 20:08

Ups! I forgot to run nzbget in server mode! After doing that, I end up with these files in the temp folder:

Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.ac3
Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.dts
Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.tc

The tc is a small time code file.

In the destination folder I have:
136.out.tmp
Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.par2

The tmp file is NOT being created when I run nzbget in deamon mode. Output from the log now reads:

Code: Select all

error	Thu Dec 05 2013 21:04:43	Post-process-script mkvdts2ac3/mkvdts2ac3-2.py for Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample failed (terminated with unknown status)
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: IOError: [Errno 2] No such file or directory: '/mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv'
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: with open(src, 'rb') as fsrc:
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: File "/opt/lib/python2.7/shutil.py", line 82, in copyfile
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: copyfile(src, dst)
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: File "/opt/lib/python2.7/shutil.py", line 128, in copy2
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: copy2(src, real_dst)
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: File "/opt/lib/python2.7/shutil.py", line 299, in move
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: shutil.move(tempnewmkvfile, ford)
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: File "/mnt/disk1/share/nzbget/ppscripts/mkvdts2ac3/mkvdts2ac3-2.py", line 808, in process
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: process(os.path.join(ford, f))
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: File "/mnt/disk1/share/nzbget/ppscripts/mkvdts2ac3/mkvdts2ac3-2.py", line 838, in <module>
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: Traceback (most recent call last):
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: sample.mkv
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: /mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: sample.ac3 -o
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: /mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: --compression 0:
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: 0:"Antiviral.2012.BluRay.720p.AC3.x264-CHD" --sync 0:6
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: --language 0:eng --track-name
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: -CHD-sample/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: /mnt/disk1/share/_Complete/Antiviral.2012.BluRay.720p.DTS.x264
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: mkvmerge --compression 1:
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: Running command:
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: Remuxing AC3 into MKV [4/4]...
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: sample.ac3
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: /mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: sample.dts -acodec ac3 -ac 2 -ab 448k
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: /mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: ffmpeg -y -i
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: Running command:
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: Converting DTS to AC3 [3/4]...
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: sample.dts
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: 2:/mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: -CHD-sample/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: /mnt/disk1/share/_Complete/Antiviral.2012.BluRay.720p.DTS.x264
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: mkvextract tracks
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: Running command:
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: Extracting DTS track [2/4]...
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: sample.tc
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: 2:/mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: -CHD-sample/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: /mnt/disk1/share/_Complete/Antiviral.2012.BluRay.720p.DTS.x264
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: mkvextract timecodes_v2
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: Running command:
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: Extracting Timecodes [1/4]...
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: filename: Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: Processing file: /mnt/disk1/share/_Complete/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: Processing file: /mnt/disk1/share/_Complete/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample/136.out.tmp
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: Processing file: /mnt/disk1/share/_Complete/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.par2
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: Error: Invalid compression option. No track ID specified in '--compression 1:'.
info	Thu Dec 05 2013 21:04:43	mkvdts2ac3-2: mkvmerge v4.2.0 ('No Talking') built on Feb 14 2012 14:16:48
info	Thu Dec 05 2013 21:04:42	mkvdts2ac3-2: video:0kB audio:2749kB global headers:0kB muxing overhead 0.000000%
info	Thu Dec 05 2013 21:04:42	mkvdts2ac3-2: bitrate= 448.1kbits/s size= 2389kB time=00:00:43.67 bitrate= 448.1kbits/s size= 2404kB time=00:00:43.96 bitrate= 448.1kbits/s size= 2417kB time=00:00:44.18 bitrate= 448.1kbits/s size= 2424kB time=00:00:44.31 bitrate= 448.1kbits/s size= 2436kB time=00:00:44.53 bitrate= 448.1kbits/s size= 2445kB time=00:00:44.69 bitrate= 448.1kbits/s size= 2457kB time=00:00:44.92 bitrate= 448.1kbits/s size= 2468kB time=00:00:45.11 bitrate= 448.1kbits/s size= 2478kB time=00:00:45.30 bitrate= 448.1kbits/s size= 2487kB time=00:00:45.46 bitrate= 448.1kbits/s size= 2496kB time=00:00:45.62 bitrate= 448.1kbits/s size= 2508kB time=00:00:45.85 bitrate= 448.1kbits/s size= 2522kB time=00:00:46.10 bitrate= 448.1kbits/s size= 2536kB time=00:00:46.36 bitrate= 448.1kbits/s size= 2550kB time=00:00:46.61 bitrate= 448.1kbits/s size= 2566kB time=00:00:46.90 bitrate= 448.1kbits/s size= 2576kB time=00:00:47.09 bitra
info	Thu Dec 05 2013 21:04:27	mkvdts2ac3-2: size= 12kB time=00:00:00.21 bitrate= 458.9kbits/s size= 26kB time=00:00:00.47 bitrate= 453.0kbits/s size= 40kB time=00:00:00.73 bitrate= 451.3kbits/s size= 56kB time=00:00:01.01 bitrate= 450.3kbits/s size= 72kB time=00:00:01.30 bitrate= 449.8kbits/s size= 82kB time=00:00:01.49 bitrate= 449.6kbits/s size= 96kB time=00:00:01.75 bitrate= 449.4kbits/s size= 112kB time=00:00:02.04 bitrate= 449.2kbits/s size= 126kB time=00:00:02.29 bitrate= 449.0kbits/s size= 140kB time=00:00:02.55 bitrate= 448.9kbits/s size= 156kB time=00:00:02.84 bitrate= 448.8kbits/s size= 166kB time=00:00:03.03 bitrate= 448.8kbits/s size= 182kB time=00:00:03.32 bitrate= 448.7kbits/s size= 198kB time=00:00:03.61 bitrate= 448.7kbits/s size= 212kB time=00:00:03.86 bitrate= 448.6kbits/s size= 228kB time=00:00:04.15 bitrate= 448.6kbits/s size= 236kB time=00:00:04.31 bitrate= 448.6kbits/s size=
info	Thu Dec 05 2013 21:02:58	mkvdts2ac3-2: Press [q] to stop, [?] for help
info	Thu Dec 05 2013 21:02:58	mkvdts2ac3-2: Stream #0:0 -> #0:0 (dca -> ac3)
info	Thu Dec 05 2013 21:02:58	mkvdts2ac3-2: Stream mapping:
info	Thu Dec 05 2013 21:02:58	mkvdts2ac3-2: Stream #0:0: Audio: ac3, 48000 Hz, stereo, flt, 448 kb/s
info	Thu Dec 05 2013 21:02:58	mkvdts2ac3-2: encoder : Lavf54.6.100
info	Thu Dec 05 2013 21:02:58	mkvdts2ac3-2: Metadata:
info	Thu Dec 05 2013 21:02:58	mkvdts2ac3-2: Output #0, ac3, to '/mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.ac3':
info	Thu Dec 05 2013 21:02:57	mkvdts2ac3-2: [aresample @ 0x100b610] chl:5.1(side) fmt:s16 r:48000Hz -> chl:stereo fmt:flt r:48000Hz
info	Thu Dec 05 2013 21:02:57	mkvdts2ac3-2: [aformat @ 0x1020b50] auto-inserting filter 'auto-inserted resampler 0' between the filter 'src' and the filter 'aformat'
info	Thu Dec 05 2013 21:02:57	mkvdts2ac3-2: Stream #0:0: Audio: dts (DTS), 48000 Hz, 5.1(side), s16, 1536 kb/s
info	Thu Dec 05 2013 21:02:57	mkvdts2ac3-2: Duration: 00:00:49.37, start: 0.000000, bitrate: 1536 kb/s
info	Thu Dec 05 2013 21:02:57	mkvdts2ac3-2: Input #0, dts, from '/mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.dts':
info	Thu Dec 05 2013 21:02:57	mkvdts2ac3-2: [dts @ 0xff83c0] Estimating duration from bitrate, this may be inaccurate
info	Thu Dec 05 2013 21:02:57	mkvdts2ac3-2: [dts @ 0xff83c0] max_analyze_duration 5000000 reached at 5002667
info	Thu Dec 05 2013 21:02:55	mkvdts2ac3-2: libpostproc 52. 0.100 / 52. 0.100
info	Thu Dec 05 2013 21:02:55	mkvdts2ac3-2: libswresample 0. 15.100 / 0. 15.100
info	Thu Dec 05 2013 21:02:55	mkvdts2ac3-2: libswscale 2. 1.100 / 2. 1.100
info	Thu Dec 05 2013 21:02:55	mkvdts2ac3-2: libavfilter 2. 77.100 / 2. 77.100
info	Thu Dec 05 2013 21:02:55	mkvdts2ac3-2: libavdevice 54. 0.100 / 54. 0.100
info	Thu Dec 05 2013 21:02:55	mkvdts2ac3-2: libavformat 54. 6.100 / 54. 6.100
info	Thu Dec 05 2013 21:02:55	mkvdts2ac3-2: libavcodec 54. 23.100 / 54. 23.100
info	Thu Dec 05 2013 21:02:55	mkvdts2ac3-2: libavutil 51. 54.100 / 51. 54.100
info	Thu Dec 05 2013 21:02:55	mkvdts2ac3-2: configuration: --prefix=/opt --extra-cflags=-I/opt/include --extra-ldflags=-L/opt/lib --enable-static --disable-shared --enable-libmp3lame --enable-libx264 --enable-gpl --enable-pthreads --disable-ffplay --disable-ffserver
info	Thu Dec 05 2013 21:02:55	mkvdts2ac3-2: built on Jul 23 2012 18:47:09 with gcc 4.2.3
info	Thu Dec 05 2013 21:02:55	mkvdts2ac3-2: ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers
info	Thu Dec 05 2013 21:02:54	mkvdts2ac3-2: Progress: 3% Progress: 6% Progress: 9% Progress: 12% Progress: 15% Progress: 19% Progress: 22% Progress: 25% Progress: 28% Progress: 32% Progress: 35% Progress: 39% Progress: 42% Progress: 46% Progress: 49% Progress: 50% Progress: 54% Progress: 57% Progress: 61% Progress: 64% Progress: 68% Progress: 68% Progress: 72% Progress: 75% Progress: 79% Progress: 82% Progress: 85% Progress: 88% Progress: 92% Progress: 95% Progress: 99% Progress: 99% Progress: 100%
info	Thu Dec 05 2013 21:02:51	mkvdts2ac3-2: Extracting track 2 with the CodecID 'A_DTS' to the file '/mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.dts'. Container format: Digital Theater System (DTS)
info	Thu Dec 05 2013 21:02:50	mkvdts2ac3-2: Progress: 0% Progress: 3% Progress: 6% Progress: 9% Progress: 12% Progress: 15% Progress: 19% Progress: 22% Progress: 25% Progress: 28% Progress: 32% Progress: 35% Progress: 39% Progress: 42% Progress: 46% Progress: 49% Progress: 50% Progress: 54% Progress: 57% Progress: 61% Progress: 64% Progress: 68% Progress: 68% Progress: 72% Progress: 75% Progress: 79% Progress: 82% Progress: 85% Progress: 88% Progress: 92% Progress: 95% Progress: 99% Progress: 100%
info	Thu Dec 05 2013 21:02:35	Executing post-process-script mkvdts2ac3/mkvdts2ac3-2.py for Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample
Looks like it's still choking at the same point.

For kicks here is how it looks when I run the script manually:

Code: Select all

root@Nas:~# /mnt/disk1/share/nzbget/ppscripts/mkvdts2ac3/mkvdts2ac3-2.py -n -r -vvv -w /mnt/disk1/share/test/ /mnt/disk1/share/_Complete/dts.mkv
    Processing file: /mnt/disk1/share/_Complete/dts.mkv
filename: dts.mkv
  Extracting Timecodes  [1/4]...
    Running command:
      mkvextract timecodes_v2 /mnt/disk1/share/_Complete/dts.mkv
      2:/mnt/disk1/share/test/dts.tc
Progress: 100%
  Extracting DTS track  [2/4]...
    Running command:
      mkvextract tracks /mnt/disk1/share/_Complete/dts.mkv
      2:/mnt/disk1/share/test/dts.dts
Extracting track 2 with the CodecID 'A_DTS' to the file '/mnt/disk1/share/test/dts.dts'. Container format: Digital Theater System (DTS)
Progress: 100%
  Converting DTS to AC3 [3/4]...
    Running command:
      ffmpeg -y -i /mnt/disk1/share/test/dts.dts -acodec ac3 -ac 6 -ab
      448k /mnt/disk1/share/test/dts.ac3
ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jul 23 2012 18:47:09 with gcc 4.2.3
  configuration: --prefix=/opt --extra-cflags=-I/opt/include --extra-ldflags=-L/opt/lib --enable-static --disable-shared --enable-libmp3lame --enable-libx264 --enable-gpl --enable-pthreads --disable-ffplay --disable-ffserver
  libavutil      51. 54.100 / 51. 54.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[dts @ 0xff83c0] max_analyze_duration 5000000 reached at 5002667
[dts @ 0xff83c0] Estimating duration from bitrate, this may be inaccurate
Input #0, dts, from '/mnt/disk1/share/test/dts.dts':
  Duration: 00:00:49.37, start: 0.000000, bitrate: 1536 kb/s
    Stream #0:0: Audio: dts (DTS), 48000 Hz, 5.1(side), s16, 1536 kb/s
[aformat @ 0x101f2a0] auto-inserting filter 'auto-inserted resampler 0' between the filter 'src' and the filter 'aformat'
[aresample @ 0x100ce20] chl:5.1(side) fmt:s16 r:48000Hz -> chl:5.1 fmt:flt r:48000Hz
Output #0, ac3, to '/mnt/disk1/share/test/dts.ac3':
  Metadata:
    encoder         : Lavf54.6.100
    Stream #0:0: Audio: ac3, 48000 Hz, 5.1, flt, 448 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (dca -> ac3)
Press [q] to stop, [?] for help
size=    2749kB time=00:00:50.26 bitrate= 448.0kbits/s    
video:0kB audio:2749kB global headers:0kB muxing overhead 0.000000%
  Remuxing AC3 into MKV [4/4]...
    Running command:
      mkvmerge -A --compression 1:none
      /mnt/disk1/share/_Complete/dts.mkv --language 0:eng --track-name
      0:"Antiviral.2012.BluRay.720p.AC3.x264-CHD" --sync 0:6
      --compression 0:none /mnt/disk1/share/test/dts.ac3 -o
      /mnt/disk1/share/test/dts.mkv
mkvmerge v4.2.0 ('No Talking') built on Feb 14 2012 14:16:48
'/mnt/disk1/share/_Complete/dts.mkv': Using the Matroska demultiplexer.
'/mnt/disk1/share/test/dts.ac3': Using the AC3 demultiplexer.
'/mnt/disk1/share/_Complete/dts.mkv' track 1: Using the MPEG-4 part 10 (AVC) video output module.
'/mnt/disk1/share/test/dts.ac3' track 0: Using the AC3 output module.
The file '/mnt/disk1/share/test/dts.mkv' has been opened for writing.
Progress: 100%
The cue entries (the index) are being written...
Muxing took 28 seconds.
  dts.mkv finished in: 2 minutes 56 seconds
Total Time: 2 minutes 57 secondsroot@Nas:~#
In this case it creates the dts.mkv file as the last step in the test folder before it overwrites the original with the new mkv and cleans up the testing folder.

clintonhall
Posts: 449
Joined: 15 Dec 2012, 01:52
Location: Australia
Contact:

Re: [PP-Script] mkvdts2ac3 - how to make this nzbget script?

Post by clintonhall » 06 Dec 2013, 01:15

interesting... I think the issue here is that when called from NZBGet the environment is missing something that is needed by mkvmerge.

This simply means we need to add an environment variable or (or maybe a few)... but first we need to know which one!

What happens if you run this command manually while the following files are all still present in the temp dir:
Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.ac3
Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.dts
Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.tc

Code: Select all

mkvmerge --compression 1: /mnt/disk1/share/_Complete/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv --language 0:eng --track-name 0:"Antiviral.2012.BluRay.720p.AC3.x264-CHD" --sync 0:6 --compression 0: /mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.ac3 -o /mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv

clintonhall
Posts: 449
Joined: 15 Dec 2012, 01:52
Location: Australia
Contact:

Re: [PP-Script] mkvdts2ac3 - how to make this nzbget script?

Post by clintonhall » 06 Dec 2013, 02:24

I think I found it... the difference between nzbget calling the script and your manual call is:
1 - your manual call either used the option nodts Or keepdts (please confirm which is set in your settings file) but neither of these are set when called from NZBGet. (you can try setting either of these, but I don't actually think this is critical)
2 - your manual call uses compress = none. In NZBGet web UI, please set compress = none (i.e write the word "none" in this field) please try this and see what the result is...

jackiass2
Posts: 42
Joined: 19 Nov 2013, 12:07

Re: [PP-Script] mkvdts2ac3 - how to make this nzbget script?

Post by jackiass2 » 06 Dec 2013, 07:16

I don't really use the settings file. The python script is set up basically like I want it, except for the tmp folder and the keep dts part. I run it with mkvdts2ac3.py -n -w /mnt/disk1/share/test/ where -n = nodts (do not retain the DTS track) and -w = working directory.

!!!
First I tried just setting compress = none which resulted in me ending up with an mkv containing both AC3 and DTS. Since I have no use for DTS in the file, I then tried with Keep DTS = False. Now I end up with an mkv with only AC3 audio, but next to it, it puts a Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.dts file.

Here is the log:

Code: Select all

error	Fri Dec 06 2013 08:10:32	Post-process-script mkvdts2ac3/mkvdts2ac3-2.py for Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample failed (terminated with unknown status)
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: mkv dts -> ac3 conversion: 2 minutes 29 seconds
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv finished in: 2 minutes 27 seconds
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: sample.mkv
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: /mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: sample.ac3 -o
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: /mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: --compression 0:none
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: 0:"Antiviral.2012.BluRay.720p.AC3.x264-CHD" --sync 0:6
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: --language 0:eng --track-name
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: -CHD-sample/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: /mnt/disk1/share/_Complete/Antiviral.2012.BluRay.720p.DTS.x264
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: mkvmerge -A --compression 1:none
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: Running command:
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: Remuxing AC3 into MKV [4/4]...
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: sample.ac3
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: /mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: sample.dts -acodec ac3 -ac 2 -ab 448k
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: /mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: ffmpeg -y -i
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: Running command:
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: Converting DTS to AC3 [3/4]...
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: sample.dts
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: 2:/mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: -CHD-sample/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: /mnt/disk1/share/_Complete/Antiviral.2012.BluRay.720p.DTS.x264
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: mkvextract tracks
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: Running command:
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: Extracting DTS track [2/4]...
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: sample.tc
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: 2:/mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: -CHD-sample/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: /mnt/disk1/share/_Complete/Antiviral.2012.BluRay.720p.DTS.x264
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: mkvextract timecodes_v2
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: Running command:
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: Extracting Timecodes [1/4]...
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: filename: Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: Processing file: /mnt/disk1/share/_Complete/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv
info	Fri Dec 06 2013 08:10:32	mkvdts2ac3-2: Processing file: /mnt/disk1/share/_Complete/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.par2
info	Fri Dec 06 2013 08:10:29	mkvdts2ac3-2: Muxing took 25 seconds.
info	Fri Dec 06 2013 08:10:25	mkvdts2ac3-2: The cue entries (the index) are being written...
info	Fri Dec 06 2013 08:10:25	mkvdts2ac3-2: Progress: 3% Progress: 23% Progress: 33% Progress: 39% Progress: 43% Progress: 47% Progress: 52% Progress: 56% Progress: 60% Progress: 64% Progress: 67% Progress: 71% Progress: 76% Progress: 79% Progress: 83% Progress: 89% Progress: 94% Progress: 99% Progress: 100%
info	Fri Dec 06 2013 08:10:04	mkvdts2ac3-2: The file '/mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv' has been opened for writing.
info	Fri Dec 06 2013 08:10:04	mkvdts2ac3-2: '/mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.ac3' track 0: Using the AC3 output module.
info	Fri Dec 06 2013 08:10:04	mkvdts2ac3-2: '/mnt/disk1/share/_Complete/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv' track 1: Using the MPEG-4 part 10 (AVC) video output module.
info	Fri Dec 06 2013 08:10:04	mkvdts2ac3-2: '/mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.ac3': Using the AC3 demultiplexer.
info	Fri Dec 06 2013 08:10:04	mkvdts2ac3-2: '/mnt/disk1/share/_Complete/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.mkv': Using the Matroska demultiplexer.
info	Fri Dec 06 2013 08:10:04	mkvdts2ac3-2: mkvmerge v4.2.0 ('No Talking') built on Feb 14 2012 14:16:48
info	Fri Dec 06 2013 08:10:03	mkvdts2ac3-2: video:0kB audio:2749kB global headers:0kB muxing overhead 0.000000%
info	Fri Dec 06 2013 08:10:03	mkvdts2ac3-2: bitrate= 448.1kbits/s size= 2266kB time=00:00:41.43 bitrate= 448.1kbits/s size= 2272kB time=00:00:41.53 bitrate= 448.1kbits/s size= 2282kB time=00:00:41.72 bitrate= 448.1kbits/s size= 2292kB time=00:00:41.91 bitrate= 448.1kbits/s size= 2306kB time=00:00:42.17 bitrate= 448.1kbits/s size= 2320kB time=00:00:42.42 bitrate= 448.1kbits/s size= 2336kB time=00:00:42.71 bitrate= 448.1kbits/s size= 2347kB time=00:00:42.90 bitrate= 448.1kbits/s size= 2359kB time=00:00:43.13 bitrate= 448.1kbits/s size= 2373kB time=00:00:43.38 bitrate= 448.1kbits/s size= 2389kB time=00:00:43.67 bitrate= 448.1kbits/s size= 2401kB time=00:00:43.89 bitrate= 448.1kbits/s size= 2415kB time=00:00:44.15 bitrate= 448.1kbits/s size= 2429kB time=00:00:44.41 bitrate= 448.1kbits/s size= 2440kB time=00:00:44.60 bitrate= 448.1kbits/s size= 2448kB time=00:00:44.76 bitrate= 448.1kbits/s size= 2464kB time=00:00:45.05 bitra
info	Fri Dec 06 2013 08:09:43	mkvdts2ac3-2: size= 12kB time=00:00:00.21 bitrate= 458.9kbits/s size= 23kB time=00:00:00.41 bitrate= 453.8kbits/s size= 37kB time=00:00:00.66 bitrate= 451.6kbits/s size= 49kB time=00:00:00.89 bitrate= 450.7kbits/s size= 63kB time=00:00:01.14 bitrate= 450.1kbits/s size= 77kB time=00:00:01.40 bitrate= 449.7kbits/s size= 93kB time=00:00:01.69 bitrate= 449.4kbits/s size= 105kB time=00:00:01.91 bitrate= 449.2kbits/s size= 119kB time=00:00:02.17 bitrate= 449.1kbits/s size= 130kB time=00:00:02.36 bitrate= 449.0kbits/s size= 142kB time=00:00:02.58 bitrate= 448.9kbits/s size= 156kB time=00:00:02.84 bitrate= 448.8kbits/s size= 170kB time=00:00:03.09 bitrate= 448.8kbits/s size= 182kB time=00:00:03.32 bitrate= 448.7kbits/s size= 196kB time=00:00:03.57 bitrate= 448.7kbits/s size= 210kB time=00:00:03.83 bitrate= 448.6kbits/s size= 222kB time=00:00:04.05 bitrate= 448.6kbits/s size=
info	Fri Dec 06 2013 08:08:12	mkvdts2ac3-2: Press [q] to stop, [?] for help
info	Fri Dec 06 2013 08:08:12	mkvdts2ac3-2: Stream #0:0 -> #0:0 (dca -> ac3)
info	Fri Dec 06 2013 08:08:12	mkvdts2ac3-2: Stream mapping:
info	Fri Dec 06 2013 08:08:12	mkvdts2ac3-2: Stream #0:0: Audio: ac3, 48000 Hz, stereo, flt, 448 kb/s
info	Fri Dec 06 2013 08:08:12	mkvdts2ac3-2: encoder : Lavf54.6.100
info	Fri Dec 06 2013 08:08:12	mkvdts2ac3-2: Metadata:
info	Fri Dec 06 2013 08:08:12	mkvdts2ac3-2: Output #0, ac3, to '/mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.ac3':
info	Fri Dec 06 2013 08:08:12	mkvdts2ac3-2: [aresample @ 0x100b610] chl:5.1(side) fmt:s16 r:48000Hz -> chl:stereo fmt:flt r:48000Hz
info	Fri Dec 06 2013 08:08:12	mkvdts2ac3-2: [aformat @ 0x1020b50] auto-inserting filter 'auto-inserted resampler 0' between the filter 'src' and the filter 'aformat'
info	Fri Dec 06 2013 08:08:12	mkvdts2ac3-2: Stream #0:0: Audio: dts (DTS), 48000 Hz, 5.1(side), s16, 1536 kb/s
info	Fri Dec 06 2013 08:08:12	mkvdts2ac3-2: Duration: 00:00:49.37, start: 0.000000, bitrate: 1536 kb/s
info	Fri Dec 06 2013 08:08:12	mkvdts2ac3-2: Input #0, dts, from '/mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.dts':
info	Fri Dec 06 2013 08:08:12	mkvdts2ac3-2: [dts @ 0xff83c0] Estimating duration from bitrate, this may be inaccurate
info	Fri Dec 06 2013 08:08:12	mkvdts2ac3-2: [dts @ 0xff83c0] max_analyze_duration 5000000 reached at 5002667
info	Fri Dec 06 2013 08:08:11	mkvdts2ac3-2: libpostproc 52. 0.100 / 52. 0.100
info	Fri Dec 06 2013 08:08:11	mkvdts2ac3-2: libswresample 0. 15.100 / 0. 15.100
info	Fri Dec 06 2013 08:08:11	mkvdts2ac3-2: libswscale 2. 1.100 / 2. 1.100
info	Fri Dec 06 2013 08:08:11	mkvdts2ac3-2: libavfilter 2. 77.100 / 2. 77.100
info	Fri Dec 06 2013 08:08:11	mkvdts2ac3-2: libavdevice 54. 0.100 / 54. 0.100
info	Fri Dec 06 2013 08:08:11	mkvdts2ac3-2: libavformat 54. 6.100 / 54. 6.100
info	Fri Dec 06 2013 08:08:11	mkvdts2ac3-2: libavcodec 54. 23.100 / 54. 23.100
info	Fri Dec 06 2013 08:08:11	mkvdts2ac3-2: libavutil 51. 54.100 / 51. 54.100
info	Fri Dec 06 2013 08:08:11	mkvdts2ac3-2: configuration: --prefix=/opt --extra-cflags=-I/opt/include --extra-ldflags=-L/opt/lib --enable-static --disable-shared --enable-libmp3lame --enable-libx264 --enable-gpl --enable-pthreads --disable-ffplay --disable-ffserver
info	Fri Dec 06 2013 08:08:11	mkvdts2ac3-2: built on Jul 23 2012 18:47:09 with gcc 4.2.3
info	Fri Dec 06 2013 08:08:11	mkvdts2ac3-2: ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers
info	Fri Dec 06 2013 08:08:10	mkvdts2ac3-2: Progress: 3% Progress: 6% Progress: 9% Progress: 12% Progress: 15% Progress: 19% Progress: 22% Progress: 25% Progress: 28% Progress: 32% Progress: 35% Progress: 39% Progress: 42% Progress: 46% Progress: 49% Progress: 50% Progress: 54% Progress: 57% Progress: 61% Progress: 64% Progress: 68% Progress: 68% Progress: 72% Progress: 75% Progress: 79% Progress: 82% Progress: 85% Progress: 88% Progress: 92% Progress: 95% Progress: 99% Progress: 99% Progress: 100%
info	Fri Dec 06 2013 08:08:08	mkvdts2ac3-2: Extracting track 2 with the CodecID 'A_DTS' to the file '/mnt/disk1/share/test/Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample.dts'. Container format: Digital Theater System (DTS)
info	Fri Dec 06 2013 08:08:08	mkvdts2ac3-2: Progress: 0% Progress: 3% Progress: 6% Progress: 9% Progress: 12% Progress: 15% Progress: 19% Progress: 22% Progress: 25% Progress: 28% Progress: 32% Progress: 35% Progress: 39% Progress: 42% Progress: 46% Progress: 49% Progress: 50% Progress: 54% Progress: 57% Progress: 61% Progress: 64% Progress: 68% Progress: 68% Progress: 72% Progress: 75% Progress: 79% Progress: 82% Progress: 85% Progress: 88% Progress: 92% Progress: 95% Progress: 99% Progress: 100%
info	Fri Dec 06 2013 08:07:59	Executing post-process-script mkvdts2ac3/mkvdts2ac3-2.py for Antiviral.2012.BluRay.720p.DTS.x264-CHD-sample
It gets the job done, even thought I still end up with an error. It needs an exit code, telling it was successful? http://nzbget.sourceforge.net/Post-proc ... Exit_codes
It now also works in deamon mode!
Last two small things would then be ending the script with proper exit codes and somehow having it not leaving the .dts file behind.
After that, perhaps a little cleaning up and giving some descriptions to the options in nzbget gui to make it more user friendly.

Thanks for all the help!

Here's the whole script as it looks now:

Code: Select all

#!/usr/bin/env python

#Copyright (C) 2012  Drew Thomson
#
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program.  If not, see <http://www.gnu.org/licenses/>.

##############################################################################
### NZBGET POST-PROCESSING SCRIPT                                          ###

# mkvdts2ac3.py is a python script for linux, windows or os x which can be used
# for converting the DTS in Matroska (MKV) files to AC3. It provides you with a
# set of options for controlling the resulting file.

##############################################################################
### OPTIONS                                                                ###

## These options take an argument.

# NZBGetdestdir.
#
#nzbgetdestdir=

# aaccustom.
#
#aaccustom=

# custom.
#
#custom=

# compress.
#
#compress=

# destdir.
#
#destdir=

# ffmpegpath.
#
#ffmpegpath=

# mkvtoolnixpath
#
#mkvtoolnixpath=

# track.
#
#track=

# wd.
#
#wd=

# verbose.
#
#verbose=

## These options don't take any arguments, they are only True or False

# aac (False, True).
#
#aac=

# aacstereo (False, True).
#
#aacstereo=

# default (False, True).
#
#default=

# external (False, True).
#
#external=

# force (False, True).
#
#force=

# initial (False, True).
#
#initial=

# keepdts (False, True).
#
#keepdts=

# mp4 (False, True).
#
#mp4=

# new (False, True).
#
#new=

# nodts (False, True).
#
#nodts=

# no subtitles (False, True).
#
#no_subtitles=

# no overwrite (False, True).
#
#overwrite=

# recursive (False, True).
#
#recursive=

# test (False, True).
#
#test=

#debug (False, True).
#
#debug=

### NZBGET POST-PROCESSING SCRIPT                                          ###
##############################################################################

import argparse
import os
import subprocess
import time
import glob
import re
import tempfile
import sys
import ConfigParser
import shutil
import hashlib
import textwrap
import errno

version = "1.0"

# check if called from sabnzbdplus
sab = False
if len(sys.argv) == 8:
    nzbgroup = sys.argv[6]
    ppstatus = sys.argv[7]
    if ppstatus.isdigit():
        if int(ppstatus) >= 0 and int(ppstatus) <= 3 and "." in nzbgroup:
            sab = True

elif os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5] < '11.0':
    #Logger.info("MAIN: Script triggered from NZBGet (11.0 or later).")

    # NZBGet argv: all passed as environment variables.
    # Exit codes used by NZBGet
    POSTPROCESS_PARCHECK=92
    POSTPROCESS_SUCCESS=93
    POSTPROCESS_ERROR=94
    POSTPROCESS_NONE=95

    # Check nzbget.conf options
    status = 0

    if os.environ['NZBOP_UNPACK'] != 'yes':
        #Logger.error("Please enable option \"Unpack\" in nzbget configuration file, exiting")
        sys.exit(POSTPROCESS_ERROR)

    # Check par status
    if os.environ['NZBPP_PARSTATUS'] == '3':
        #Logger.warning("Par-check successful, but Par-repair disabled, exiting")
        sys.exit(POSTPROCESS_NONE)

    if os.environ['NZBPP_PARSTATUS'] == '1':
        #Logger.warning("Par-check failed, setting status \"failed\"")
        status = 1

    # Check unpack status
    if os.environ['NZBPP_UNPACKSTATUS'] == '1':
        #Logger.warning("Unpack failed, setting status \"failed\"")
        status = 1

    if os.environ['NZBPP_UNPACKSTATUS'] == '0' and os.environ['NZBPP_PARSTATUS'] != '2':
        # Unpack is disabled or was skipped due to nzb-file properties or due to errors during par-check

        for dirpath, dirnames, filenames in os.walk(os.environ['NZBPP_DIRECTORY']):
            for file in filenames:
                fileExtension = os.path.splitext(file)[1]

                if fileExtension in ['.rar', '.7z'] or os.path.splitext(fileExtension)[1] in ['.rar', '.7z']:
                    #Logger.warning("Post-Process: Archive files exist but unpack skipped, setting status \"failed\"")
                    status = 1
                    break

                if fileExtension in ['.par2']:
                    #Logger.warning("Post-Process: Unpack skipped and par-check skipped (although par2-files exist), setting status \"failed\"g")
                    status = 1
                    break

        if os.path.isfile(os.path.join(os.environ['NZBPP_DIRECTORY'], "_brokenlog.txt")) and not status == 1:
            #Logger.warning("Post-Process: _brokenlog.txt exists, download is probably damaged, exiting")
            status = 1

        #if not status == 1:
            #Logger.info("Neither archive- nor par2-files found, _brokenlog.txt doesn't exist, considering download successful")

    # Check if destination directory exists (important for reprocessing of history items)
    if not os.path.isdir(os.environ['NZBPP_DIRECTORY']):
        #Logger.error("Post-Process: Nothing to post-process: destination directory %s doesn't exist", os.environ['NZBPP_DIRECTORY'])
        status = 1

    # All checks done, now launching the script.

    ppstatus = status
    if ppstatus >= 0 and ppstatus <= 3:
        sab = True

# create parser
parser = argparse.ArgumentParser(description='convert matroska (.mkv) video files audio portion from dts to ac3')

if os.environ.has_key('NZBOP_SCRIPTDIR'): # NZBGet
    args = parser.parse_args()
    args.fileordir = [os.environ['NZBPP_DIRECTORY']]
    args.aac = os.environ['NZBPO_AAC']
    args.aacstereo = os.environ['NZBPO_AACSTEREO']
    args.aaccustom = os.environ['NZBPO_AACCUSTOM']
    args.custom = os.environ['NZBPO_CUSTOM']
    args.default = os.environ['NZBPO_DEFAULT']
    args.sabdestdir = os.environ['NZBPO_NZBGETDESTDIR']
    args.compress = os.environ['NZBPO_COMPRESS']
    args.destdir = os.environ['NZBPO_DESTDIR']
    args.ffmpegpath = os.environ['NZBPO_FFMPEGPATH']
    args.mkvtoolnixpath = os.environ['NZBPO_MKVTOOLNIXPATH']
    args.track = os.environ['NZBPO_TRACK']
    args.wd = os.environ['NZBPO_WD']
    args.verbose = os.environ['NZBPO_VERBOSE']
    args.external = os.environ['NZBPO_EXTERNAL']
    args.force = os.environ['NZBPO_FORCE']
    args.initial = os.environ['NZBPO_INITIAL']
    args.keepdts = os.environ['NZBPO_KEEPDTS']
    args.mp4 = os.environ['NZBPO_MP4']
    args.new = os.environ['NZBPO_NEW']
    args.nodts = os.environ['NZBPO_NODTS']
    args.no_subtitles = os.environ['NZBPO_NO_SUBTITLES']
    args.overwrite = os.environ['NZBPO_OVERWRITE']
    args.recursive = os.environ['NZBPO_RECURSIVE']
    args.test = os.environ['NZBPO_TEST']
    args.debug = os.environ['NZBPO_DEBUG']
    args.md5 = True
    args.stereo = True
    if not args.verbose:
        args.verbose = 0

else: # default handling

# set config file arguments
    configFilename = os.path.join(os.path.dirname(sys.argv[0]), "mkvdts2ac3.cfg")

    if os.path.isfile(configFilename):
        config = ConfigParser.SafeConfigParser()
        config.read(configFilename)
        defaults = dict(config.items("mkvdts2ac3"))
        for key in defaults:
            if key == "verbose":
                defaults["verbose"] = int(defaults["verbose"])

        parser.set_defaults(**defaults)

    parser.add_argument('fileordir', metavar='FileOrDirectory', nargs='+', help='a file or directory (wildcards may be used)')

    parser.add_argument("--aac", help="Also add aac track", action="store_true")
    parser.add_argument("--aacstereo", help="Make aac track stereo instead of 6 channel", action="store_true")
    parser.add_argument("--aaccustom", metavar="TITLE", help="Custom AAC track title")
    parser.add_argument("-c", "--custom", metavar="TITLE", help="Custom AC3 track title")
    parser.add_argument("-d", "--default", help="Mark AC3 track as default", action="store_true")
    parser.add_argument("--destdir", metavar="DIRECTORY", help="Destination Directory")
    parser.add_argument("-e", "--external", action="store_true",
                        help="Leave AC3 track out of file. Does not modify the original matroska file. This overrides '-n' and '-d' arguments")
    parser.add_argument("-f", "--force", help="Force processing when AC3 track is detected", action="store_true")
    parser.add_argument("--ffmpegpath", metavar="DIRECTORY", help="Path of ffmpeg")
    parser.add_argument("-i", "--initial", help="New AC3 track will be first in the file", action="store_true")
    parser.add_argument("-k", "--keepdts", help="Keep external DTS track (implies '-n')", action="store_true")
    parser.add_argument("--md5", help="check md5 of files before removing the original if destination directory is on a different device than the original file", action="store_true")
    parser.add_argument("--mp4", help="create output in mp4 format", action="store_true")
    parser.add_argument("--mkvtoolnixpath", metavar="DIRECTORY", help="Path of mkvextract, mkvinfo and mkvmerge")
    parser.add_argument("-n", "--nodts", help="Do not retain the DTS track", action="store_true")
    parser.add_argument("--new", help="Do not copy over original. Create new adjacent file", action="store_true")
    parser.add_argument("--no-subtitles", help="Remove subtitles", action="store_true")
    parser.add_argument("-o", "--overwrite", help="Overwrite file if already there. This only applies if destdir or sabdestdir is set", action="store_true")
    parser.add_argument("-r", "--recursive", help="Recursively descend into directories", action="store_true")
    parser.add_argument("-s", "--compress", metavar="MODE", help="Apply header compression to streams (See mkvmerge's --compression)", default='none')
    parser.add_argument("--sabdestdir", metavar="DIRECTORY", help="SABnzbd Destination Directory")
    parser.add_argument("--stereo", help="Make ac3 track stereo instead of 6 channel", action="store_true")
    parser.add_argument("-t", "--track", metavar="TRACKID", help="Specify alternate DTS track. If it is not a DTS track it will default to the first DTS track found")
    parser.add_argument("-w", "--wd", metavar="FOLDER", help="Specify alternate temporary working directory")
    parser.add_argument("-v", "--verbose", help="Turn on verbose output. Use more v's for more verbosity. -v will output what it is doing. -vv will also output the command that it is running. -vvv will also output the command output", action="count")
    parser.add_argument("-V", "--version", help="Print script version information", action='version', version='%(prog)s ' + version + ' by Drew Thomson')
    parser.add_argument("--test", help="Print commands only, execute nothing", action="store_true")
    parser.add_argument("--debug", help="Print commands and pause before executing each", action="store_true")

    args = parser.parse_args()

    if not args.verbose:
        args.verbose = 0

def winexe(program):
    if sys.platform == "win32" and not program.endswith(".exe"):
        program += ".exe"
    return program

# set ffmpeg and mkvtoolnix paths
if args.mkvtoolnixpath:
    mkvinfo = os.path.join(args.mkvtoolnixpath, "mkvinfo")
    mkvinfo = winexe(mkvinfo)
    mkvmerge = os.path.join(args.mkvtoolnixpath, "mkvmerge")
    mkvmerge = winexe(mkvmerge)
    mkvextract = os.path.join(args.mkvtoolnixpath, "mkvextract")
    mkvextract = winexe(mkvextract)
if not args.mkvtoolnixpath or not os.path.exists(mkvinfo):
    mkvinfo = "mkvinfo"
if not args.mkvtoolnixpath or not os.path.exists(mkvmerge):
    mkvmerge = "mkvmerge"
if not args.mkvtoolnixpath or not os.path.exists(mkvextract):
    mkvextract = "mkvextract"
   
if args.ffmpegpath:
    ffmpeg = os.path.join(args.ffmpegpath, "ffmpeg")
    ffmpeg = winexe(ffmpeg)
if not args.ffmpegpath or not os.path.exists(ffmpeg):
    ffmpeg = "ffmpeg"


# check paths
def which(program):
    if sys.platform == "win32" and not program.endswith(".exe"):
        program += ".exe"
    def is_exe(fpath):
        return os.path.isfile(fpath) and os.access(fpath, os.X_OK)

    fpath = os.path.split(program)[0]
    if fpath:
        if is_exe(program):
            return program
    else:
        for path in os.environ["PATH"].split(os.pathsep):
            exe_file = os.path.join(path, program)
            if is_exe(exe_file):
                return exe_file

    return None

missingprereqs = False
missinglist = []
if not which(mkvextract):
    missingprereqs = True
    missinglist.append("mkvextract")
if not which(mkvinfo):
    missingprereqs = True
    missinglist.append("mkvinfo")
if not which(mkvmerge):
    missingprereqs = True
    missinglist.append("mkvmerge")
if not which(ffmpeg):
    missingprereqs = True
    missinglist.append("ffmpeg")
if missingprereqs:
    sys.stdout.write("You are missing the following prerequisite tools: ")
    for tool in missinglist:
        sys.stdout.write(tool + " ")
    if not args.mkvtoolnixpath and not args.ffmpegpath:
        print "\nYou can use --mkvtoolnixpath and --ffmpegpath to specify the path"
    else:
        print   
    sys.exit(1)

if not args.verbose:
    args.verbose = 0

if args.verbose < 2 and (args.test or args.debug):
    args.verbose = 2
   
if sab:
    args.fileordir = [args.fileordir[0]]
    args.verbose = 3

if args.debug and args.verbose == 0:
    args.verbose = 1

def doprint(mystr, v):
    if args.verbose >= v:
        sys.stdout.write(mystr)

def silentremove(filename):
    try:
        os.remove(filename)
    except OSError, e:
        if e.errno != errno.ENOENT: # errno.ENOENT = no such file or directory
            raise # re-raise exception if a different error occured

def elapsedstr(starttime):
    elapsed = (time.time() - starttime)
    minutes = int(elapsed / 60)
    mplural = 's'
    if minutes == 1:
        mplural = ''
    seconds = int(elapsed) % 60
    splural = 's'
    if seconds == 1:
        splural = ''
    return str(minutes) + " minute" + mplural + " " + str(seconds) + " second" + splural

def getduration(time):
    (hms, ms) = time.split('.')
    (h, m, s) = hms.split(':')
    totalms = int(ms) + (int(s) * 100) + (int(m) * 100 * 60) + (int(h) * 100 * 60 * 60)
    return totalms
   
def runcommand(title, cmdlist):
    if args.debug:
        raw_input("Press Enter to continue...")
    cmdstarttime = time.time()
    if args.verbose >= 1:
        sys.stdout.write(title)
        if args.verbose >= 2:
            cmdstr = ''
            for e in cmdlist:
                cmdstr += e + ' '
            print
            print "    Running command:"
            print textwrap.fill(cmdstr.rstrip(), initial_indent='      ', subsequent_indent='      ')
    if not args.test:
        if args.verbose >= 3:
            subprocess.call(cmdlist)
        elif args.verbose >= 1:
            if "ffmpeg" in cmdlist[0]:
                proc = subprocess.Popen(cmdlist, stderr=subprocess.PIPE)
                line = ''
                duration_regex = re.compile("  Duration: (\d+:\d\d:\d\d\.\d\d),")
                progress_regex = re.compile("size= +\d+.*time=(\d+:\d\d:\d\d\.\d\d) bitrate=")
                duration = False
                while True:
                    if not duration:
                        durationline = proc.stderr.readline()
                        match = duration_regex.match(durationline)
                        if match:
                            duration = getduration(match.group(1))
                    else: 
                        out = proc.stderr.read(1)
                        if out == '' and proc.poll() != None:
                            break
                        if out != '\r':
                            line += out
                        else:
                            if 'size= ' in line:
                                match = progress_regex.search(line)
                                if match:
                                    percentage = int(float(getduration(match.group(1)) / float(duration)) * 100)
                                    if percentage > 100:
                                        percentage = 100
                                    sys.stdout.write("\r" + title + str(percentage) + '%')
                            line = ''
                        sys.stdout.flush()
                print "\r" + title + elapsedstr(cmdstarttime)
            else:
                proc = subprocess.Popen(cmdlist, stdout=subprocess.PIPE)
                line = ''
                progress_regex = re.compile("Progress: (\d+%)")
                while True:
                    out = proc.stdout.read(1)
                    if out == '' and proc.poll() != None:
                        break
                    if out != '\r':
                        line += out
                    else:
                        if 'Progress: ' in line:
                            match = progress_regex.search(line)
                            if match:
                                percentage = match.group(1)
                                sys.stdout.write("\r" + title + percentage)
                        line = ''
                    sys.stdout.flush()
                print "\r" + title + elapsedstr(cmdstarttime)
        else:
            subprocess.call(cmdlist, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

def find_mount_point(path):
    path = os.path.abspath(path)
    while not os.path.ismount(path):
        path = os.path.dirname(path)
    return path

def getmd5(fname, block_size=2**12):
    md5 = hashlib.md5()
    with open(fname, 'rb') as f:
        while True:
            data = f.read(block_size)
            if not data:
                break
            md5.update(data)
        doprint(fname + ": " + md5.hexdigest() + "\n", 3)
    return md5.hexdigest()

def check_md5tree(orig, dest):
    rt = True
    orig = os.path.abspath(orig)
    dest = os.path.abspath(dest)
    for ofile in os.listdir(orig):
        if rt == True:
            if os.path.isdir(os.path.join(orig, ofile)):
                doprint("dir: " + os.path.join(orig, ofile) + "\n", 3)
                odir = os.path.join(orig, ofile)
                ddir = os.path.join(dest, ofile)
                rt = check_md5tree(odir, ddir)
            else:
                doprint("file: " + os.path.join(orig, ofile) + "\n", 3)
                if getmd5(os.path.join(orig, ofile)) != getmd5(os.path.join(dest, ofile)):
                    rt = False
    return rt

def process(ford):
    if os.path.isdir(ford):
        doprint("    Processing dir:  " + ford + "\n", 3)
        if args.recursive:
            for f in os.listdir(ford):
                process(os.path.join(ford, f))
    else:
        doprint("    Processing file: " + ford + "\n", 3)
        # check if file is an mkv file
        child = subprocess.Popen([mkvmerge, "-i", ford], stdout=subprocess.PIPE)
        child.communicate()[0]
        if child.returncode == 0:
            starttime = time.time()
           
            # set up temp dir
            tempdir = False
            if args.wd:
                tempdir = args.wd
                if not os.path.exists(tempdir):
                    os.makedirs(tempdir)
            else:
                tempdir = tempfile.mkdtemp()
                tempdir = os.path.join(tempdir, "mkvdts2ac3")
               
            (dirName, fileName) = os.path.split(ford)
            fileBaseName = os.path.splitext(fileName)[0]
           
            doprint("filename: " + fileName + "\n", 1)
           
            dtsfile = fileBaseName + '.dts'
            tempdtsfile = os.path.join(tempdir, dtsfile)
            ac3file = fileBaseName + '.ac3'
            tempac3file = os.path.join(tempdir, ac3file)
            aacfile = fileBaseName + '.aac'
            tempaacfile = os.path.join(tempdir, aacfile)
            tcfile = fileBaseName + '.tc'
            temptcfile = os.path.join(tempdir, tcfile)
            newmkvfile = fileBaseName + '.mkv'
            tempnewmkvfile = os.path.join(tempdir, newmkvfile)
            adjacentmkvfile = os.path.join(dirName, fileBaseName + '.new.mkv')
            mp4file = os.path.join(dirName, fileBaseName + '.mp4')
            fname = fileName
           
            # get dts track id and video track id
            output = subprocess.check_output([mkvmerge, "-i", ford])
            lines = output.split("\n")
            altdtstrackid = False
            dtstrackid = False
            videotrackid = False
            alreadygotac3 = False
            audiotracks = []
            for line in lines:
                linelist = line.split(' ')
                trackid = False
                if len(linelist) > 2:
                    trackid = linelist[2]
                    linelist = trackid.split(':')
                    trackid = linelist[0]
                if 'audio (A_' in line:
                    audiotracks.append(trackid)
                if ': audio (A_DTS)' in line:
                    dtstrackid = trackid
                elif 'video (V_' in line:
                    videotrackid = trackid
                elif ': audio (A_AC3)' in line:
                    alreadygotac3 = True
                if args.track:
                    if "Track ID " + args.track + ": audio (A_DTS)" in line:
                        altdtstrackid = args.track
            if altdtstrackid:
                dtstrackid = altdtstrackid
           
            if not dtstrackid:
                doprint("  No DTS track found\n", 1)
            elif alreadygotac3 and not args.force:
                doprint("  Already has AC3 track\n", 1)
            else:
                # get dtstrack info
                output = subprocess.check_output([mkvinfo, ford])
                lines = output.split("\n")
                dtstrackinfo = []
                startcount = 0
                for line in lines:
                    match = re.search(r'^\|( *)\+', line)
                    linespaces = startcount
                    if match:
                        linespaces = len(match.group(1))
                    if startcount == 0:
                        if "track ID for mkvmerge & mkvextract:" in line:
                            if "track ID for mkvmerge & mkvextract: " + dtstrackid in line:
                                startcount = linespaces
                        elif "+ Track number: " + dtstrackid in line:
                            startcount = linespaces
                    if linespaces < startcount:
                        break
                    if startcount != 0:
                        dtstrackinfo.append(line)
               
                # get dts language
                dtslang = "eng"
                for line in dtstrackinfo:
                    if "Language" in line:
                        dtslang = line.split()[-1]
               
                # get ac3 track name
                ac3name = False
                if args.custom:
                    ac3name = args.custom
                else:
                    for line in dtstrackinfo:
                        if "+ Name: " in line:
                            ac3name = line.split("+ Name: ")[-1]
                            ac3name = ac3name.replace("DTS", "AC3")
                            ac3name = ac3name.replace("dts", "ac3")
                            if args.stereo:
                                ac3name = ac3name.replace("5.1", "Stereo")
               
                # get aac track name
                aacname = False
                if args.aaccustom:
                    aacname = args.aaccustom
                else:
                    for line in dtstrackinfo:
                        if "+ Name: " in line:
                            aacname = line.split("+ Name: ")[-1]
                            aacname = aacname.replace("DTS", "AAC")
                            aacname = aacname.replace("dts", "aac")
                            if args.aacstereo:
                                aacname = aacname.replace("5.1", "Stereo")
               
                totaljobs = 4
                jobnum = 1
                if args.aac:
                    totaljobs += 1
                if args.mp4:
                    totaljobs += 1
               
                # extract timecodes
                tctitle = "  Extracting Timecodes  [" + str(jobnum) + "/" + str(totaljobs) + "]..."
                jobnum += 1
                tccmd = [mkvextract, "timecodes_v2", ford, dtstrackid + ":" + temptcfile]
                runcommand(tctitle, tccmd)
               
                delay = False
                if not args.test:
                    # get the delay if there is any
                    fp = open(temptcfile)
                    for i, line in enumerate(fp):
                        if i == 1:
                            delay = line
                            break
                    fp.close()
               
                # extract dts track
                extracttitle = "  Extracting DTS track  [" + str(jobnum) + "/" + str(totaljobs) + "]..."
                jobnum += 1
                extractcmd = [mkvextract, "tracks", ford, dtstrackid + ':' + tempdtsfile]
                runcommand(extracttitle, extractcmd)
               
                # convert DTS to AC3
                converttitle = "  Converting DTS to AC3 [" + str(jobnum) + "/" + str(totaljobs) + "]..."
                jobnum += 1
                audiochannels = 6
                if args.stereo:
                    audiochannels = 2
                convertcmd = [ffmpeg, "-y", "-i", tempdtsfile, "-acodec", "ac3", "-ac", str(audiochannels), "-ab", "448k", tempac3file]
                runcommand(converttitle, convertcmd)
               
                if args.aac:
                    converttitle = "  Converting DTS to AAC [" + str(jobnum) + "/" + str(totaljobs) + "]..."
                    jobnum += 1
                    audiochannels = 6
                    if args.aacstereo:
                        audiochannels = 2
                    convertcmd = [ffmpeg, "-y", "-i", tempdtsfile, "-acodec", "libfaac", "-ac", str(audiochannels), "-ab", "448k", tempaacfile]
                    runcommand(converttitle, convertcmd)
                    if not os.path.isfile(tempaacfile) or os.path.getsize(tempaacfile) == 0:
                        convertcmd = [ffmpeg, "-y", "-i", tempdtsfile, "-acodec", "libvo_aacenc", "-ac", str(audiochannels), "-ab", "448k", tempaacfile]
                        runcommand(converttitle, convertcmd)
                    if not os.path.isfile(tempaacfile) or os.path.getsize(tempaacfile) == 0:
                        convertcmd = [ffmpeg, "-y", "-i", tempdtsfile, "-acodec", "aac", "-strict", "experimental", "-ac", str(audiochannels), "-ab", "448k", tempaacfile]
                        runcommand(converttitle, convertcmd)
                    if not os.path.isfile(tempaacfile) or os.path.getsize(tempaacfile) == 0:
                        args.aac = False
                        print "ERROR: ffmpeg can't use any aac codecs. Please try to get libfaac, libvo_aacenc, or a newer version of ffmpeg with the experimental aac codec installed"
                       
                if args.external:
                    if not args.test:
                        shutil.move(tempac3file, os.path.join(dirName, fileBaseName + '.ac3'))
                        fname = ac3file
                else:
                    # remux
                    remuxtitle = "  Remuxing AC3 into MKV [" + str(jobnum) + "/" + str(totaljobs) + "]..."
                    jobnum += 1
                    # Start to "build" command
                    remux = [mkvmerge]
                   
                    # Remove subtitles
                    if args.no_subtitles:
                        remux.append("--no-subtitles")
                   
                    # Puts the AC3 track as the second in the file if indicated as initial
                    if args.initial:
                        remux.append("--track-order")
                        if args.aac:
                            remux.append("1:0,2:0")
                        else:
                            remux.append("1:0")

                    # If user doesn't want the original DTS track drop it
                    comp = args.compress
                    if args.nodts or args.keepdts:
                        if len(audiotracks) == 1:
                            remux.append("-A")
                        else:
                            audiotracks = [audiotrack for audiotrack in audiotracks if audiotrack != dtstrackid]
                            remux.append("-a")
                            remux.append(",".join(audiotracks))
                            for tid in audiotracks:
                                remux.append("--compression")
                                remux.append(tid + ":" + comp)
                   
                    # Add original MKV file, set header compression scheme         
                    remux.append("--compression")
                    remux.append(videotrackid + ":" + comp)
                    remux.append(ford)
                   
                    # If user wants new AC3 as default then add appropriate arguments to command
                    if args.default:
                        remux.append("--default-track")
                        remux.append("0:0")
                   
                    # Set the language
                    remux.append("--language")
                    remux.append("0:" + dtslang)
                   
                    # If the name was set for the original DTS track set it for the AC3
                    if ac3name:
                        remux.append("--track-name")
                        remux.append("0:\"" + ac3name.rstrip() + "\"")
                   
                    # set delay if there is any
                    if delay:
                        remux.append("--sync")
                        remux.append("0:" + delay.rstrip())
                       
                    # Set track compression scheme and append new AC3
                    remux.append("--compression")
                    remux.append("0:" + comp)
                    remux.append(tempac3file)
                   
                    if args.aac:
                        # If the name was set for the original DTS track set it for the AAC
                        if aacname:
                            remux.append("--track-name")
                            remux.append("0:\"" + aacname.rstrip() + "\"")
                           
                        # Set track compression scheme and append new AAC
                        remux.append("--compression")
                        remux.append("0:" + comp)
                        remux.append(tempaacfile)
                   
                    # Declare output file
                    remux.append("-o")
                    remux.append(tempnewmkvfile)
                   
                    runcommand(remuxtitle, remux) 

                    if not args.test:
                        if args.mp4:
                            converttitle = "  Converting MKV to MP4 [" + str(jobnum) + "/" + str(totaljobs) + "]..."
                            convertcmd = [ffmpeg, "-i", tempnewmkvfile, "-map", "0", "-vcodec", "copy", "-acodec", "copy", "-c:s", "mov_text", mp4file]
                            runcommand(converttitle, convertcmd)
                            silentremove(ford)
                        else:
                            #~ replace old mkv with new mkv
                            if args.new:
                                shutil.move(tempnewmkvfile, adjacentmkvfile)
                            else:
                                silentremove(ford)
                                shutil.move(tempnewmkvfile, ford)

                if not args.test:
                    #~ clean up temp folder
                    if args.keepdts and not args.external:
                        shutil.move(tempdtsfile, os.path.join(dirName, fileBaseName + ".dts"))
                        fname = dtsfile
                    else:
                        silentremove(tempdtsfile)
                    if not args.external:
                        silentremove(tempac3file)
                        silentremove(tempaacfile)
                        silentremove(temptcfile)
                    if not os.listdir(tempdir):
                        os.rmdir(tempdir)

                #~ print out time taken
                elapsed = (time.time() - starttime)
                minutes = int(elapsed / 60)
                seconds = int(elapsed) % 60
                doprint("  " + fileName + " finished in: " + str(minutes) + " minutes " + str(seconds) + " seconds\n", 1)

            return fname

totalstime = time.time()
for a in args.fileordir:
    for ford in glob.glob(a):
        fname = False
        if os.path.isdir(ford):
            for f in os.listdir(ford):
                process(os.path.join(ford, f))
        else:
            fname = process(ford)
        destdir = False
        if args.destdir:
            destdir = args.destdir
        if sab and args.sabdestdir:
            destdir = args.sabdestdir
        if destdir:
            if fname:
                (dirName, fileName) = os.path.split(ford)
                destfile = os.path.join(destdir, fname)
                origfile = os.path.join(dirName, fname)
                if args.md5 and (find_mount_point(dirName) != find_mount_point(destdir)):
                    if os.path.exists(destfile):
                        if args.overwrite:
                            silentremove(destfile)
                            shutil.copyfile(origfile, destfile)
                            if getmd5(origfile) == getmd5(destfile):
                                silentremove(origfile)
                            else:
                                print "MD5's don't match."
                        else:
                            print "File " + destfile + " already exists"
                    else:
                        doprint("copying: " + origfile + " --> " + destfile + "\n", 3)
                        shutil.copyfile(origfile, destfile)
                        if getmd5(origfile) == getmd5(destfile):
                            silentremove(origfile)
                        else:
                            print "MD5's don't match."
                else: 
                    if os.path.exists(destfile):
                        if args.overwrite:
                            silentremove(destfile)
                            shutil.move(origfile, destfile)
                        else:
                            print "File " + destfile + " already exists"
                    else:
                        shutil.move(origfile, destfile)
            else:
                origpath = os.path.abspath(ford)
                destpath = os.path.join(destdir, os.path.basename(os.path.normpath(ford)))
                if args.md5 and (find_mount_point(origpath) != find_mount_point(destpath)):
                    if os.path.exists(destpath) and args.overwrite:
                        shutil.rmtree(destpath)
                    elif os.path.exists(destpath):   
                        print "Directory " + destpath + " already exists"
                    else:
                        shutil.copytree(origpath, destpath)
                        if check_md5tree(origpath, destpath):
                            shutil.rmtree(origpath)
                        else:
                            print "MD5's don't match."
                else:
                    shutil.move(origpath, destpath)
                   
if sab:
    sys.stdout.write("mkv dts -> ac3 conversion: " + elapsedstr(totalstime))
else:
    doprint("Total Time: " + elapsedstr(totalstime), 1)
In the webgui I have set:
NZBGetdestdir = /mnt/disk1/share/_Complete/
compress = none
wd = /mnt/disk1/share/test/
keepdts = False

EDIT:
In stead of keepdts = False I tried with nodts = True
It gets the job done perfectly. I end up with an mkv with ac3 and nothing else :)

clintonhall
Posts: 449
Joined: 15 Dec 2012, 01:52
Location: Australia
Contact:

Re: [PP-Script] mkvdts2ac3 - how to make this nzbget script?

Post by clintonhall » 06 Dec 2013, 11:37

Great progress...

I'll see if I can add some exit codes and descriptions... But probably going to be having a few days without too much online time ;)

jackiass2
Posts: 42
Joined: 19 Nov 2013, 12:07

Re: [PP-Script] mkvdts2ac3 - how to make this nzbget script?

Post by jackiass2 » 06 Dec 2013, 12:58

Thanks for all the help. I'm going to have some human birthday time myself, so no stress :)

dcthomson
Posts: 2
Joined: 06 Dec 2013, 23:25

Re: [PP-Script] mkvdts2ac3 - how to make this nzbget script?

Post by dcthomson » 06 Dec 2013, 23:34

Ok, so I just got nzbget up and running and have just started fiddling with the ppscripts.

I then checked here and looks like yall have gotten quite a bit done. Is there any way you can post the code you have so far, or post it in the github issue: https://github.com/dcthomson/mkvdts2ac3.py/issues/7

I'd like to get it set up so it works properly and add it into the original script.

Thanks,
DT

Edit:
Oops, just noticed that you got the whole script posted 4 posts ago. I'll mess around with it over the weekend.

dcthomson
Posts: 2
Joined: 06 Dec 2013, 23:25

Re: [PP-Script] mkvdts2ac3 - how to make this nzbget script?

Post by dcthomson » 27 Dec 2013, 20:28

Completed making the script nzbget compatible. It is available at:

https://github.com/dcthomson/mkvdts2ac3.py

If anyone has any problems let me know.

DT

jackiass2
Posts: 42
Joined: 19 Nov 2013, 12:07

Re: [PP-Script] mkvdts2ac3 - how to make this nzbget script?

Post by jackiass2 » 28 Dec 2013, 10:00

Thanks for all the help. I'm sure a lot of people could find this useful. Thankfully (?) I do not need this script myself anymore. I've bought a raspberry pi and installed openelec xbmc on it, and it is capable of transcoding on the fly.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 30 guests