sanderjo / SAB-SafeRename

SABnzbd post-processing SafeRename script
GNU General Public License v2.0
3 stars 1 forks source link

Audio gets removed sometimes. #2

Open w00druff opened 8 years ago

w00druff commented 8 years ago

Dear sanderjo,

please help when you have few minutes. Sometimes all audio tracks are removed when the audio track is in front of the video track.

Here's an example if all tracks are removed: (Before sabnzbd processing):

001

When the videotrack is before the audiotrack(s) everything is fine.

Can you help ?

Thanks Matthias

w00druff commented 8 years ago

Bump, please help.

sanderjo commented 8 years ago

SAB-SafeRename is a command line program, and you show a GUI ... so I see no connection.

Futhermore: it's just a temp fork of https://github.com/clinton-hall/GetScripts/blob/master/SafeRename.py ... so I really don't what I can do for you.

w00druff commented 8 years ago

Sorry my fault, im talking about mkv-process-audio-and-subs.py you made few months ago. https://github.com/sanderjo/SAB-SafeRename/blob/master/mkv-process-audio-and-subs.py

sanderjo commented 8 years ago

Oh, this is about the script discussed here: https://forums.sabnzbd.org/viewtopic.php?f=9&t=18666 ?

If so, via the SAB forum send me a PM with a pointer to such a NZB. (It seems github does not offer DM/PM)

Or, even beter: what is the output of:

ffmpeg -i *.mkv 2>&1 | grep -i Stream.*ger

for that problematic MKV

w00druff commented 8 years ago

Before pp: Stream #0.0(ger): Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s (default) (forced)

sanderjo commented 8 years ago

I suggest that your run the script from the command line, with the video file you want to process; the stdout will show what is going on. I still don't get what the problem is.

w00druff commented 8 years ago

The problem is that he removes german track on this mkv instead of english. And i dont know why, the only reason i can think is that audio tracks are before video. Or because german track is 0.0, i dont know :(

Stream #0.0(ger): Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s (default) (forced) Stream #0.1(eng): Audio: ac3, 48000 Hz, 5.1, s16, 384 kb/s Stream #0.2: Video: h264 (High), yuv420p, 1280x718 [PAR 1:1 DAR 640:359], 25 fps, 25 tbr, 1k tbn, 2k tbc (default)

sanderjo commented 8 years ago

Please read https://github.com/sanderjo/SAB-SafeRename/issues/2#issuecomment-152854779 and act accordingly.

The NZB you PMed me, contains an EXE, not a NZB. So not testable for me.

w00druff commented 8 years ago

Here the stdout: (he removes ger track and keep eng track on that mkv...)

Language ger to be kept Searching: /DIR Found mkv /DIR/movie.mkv /DIR/movie.mkv cmd is ffmpeg -i "/DIR/movie.mkv" 2>&1 | grep -i -e Audio: Stream #0.0(ger): Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s (default) (forced) Stream number 0 Language found in stream 0 Go on cleanmoviename /DIR/cleanedmovie.mkv command is mkvmerge -o "/DIR/cleanedmovie.mkv" -a 1 "/DIR/movie.mkv" mkvmerge v5.6.0 ('Kenya Kane') gebaut am May 28 2012 06:47:39 '/DIR/movie.mkv': Der Demultiplexer für das folgende Format wird benutzt: 'Matroska'. '/DIR/movie.mkv' Track 1: Das Ausgabemodul für das folgende Format wird benutzt: 'AC3'. '/DIR/movie.mkv' Track 2: Das Ausgabemodul für das folgende Format wird benutzt: 'AVC/h.264'. Die Datei '/DIR/cleanedmovie.mkv' wurde zum Schreiben geöffnet. Fortschritt: 100% Die Cueeinträge (der Index) werden geschrieben... Das Muxen dauerte 26 Sekunden. Cleaning up

sanderjo commented 8 years ago

Ah:

Stream number 0
Language found in stream 0
command is mkvmerge -o "/DIR/cleanedmovie.mkv" -a 1 "/DIR/movie.mkv"

So: streamnumber is 0, but the command issues a "1" after "-a"

Source code:

cmd = 'mkvmerge -o "' + cleanmoviename + '" -a 1 --nosubs "' + mkvfilename + '"'

Big, big bug! That '1' should be 'streamnumber' (and then not in the double quotes), so (by hand, untested):

cmd = 'mkvmerge -o "' + cleanmoviename + '" -a ' + str(streamnumber) + '  --nosubs "' + mkvfilename + '"'

Can you test if that works for you?

w00druff commented 8 years ago

Works just fine, thanks a lot ! I have tried to remove "--nosubs" without success, can you help again ? :-) Got it working in the old script, but not in the new code.