clinton-hall / nzbToMedia

Provides NZB and Torrent postprocessing To CouchPotatoServer, SickBeard/SickRage, HeadPhones, Mylar and Gamez
GNU General Public License v3.0
674 stars 176 forks source link

Transcoding Question #474

Closed depraved22 closed 10 years ago

depraved22 commented 10 years ago

In an effort to keep my transcoding on the fly to a minimum, I've wrote a few scripts prior to convert any of my MKVs files based on a few conditions.

I found with my Amazon Fire TVs and the current DTS challenges, this always me to play everything without much issue since the MKVs with DTS are not quite supported yet with Plex.

Basic logic looks like:

    if [ "$(${MKVMERGE} -i "$i" | grep -i "DTS")" ];
    then
        echo "DTS found"
        # Convert from DTS to AC3
        /usr/local/bin/ffmpeg -i "$i" -c:v copy -acodec ac3 -ac 6 -ab 640k "${i%%.mkv}.mp4"  >/dev/null 2>/dev/null
    else
        # Leave it as is
        echo "No DTS found"
        /usr/local/bin/ffmpeg -i "$i" -vcodec copy -acodec copy "${i%%.mkv}.mp4"  >/dev/null 2>/dev/null
    fi

Rather than have multiple programs do things, I was trying to one up my configuration and leverage nzbToMedia to do the conversion as I would like to get the 2nd audio track added to help with playback as well. So with that being said, I used the following configuration and wanted to get another set of eyes to check it over and see if I'm missing anything.

[Transcoder]
    # getsubs. enable to download subtitles.
    getSubs = 0
    # subLanguages. create a list of languages in the order you want them in your subtitles.
    subLanguages = eng
    # transcode. enable to use transcoder
    transcode = 1
    ###### duplicate =1 will cretae a new file. =0 will replace the original
    duplicate = 0
    # Only works on Linux. Highest priority is -20, lowest priority is 19.
    niceness = 19
    ignoreExtensions = .avi
    # outputFastStart. 1 will use -movflags + faststart. 0 will disable this from being used.
    outputFastStart = 0
    # outputQualityPercent. used as -q:a value. 0 will disable this from being used.
    outputQualityPercent = 0
    # outputVideoPath. Set path you want transcoded videos moved to. Leave blank to disable.
    outputVideoPath = ""
    # processOutput. 1 will send the outputVideoPath to SickBeard/CouchPotato. 0 will send original files.
    processOutput = 0
    # audioLanguage. set the 3 letter language code you want as your primary audio track.
    audioLanguage = eng
    # allAudioLanguages. 1 will keep all audio tracks (uses AudioCodec3) where available.
    allAudioLanguages = 0
    # allSubLanguages. 1 will keep all exisiting sub languages. 0 will discare those not in your list above.
    allSubLanguages = 0
    # embedSubs. 1 will embded external sub/srt subs into your video if this is supported.
    embedSubs = 1
    # burnInSubtitle. burns the default sub language into your video (needed for players that don't support subs)
    burnInSubtitle = 0
    # extractSubs. 1 will extract subs from the video file and save these as external srt files.
    extractSubs = 0
    # externalSubDir. set the directory where subs should be saved (if not the same directory as the video)
    externalSubDir = ""
    # outputDefault. Loads default configs for the selected device. The remaining options below are ignored.
    # If you want to use your own profile, leave this blank and set the remaining options below.
    # outputDefault profiles allowed: iPad, iPad-1080p, iPad-720p, Apple-TV2, iPod, iPhone, PS3, Roku-1080p, Roku-720p, Roku-480p
    outputDefault = None
    #### Define custom settings below.
    outputVideoExtension = .mp4
    outputVideoCodec = libx264
    VideoCodecAllow = "libx264,h264,h.264,AVC,avc,mpeg4,msmpeg4,MPEG-4"
    outputVideoPreset = medium
    outputVideoFramerate = 24
    outputVideoBitrate = 1000k
    outputAudioCodec = ac3
    AudioCodecAllow = "libfaac,aac,ac3,mp3,libfdk_aac"
    outputAudioBitrate = 640k
    outputAudioTrack2Codec = libfdk_aac
    AudioCodec2Allow = ""
    outputAudioTrack2Bitrate = 128k
    outputAudioOtherCodec = libmp3lame
    AudioOtherCodecAllow = ""
    outputAudioOtherBitrate = 128k
    outputSubtitleCodec = ""

Thanks!

depraved22 commented 10 years ago

Hmm. One slight adjustment as the AAC track has to be before the AC3 track to ensure that playback works without transcoding for IOS devices and non Surround sound setup Rokus. I was using this to convert my AC3 items:

/usr/local/bin/ffmpeg -i "$ORIG" -map 0:0 -map 0:1 -map 0:1 -c:v copy -c:a:0 aac -b:a 128k -ac 2 -strict -2 -cutoff 15000 -c:a:1 copy "$i"  >/dev/null 2>/dev/null

That would put the AAC track as the default track.

clinton-hall commented 10 years ago

Yeah, in this case just swap the acodec and acodec2 (and the allows etc). This script should always put the tracks in the order specified.

Please test and let me know.... While I tried to do this "right" I did make a few guesses at stuff I don't specifically use.

If you can confirm the settings you use that work, I can try and update the "defaults" for Roku and iOS etc...

depraved22 commented 10 years ago

Hmm. I'm close. I'm having issue trying to duplicate this part. I got the flipped part and I want to ensure that my second track is converted to AC3 5.1 as the majority of my items are DTS, I can allow the AC3 through, but if not convert to AC3 5.1

The ffmpeg part would be the "-acodec ac3 -ac 6 -ab 640k"

Having this in my config file seems to not work:

    outputVideoExtension = .mp4
    outputVideoCodec = libx264
    VideoCodecAllow = "libx264,h264,h.264,AVC,avc,mpeg4,msmpeg4,MPEG-4"
    outputVideoPreset = medium
    outputVideoFramerate = 24
    outputVideoBitrate = 1000k
    outputAudioCodec = libfdk_aac
    AudioCodecAllow = libfdk_aac
    outputAudioBitrate = 128k
    outputAudioTrack2Codec = ac3
    AudioCodec2Allow = ac3
    outputAudioTrack2Bitrate = 640k
    outputAudioOtherCodec = libmp3lame
    AudioOtherCodecAllow = ""
    outputAudioOtherBitrate = 128k
    outputSubtitleCodec = ""

Errors out:

[20:09:49] [INFO]::MAIN: Checking for files to be transcoded
Traceback (most recent call last):
  File "./nzbToSickBeard.py", line 235, in <module>
    result = nzbToMedia.main(sys.argv, section)
  File "/opt/nzbToMedia/nzbToMedia.py", line 716, in main
    download_id=download_id, inputCategory=subsection)
  File "/opt/nzbToMedia/nzbToMedia.py", line 563, in process
    inputCategory)
  File "/opt/nzbToMedia/nzbtomedia/autoProcess/autoProcessTV.py", line 188, in processEpisode
    result, newDirName = transcoder.Transcode_directory(dirName)
  File "/opt/nzbToMedia/nzbtomedia/transcoder/transcoder.py", line 390, in Transcode_directory
    command = buildCommands(file, newDir)
  File "/opt/nzbToMedia/nzbtomedia/transcoder/transcoder.py", line 204, in buildCommands
    bitrate = int(audio3[0]["bit_rate"])/1000
IndexError: list index out of range
Exception AttributeError: "'NoneType' object has no attribute 'path'" in <bound method PosixProcess.__del__ of <nzbtomedia.nzbToMediaUtil.PosixProcess instance at 0x7fcfcbf5e878>> ignored
clinton-hall commented 10 years ago

Ah... I don't know that I ever looked at the 5.1 vs stereo etc...

so -ac 6 tells it how many channels to use/build?

I'll dig into this error to see what is going wrong.

depraved22 commented 10 years ago

Yep, it'll make it a 5.1 640k bitrate AC3 encode:

Audio
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : ac-3
Duration                                 : 43mn 51s
Bit rate mode                            : Constant
Bit rate                                 : 640 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 201 MiB (15%)

The goal being to convert away from DTS in the MKV container, which seems to be always transcoded/problematic for Roku/IOS/AFTV. I'm not a true pure audiophile and I can't really tell a solid difference from encoded DTS 5.1 and AC3 5.1 Majority is TV shows anyway for me.

clinton-hall commented 10 years ago

ok... So I'm just looking at documentation for ffmpeg

I'm thinking of having the following

AudioChannels = 2 
AudioTrack2Channels = 6
AudioOtherChannels = ""

The usage being, for the primary audio track we will always downgrade anything greater than (in this case 2) to 2. -ac 2 For second track, we will downgrade anything greater than 6 to 6 -ac 6 For any other tracks, we wouldn't do anything.

Now, I am assuming for this that there would never be any benefit to trying to Up-Mix?? My understanding is this would only work if there were a stack of monotracks that were each for a different speaker??

Does this make sense?

depraved22 commented 10 years ago

Yep, that makes sense to me. You can upmix, but to my understanding, it would just add bloat to the encode, much like converting a DVD up to 1080p.

My one test worked well:

Transcoding video: /data/stage/Done/TV/The Bachelorette/The.Bachelorette.S10E08.Episode.8.mkv
2014-07-10 21:02:59 DEBUG   ::MAIN: calling command: nice -0 /usr/local/bin/ffmpeg -loglevel warning -i /data/stage/Done/TV/The Bachelorette/The.Bachelorette.S10E
08.Episode.8.mkv -map 0:0 -map 0:1 -map 0:1 -c:v copy -r 24.0 -c:a:0 libfdk_aac -b:a:0 128000 -c:a:1 copy -b:a1 640000 -c:s copy /data/stage/Done/TV/The Bachelore
tte/The.Bachelorette.S10E08.Episode.8.mp4
2014-07-10 21:05:16 INFO    ::MAIN: Transcoding of video /data/stage/Done/TV/The Bachelorette/The.Bachelorette.S10E08.Episode.8.mkv to /data/stage/Done/TV/The Bac
helorette/The.Bachelorette.S10E08.Episode.8.mp4 succeeded

Trying to figure out what's wrong with one more encode that is erroring out.

depraved22 commented 10 years ago

Ok. Seems like if a file has some text in it, that creates an issue moving to an mp4 container. The command generates has

-c:s copy

When that flags an error and it should be:

-c:s mov_text

The file has this item in it:

Text
ID                                       : 3
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Language                                 : English
Default                                  : Yes
Forced                                   : No
depraved22 commented 10 years ago

The full generated command was:

/usr/local/bin/ffmpeg -loglevel warning -i "/data/stage/Done/TV/Alaska State Troopers/Alaska.State.Troopers.S06E02.Meth.Knives.and.Spears.720p.HDTV.x264-TERRA.mkv" -map 0:0 -map 0:1 -map 0:1 -map 0:2 -c:v copy -r 24.0 -c:a:0 libfdk_aac -b:a:0 128000 -c:a:1 copy -b:a1 640000 -c:s copy "/data/stage/Done/TV/Alaska State Troopers/Alaska.State.Troopers.S06E02.Meth.Knives.and.Spears.720p.HDTV.x264-TERRA.mp4"

I changed it to:

/usr/local/bin/ffmpeg -loglevel warning -i "/data/stage/Done/TV/Alaska State Troopers/Alaska.State.Troopers.S06E02.Meth.Knives.and.Spears.720p.HDTV.x264-TERRA.mkv" -map 0:0 -map 0:1 -map 0:1 -map 0:2 -c:v copy -r 24.0 -c:a:0 libfdk_aac -b:a:0 128000 -c:a:1 copy -b:a1 640000 -c:s mov_text "/data/stage/Done/TV/Alaska State Troopers/Alaska.State.Troopers.S06E02.Meth.Knives.and.Spears.720p.HDTV.x264-TERRA.mp4"

And that resolved that issue.

clinton-hall commented 10 years ago

just set outputSubtitleCodec=mov_text

This should take care of it... I wasn't sure about subtitle allowed codecs... so for all my "presets" I just force these to mov_text and figured that while this wasn't elegant (to have to force them) the subs shouldn't take too long...

clinton-hall commented 10 years ago

Ok... you can specify audio channels now...

clinton-hall commented 10 years ago

BTW.

These are my pre-build Defaults. https://github.com/clinton-hall/nzbToMedia/blob/nightly/nzbtomedia/__init__.py#L416-L497

I would like to get these to be such that anyone can select these to convert for playback on ipad (I did a test on this and it worked, but I never looked at audio channels and bitrate etc)... So if you have any suggestions as to what SHOULD be in the prebuilt defaults.... please let me know.

depraved22 commented 10 years ago

I'll give it some testing and validate.

My only change that I did as I moved away from libfaac and to libfdk_aac as it supposed to be better.

https://trac.ffmpeg.org/wiki/Encode/AAC#libfaac

Albeit, if I'm talking about 2 channel audio, do I really care that much? I dunno. The other presets look good from the iPad and Roku as I've been messing with those for a bit now.

clinton-hall commented 10 years ago

Thanks.

To be honest, I have transcoded a total of 4 videos... for the purpose of testing this script. So everything here has been done by reading a few different sites, setting things as users make suggestions, or otherwise making what seems to be a logical guess...

depraved22 commented 10 years ago

So far, all seems well. I had 2 shows come through with just had passthru ac3 for that 2nd track. Worked fine. I'm going to test tomorrow with some DTS files to validate that as well.

The plex forums are very helpful for encoding for the various devices as well as my overall goal is to have a better container that is a bit more portable for the various players that my friends are using with my home setup. I rather do the work at that time rather than using a big rig with a ton of CPU to transcode everything on the fly.

clinton-hall commented 10 years ago

Yeah, that makes sense. I hate trying to go back and do a bulk clean-up when you can just do it as you go...

Any suggested improvements I'll be happy to try and add.

I'm probably going to merge this all up to master soon (to fix a few bugs)... but I'll leave the issue open until we can confirm that DTS down-mixing works etc.

depraved22 commented 10 years ago

Hmm. Ok. Everything looks good manually.

Only challenge I'm having is that I'm not seeing all the variables in the NZBGet to tweak those settings, namely, the outputAudioTrackChannels stuff that was added. I realized I had not gone back and updated my automated settings in there, which was causing my stuff not to be transcoded.

depraved22 commented 10 years ago

Ah, just the default sections need to be added to: nzbToSickBeard.py nzbToCouchPotato.py

so it matches the defaults in nzbToMedia.py

# ffmpeg output settings.
#outputVideoExtension=.mp4
#outputVideoCodec=libx264
#VideoCodecAllow=
#outputVideoPreset=medium
#outputVideoFramerate=24
#outputVideoBitrate=800k
#outputAudioCodec=ac3
#AudioCodecAllow=
#outputAudioChannels=6
#outputAudioBitrate=640k
#outputQualityPercent=
#outputAudioTrack2Codec=libfaac
#AudioCodec2Allow=
#outputAudioTrack2Channels=2
#outputAudioTrack2Bitrate=160k
#outputAudioOtherCodec=libmp3lame
#AudioOtherCodecAllow=
#outputAudioOtherChannels=2
#outputAudioOtherBitrate=128k
#outputSubtitleCodec=
depraved22 commented 10 years ago

DTS conversion works well too. I tested with a few movies this and they properly converted to AC3 5.1 with the 1st track being the AAC.

clinton-hall commented 10 years ago

Ah, yeah.... I missed the settings in nzbToSickBeard and nzbToCouchPotato....

Sorry about that. I'll add soon.

clinton-hall commented 10 years ago

ok, those options are added back in.

clinton-hall commented 10 years ago

I believe this is all good then... I'm going to close, but please let me know if there are any issues that appear.

imadunatic commented 10 years ago

Depraved/Clinton,

Is this working for you? Oddly, I have almost the exact same options set up, and if I happen to grab a MKV movie that has DTS audio, it doesn't transcode. No errors, it just says that transcoding failed:

[15:09:17] [DEBUG]::MAIN: Not using: git
[15:09:17] [DEBUG]::MAIN: Unable to find your git executable - Set git_path in your autoProcessMedia.cfg OR delete your .git folder and run from source to enable updates.
[15:09:17] [DEBUG]::MAIN: No git specified, can't use git commands
[15:09:17] [INFO]::MAIN: Version checking is disabled, not checking for the newest version
[15:09:17] [INFO]::MAIN: nzbToMedia Version:10.3 Branch:master (Windows 7)
[15:09:17] [INFO]::MAIN: #########################################################
[15:09:17] [INFO]::MAIN: ## ..::[nzbToMedia.py]::.. ##
[15:09:17] [INFO]::MAIN: #########################################################
[15:09:17] [DEBUG]::MAIN: Options passed into nzbToMedia: ['G:\\Windows Stuff DO NOT DELETE WITHOUT CAUTION\\Program Files\\SABnzbd\\scripts\\nzbToMedia\\nzbToMedia.py', 'G:\\Downloads\\Newzbin\\UnRar\\movie\\Locke.2013.BluRay.720p.x264.DTS-HDWinG', 'Locke.2013.BluRay.720p.x264.DTS-HDWinG.nzb', 'Locke.2013.BluRay.720p.x264.DTS-HDWinG', '', 'movie', 'alt.binaries.boneless', '0']
[15:09:17] [INFO]::MAIN: Script triggered from SABnzbd
[15:09:17] [DEBUG]::MAIN: Adding NZB download info for directory G:\Downloads\Newzbin\UnRar\movie\Locke.2013.BluRay.720p.x264.DTS-HDWinG to database
[15:09:17] [DB]::MAIN: nzbtomedia.db: UPDATE downloads SET status = ?, client_agent = ?, last_update = ?, input_id = ?, input_hash = ?, input_name = ? WHERE input_directory = ? with args [0, u'sabnzbd', 735442, u'', u'', u'Locke.2013.BluRay.720p.x264.DTS-HDWinG.nzb', u'G:\\Downloads\\Newzbin\\UnRar\\movie\\Locke.2013.BluRay.720p.x264.DTS-HDWinG']
[15:09:17] [DB]::MAIN: nzbtomedia.db: INSERT OR IGNORE INTO downloads (status, client_agent, last_update, input_id, input_hash, input_name, input_directory) VALUES (?, ?, ?, ?, ?, ?, ?) with args [0, u'sabnzbd', 735442, u'', u'', u'Locke.2013.BluRay.720p.x264.DTS-HDWinG.nzb', u'G:\\Downloads\\Newzbin\\UnRar\\movie\\Locke.2013.BluRay.720p.x264.DTS-HDWinG']
[15:09:17] [INFO]::MAIN: Auto-detected SECTION:CouchPotato
[15:09:17] [INFO]::MAIN: Calling CouchPotato:movie to post-process:Locke.2013.BluRay.720p.x264.DTS-HDWinG.nzb
[15:09:17] [INFO]::MAIN: Attemping imdbID lookup for Locke.2013.BluRay.720p.x264.DTS-HDWinG.nzb
[15:09:17] [INFO]::MAIN: Searching folder and file names for imdbID ...
[15:09:17] [INFO]::MAIN: Searching IMDB for imdbID ...
[15:09:17] [DEBUG]::MAIN: Opening URL: http://www.omdbapi.com
[15:09:18] [INFO]::MAIN: Found imdbID [tt2692904]
[15:09:18] [DEBUG]::MAIN: Opening URL: http://localhost:8082/api/REMOVED/media.get with PARAMS: {'id': u'tt2692904'}
[15:09:19] [INFO]::TRANSCODER: Checking [Locke.2013.BluRay.720p.x264.DTS-HDWinG.mkv] for corruption, please stand by ...
[15:09:20] [INFO]::TRANSCODER: SUCCESS: [Locke.2013.BluRay.720p.x264.DTS-HDWinG.mkv] has no corruption.
[15:09:20] [INFO]::MAIN: Checking for files to be transcoded
[15:09:20] [INFO]::MAIN: Transcoding video: G:\Downloads\Newzbin\UnRar\movie\Locke.2013.BluRay.720p.x264.DTS-HDWinG\Locke.2013.BluRay.720p.x264.DTS-HDWinG.mkv
[15:09:20] [DEBUG]::MAIN: calling command: G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\ffmpeg\bin\ffmpeg.exe -loglevel warning -i G:\Downloads\Newzbin\UnRar\movie\Locke.2013.BluRay.720p.x264.DTS-HDWinG\Locke.2013.BluRay.720p.x264.DTS-HDWinG.mkv -map 0:0 -map 0:1 -map 0:1 -map 0:2 -c:v copy -c:a:0 ac3 -b:a:0 640000 -c:a:1 copy -ac:1 2 -b:a1 128000 -c:s copy G:\Downloads\Newzbin\UnRar\movie\Locke.2013.BluRay.720p.x264.DTS-HDWinG\Locke.2013.BluRay.720p.x264.DTS-HDWinG.mp4
[15:09:20] [ERROR]::MAIN: Transcoding of video G:\Downloads\Newzbin\UnRar\movie\Locke.2013.BluRay.720p.x264.DTS-HDWinG\Locke.2013.BluRay.720p.x264.DTS-HDWinG.mkv to G:\Downloads\Newzbin\UnRar\movie\Locke.2013.BluRay.720p.x264.DTS-HDWinG\Locke.2013.BluRay.720p.x264.DTS-HDWinG.mp4 failed
[15:09:20] [WARNING]::COUCHPOTATO: Transcoding failed for files in G:\Downloads\Newzbin\UnRar\movie\Locke.2013.BluRay.720p.x264.DTS-HDWinG
[15:09:20] [DEBUG]::COUCHPOTATO: Opening URL: http://localhost:8082/api/REMOVED/renamer.scan with PARAMS: {'download_id': u'SABnzbd_nzo_w-xlt_', 'media_folder': 'G:\\Downloads\\Newzbin\\UnRar\\movie\\Locke.2013.BluRay.720p.x264.DTS-HDWinG', 'downloader': u'Sabnzbd'}
[15:09:20] [POSTPROCESS]::COUCHPOTATO: Starting renamer scan for Locke.2013.BluRay.720p.x264.DTS-HDWinG.nzb
[15:09:22] [POSTPROCESS]::COUCHPOTATO: SUCCESS: Finished renamer scan for folder G:\Downloads\Newzbin\UnRar\movie\Locke.2013.BluRay.720p.x264.DTS-HDWinG
[15:09:22] [POSTPROCESS]::COUCHPOTATO: Checking for status change, please stand by ...
[15:09:22] [DEBUG]::MAIN: Opening URL: http://localhost:8082/api/REMOVED/media.get with PARAMS: {'id': u'daeb9e853a3a479a940e57a575c9a160'}
[15:09:23] [POSTPROCESS]::COUCHPOTATO: SUCCESS: Release Locke.2013.BluRay.720p.x264.DTS-HDWinG.nzb has now been marked with a status of [DONE]
[15:09:23] [DB]::DB: Updating status of our download Locke.2013.BluRay.720p.x264.DTS-HDWinG.nzb in the DB to 1
[15:09:23] [DB]::MAIN: nzbtomedia.db: UPDATE downloads SET status=?, last_update=? WHERE input_name=? with args [1, 735442, u'Locke.2013.BluRay.720p.x264.DTS-HDWinG.nzb']
[15:09:23] [INFO]::CLEANDIR: Directory G:\Downloads\Newzbin\UnRar\movie\Locke.2013.BluRay.720p.x264.DTS-HDWinG has been processed and removed ...
[15:09:23] [INFO]::MAIN: The G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py script completed successfully.

I would like to have all my MKV files remuxed to MP4, with DTS (if present) converted to AC3 6 channel and the video codec copied. Here are my settings:

[Transcoder]
    # getsubs. enable to download subtitles.
    getSubs = 0
    # subLanguages. create a list of languages in the order you want them in your subtitles. 
    subLanguages = eng, spa, fra
    # transcode. enable to use transcoder
    transcode = 1
    ###### duplicate =1 will cretae a new file. =0 will replace the original
    duplicate = 0
    ignoreExtensions = .avi, .mp4
    # outputFastStart. 1 will use -movflags + faststart. 0 will disable this from being used.
    outputFastStart = 0
    # outputQualityPercent. used as -q:a value. 0 will disable this from being used.
    outputQualityPercent = 0
    # outputVideoPath. Set path you want transcoded videos moved to. Leave blank to disable.
    outputVideoPath = ""
    # processOutput. 1 will send the outputVideoPath to SickBeard/CouchPotato. 0 will send original files.
    processOutput = 0
    # audioLanguage. set the 3 letter language code you want as your primary audio track.
    audioLanguage = eng
    # allAudioLanguages. 1 will keep all audio tracks (uses AudioCodec3) where available.
    allAudioLanguages = 0
    # allSubLanguages. 1 will keep all exisiting sub languages. 0 will discare those not in your list above.
    allSubLanguages = 0
    # embedSubs. 1 will embded external sub/srt subs into your video if this is supported.
    embedSubs = 0
    # burnInSubtitle. burns the default sub language into your video (needed for players that don't support subs)
    burnInSubtitle = 0
    # extractSubs. 1 will extract subs from the video file and save these as external srt files.
    extractSubs = 0
    # externalSubDir. set the directory where subs should be saved (if not the same directory as the video)
    externalSubDir = ""
    # outputDefault. Loads default configs for the selected device. The remaining options below are ignored.
    # If you want to use your own profile, leave this blank and set the remaining options below.
    # outputDefault profiles allowed: iPad, iPad-1080p, iPad-720p, Apple-TV2, iPod, iPhone, PS3, Roku-1080p, Roku-720p, Roku-480p
    outputDefault = ""
    #### Define custom settings below.
    outputVideoExtension = .mp4
    outputVideoCodec = copy
    VideoCodecAllow = ""
    outputVideoPreset = ""
    outputVideoFramerate = ""
    outputVideoBitrate = ""
    outputAudioCodec = ac3
    AudioCodecAllow = "ac3,mp3"
    outputAudioChannels = 6
    outputAudioBitrate = 640k
    outputAudioTrack2Codec = ""
    AudioCodec2Allow = ""
    outputAudioTrack2Channels = 2
    outputAudioTrack2Bitrate = 128000
    outputAudioOtherCodec = libmp3lame
    AudioOtherCodecAllow = ""
    outputAudioOtherChannels = ""
    outputAudioOtherBitrate = 128000
    outputSubtitleCodec = ""

Am I missing something? I created a batch script to do this same thing when I manually need to convert and it works fine:

for %%a in ("*.mkv") do ffmpeg -i "%%a" -c:v copy -c:a ac3 -ab 640k "%%~na.mp4"
pause

The text output from the transcoder looks similar as far as the audio output(I am far from a ffmpeg expert):

ffmpeg.exe -loglevel warning -i G:\Downloads\Newzbin\UnRar\movie\Locke.2013.BluRay.720p.x264.DTS-HDWinG\Locke.2013.BluRay.720p.x264.DTS-HDWinG.mkv -map 0:0 -map 0:1 -map 0:1 -map 0:2 -c:v copy -c:a:0 ac3 -b:a:0 640000 -c:a:1 copy -ac:1 2 -b:a1 128000 -c:s copy

Any ideas?

Thanks again for the help.

clinton-hall commented 10 years ago

So what happens if you call this command?

"G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\ffmpeg\bin\ffmpeg.exe" -loglevel warning -i G:\Downloads\Newzbin\UnRar\movie\Locke.2013.BluRay.720p.x264.DTS-HDWinG\Locke.2013.BluRay.720p.x264.DTS-HDWinG.mkv -map 0:0 -map 0:1 -map 0:1 -map 0:2 -c:v copy -c:a:0 ac3 -b:a:0 640000 -c:a:1 copy -ac:1 2 -b:a1 128000 -c:s copy G:\Downloads\Newzbin\UnRar\movie\Locke.2013.BluRay.720p.x264.DTS-HDWinG\Locke.2013.BluRay.720p.x264.DTS-HDWinG.mp4

There should be some error message?

imadunatic commented 10 years ago

There is (sorry about the formatting, CMD windows are not great for copy-paste)


C:\Users\Kevin>ffmpeg.exe -loglevel warning -i "C:\Users\Kevin\Desktop\Video Con
version\Locke (2013) 720p.mkv" -map 0:0 -map 0:1 -map 0:1 -map 0:2 -c:v copy -c:
a:0 ac3 -b:a:0 640000 -c:a:1 copy -ac:1 2 -b:a1 128000 -c:s copy "C:\Users\Kevin
\Desktop\Video Conversion\Locke (2013) 720p.mp4"
[matroska,webm @ 00000000003192e0] Could not find codec parameters for stream 2
(Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mp4 @ 0000000004e1a3a0] Using AVStream.codec.time_base as a timebase hint to th
e muxer is deprecated. Set AVStream.time_base instead.
    Last message repeated 3 times
[mp4 @ 0000000004e1a3a0] track 2: codec frame size is not set
[mp4 @ 0000000004e1a3a0] Could not find tag for codec hdmv_pgs_subtitle in strea
m #3, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Error
number -22 occurred
imadunatic commented 10 years ago

I eliminated the loglevel parameter for some more insight:

C:\Users\Kevin>ffmpeg.exe -i "C:\Users\Kevin\Desktop\Video Conversion\Locke (201
3) 720p.mkv" -map 0:0 -map 0:1 -map 0:1 -map 0:2 -c:v copy -c:a:0 ac3 -b:a:0 640
000 -c:a:1 copy -ac:1 2 -b:a1 128000 -c:s copy "C:\Users\Kevin\Desktop\Video Con
version\Locke (2013) 720p.mp4"
ffmpeg version N-64654-g2db1bcf Copyright (c) 2000-2014 the FFmpeg developers
  built on Jul 13 2014 22:08:34 with gcc 4.8.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-lib
modplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge
r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --en
able-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
 --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-
libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 46.100 / 55. 46.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 10.100 /  4. 10.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
[matroska,webm @ 0000000002b09240] Could not find codec parameters for stream 2
(Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, matroska,webm, from 'C:\Users\Kevin\Desktop\Video Conversion\Locke (20
13) 720p.mkv':
  Metadata:
    encoder         : libebml v1.3.0 + libmatroska v1.4.1
    creation_time   : 2014-07-27 06:19:15
  Duration: 01:24:49.92, start: 0.000000, bitrate: 6525 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x534, SAR 1:1 DAR 640:267
, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (de
fault)
    Stream #0:2(eng): Subtitle: hdmv_pgs_subtitle (default)
File 'C:\Users\Kevin\Desktop\Video Conversion\Locke (2013) 720p.mp4' already exi
sts. Overwrite ? [y/N] y
[mp4 @ 0000000004e1a3a0] Using AVStream.codec.time_base as a timebase hint to th
e muxer is deprecated. Set AVStream.time_base instead.
    Last message repeated 3 times
[mp4 @ 0000000004e1a3a0] track 2: codec frame size is not set
[mp4 @ 0000000004e1a3a0] Could not find tag for codec hdmv_pgs_subtitle in strea
m #3, codec not currently supported in container
Output #0, mp4, to 'C:\Users\Kevin\Desktop\Video Conversion\Locke (2013) 720p.mp
4':
  Metadata:
    encoder         : Lavf55.46.100
    Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x534 [S
AR 1:1 DAR 640:267], q=2-31, 23.98 fps, 16k tbn, 1k tbc (default)
    Stream #0:1(eng): Audio: ac3 ([165][0][0][0] / 0x00A5), 48000 Hz, stereo, fl
tp, 128 kb/s (default)
    Metadata:
      encoder         : Lavc55.69.100 ac3
    Stream #0:2(eng): Audio: dts ([169][0][0][0] / 0x00A9), 48000 Hz, 5.1(side),
 128 kb/s (default)
    Stream #0:3(eng): Subtitle: hdmv_pgs_subtitle (default)
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (dts (dca) -> ac3 (native))
  Stream #0:1 -> #0:2 (copy)
  Stream #0:2 -> #0:3 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): Error
number -22 occurred
imadunatic commented 10 years ago

I hate to think this through out loud on the issues page, but it looks like it is trying to copy the original DTS stream and map it to stream 2 rather than encode it to MP3.... maybe?

EDIT: That is my settings.... I think it's the subtitles giving me fits again...

imadunatic commented 10 years ago

Ok. Apparently subtitle codecs are not supported in MP4 (maybe an ffmpeg pro can enlighten us?). Once I stripped out the mapping for the subtitle stream, all was well:

ffmpeg.exe -i "C:\Users\Kevin\Desktop\Video Conversion\Locke (2013) 720p.mkv" -map 0:0 -map 0:1 -map 0:1 -c:v copy -c:a:0 ac3 -b:a:0 640000 -c:a:1 libmp3lame -ac:1 2 -b:a1 128000 "C:\Users\Kevin\Desktop\Video Conversion\Locke (2013) 720p.mp4"

This did exactly what I wanted.

Any ideas on the workaround (like deleting the subtitle stream if present? I don't use them anyways)?

clinton-hall commented 10 years ago

to stop subtitles being included you can set

[Transcoder]
    subLanguages = ""

but mp4 should be able to support subs, but these need to be converted to an acceptable format.

[Transcoder]
    outputSubtitleCodec = mov_text
imadunatic commented 10 years ago

Perfect. Thanks for helping me troubleshoot transcoder settings (again.....) I added the mov_text (I was mistyping "move_text" earlier in my debugging) and it transcoded fine...

imadunatic commented 10 years ago

Apparently I spoke too soon, I had removed the map option for text earlier and it wasn't actually doing anything with the text files. I started fresh, and this is the error I get:

C:\Users\Kevin>ffmpeg.exe -i "C:\Users\Kevin\Desktop\Video Conversion\Locke (201
3) 720p.mkv" -map 0:0 -map 0:1 -map 0:2 -c:v copy -c:a:0 ac3 -b:a:0 640000 -c:s
mov_text "C:\Users\Kevin\Desktop\Video Conversion\Locke (2013) 720p.mp4"
ffmpeg version N-64654-g2db1bcf Copyright (c) 2000-2014 the FFmpeg developers
  built on Jul 13 2014 22:08:34 with gcc 4.8.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-lib
modplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge
r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --en
able-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
 --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-
libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 46.100 / 55. 46.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 10.100 /  4. 10.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
[matroska,webm @ 0000000002b0f680] Could not find codec parameters for stream 2
(Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, matroska,webm, from 'C:\Users\Kevin\Desktop\Video Conversion\Locke (20
13) 720p.mkv':
  Metadata:
    encoder         : libebml v1.3.0 + libmatroska v1.4.1
    creation_time   : 2014-07-27 06:19:15
  Duration: 01:24:49.92, start: 0.000000, bitrate: 6525 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x534, SAR 1:1 DAR 640:267
, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (de
fault)
    Stream #0:2(eng): Subtitle: hdmv_pgs_subtitle (default)
File 'C:\Users\Kevin\Desktop\Video Conversion\Locke (2013) 720p.mp4' already exi
sts. Overwrite ? [y/N] y
Output #0, mp4, to 'C:\Users\Kevin\Desktop\Video Conversion\Locke (2013) 720p.mp
4':
  Metadata:
    encoder         : libebml v1.3.0 + libmatroska v1.4.1
    Stream #0:0(eng): Video: h264, yuv420p, 1280x534 [SAR 1:1 DAR 640:267], q=2-
31, 23.98 fps, 1k tbc (default)
    Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
    Metadata:
      encoder         : Lavc55.69.100 ac3
    Stream #0:2(eng): Subtitle: mov_text, 128 kb/s (default)
    Metadata:
      encoder         : Lavc55.69.100 mov_text
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (dts (dca) -> ac3 (native))
  Stream #0:2 -> #0:2 (hdmv_pgs_subtitle (pgssub) -> mov_text (native))
Error while opening encoder for output stream #0:2 - maybe incorrect parameters
such as bit_rate, rate, width or height

I also don't see the "sublanguages" parameter, do I need to add that somewhere to not include subtitles?

clinton-hall commented 10 years ago

it looks like it can't actually read the hdmv_pgs_subtitle codec... I'm trying to think if there is a way to identify the error and automatically skip that stream...

anyway, to disable subs, the sublanguages are the 2nd itm in Transcode settings

[Transcoder]
    # getsubs. enable to download subtitles.
    getSubs = 0
    # subLanguages. create a list of languages in the order you want them in your subtitles. 
    subLanguages = eng, spa, fre
imadunatic commented 10 years ago

For me, that would be great if it would just skip the text stream if it can't read it; but honestly, I can't even figure out a way to manually do that in ffmpeg; ffmpeg just quits as soon as it gets that error with no option to continue the transcode. This is surely a rarity (the text codec), I think for now I will just disable the text streams so that it works.

If I can do anything to help, I gladly will. Off to bed now, thanks again.

I don't think we're alone:

I removed this link, it really wasn't relevant at all, I think I was just tired..

imadunatic commented 10 years ago

This is a little more relevant:

http://ffmpeg.gusari.org/viewtopic.php?f=16&t=803

Apparently this particular flavor of subtitle is actually an image, and there is no direct translate to text from it (and I'm sure from a code standpoint it's nearly impossible).

Is there any way for ffprobe to distinguish this type of subtitle and have nzbtomedia not try to transcode it?

Like I said, I personally have no use for subtitles and once you spoon-fed me the locations of the subtitle languages, I have disabled it , but I know most people do prefer to keep subtitles intact.

Another link: http://superuser.com/questions/649327/what-file-extensions-does-ffmpeg-support

Only mkv and mpegts support the hdmv_pgs_subtitle, hence the failure when remuxing to an mp4 container.

Maybe this is beyond the scope of what your trying to do with nzbtomedia?

imadunatic commented 10 years ago

Just had a failure:

[11:01:23] [INFO]::TRANSCODER: Checking [sbuS LN-462X 1.5DD yaRulB P0801 )4102( haoN.mkv] for corruption, please stand by ...
[11:01:23] [INFO]::TRANSCODER: SUCCESS: [sbuS LN-462X 1.5DD yaRulB P0801 )4102( haoN.mkv] has no corruption.
[11:01:23] [INFO]::MAIN: Checking for files to be transcoded
Traceback (most recent call last):
  File "G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 752, in <module>
    exit(main(sys.argv))
  File "G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 682, in main
    download_id='')
  File "G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 575, in process
    inputCategory)
  File "G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbtomedia\autoProcess\autoProcessMovie.py", line 195, in process
    result, newDirName = transcoder.Transcode_directory(dirName)
  File "G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbtomedia\transcoder\transcoder.py", line 432, in Transcode_directory
    command = buildCommands(file, newDir)
  File "G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbtomedia\transcoder\transcoder.py", line 307, in buildCommands
    subs1 = [ item for item in subStreams if item["tags"]["language"] == lan ]
KeyError: 'language'

Looks to me like it is looking for subtitle languages even though I've deleted the "sublanguages" options:

[Transcoder]
    # getsubs. enable to download subtitles.
    getSubs = 0
    # subLanguages. create a list of languages in the order you want them in your subtitles. 
    subLanguages = ""

Should I open this as a new issue? It appears this is more of a subtitle transcode problem as opposed to the issue depraved originally opened this for.

imadunatic commented 10 years ago

For now, I just added eng back to my subtitle languages, it still errors out if I encounter an mkv with the hdmv_pgs_subtitle codec; however, nearly every file with subtitles fails if there is no language listed. Any handy way to strip out subtitles completely by passing an option (or deleting the map) if so desired? I know the option -sn removes them completely, maybe add a switch that would pass -sn to ffmpeg?

http://stackoverflow.com/questions/12131789/how-to-disable-subtitles-decoding-in-ffmpeg

clinton-hall commented 10 years ago

now, if you don't have any sub languages, this should work... this was a fault in the way I passed the sub language parameter...

I have also added a bypass of this codec name when not .mkv or .mpegts

this is in nightly branch. I would appreciate it if you could test both methods with a video that has these codecs... i.e test subtitle languages = "" and subtitle languages = eng

imadunatic commented 10 years ago

Ok, these files have been giving me errors so I figured a few more episodes would be a good test. They are mkv and they do have a subtitle track. Files which don't have a subtitle track are transcoding fine.

WIth languages = eng:

[18:19:38] [INFO]::MAIN: FLATTEN: Flattening directory: G:\Downloads\Newzbin\UnRar\nzbdrone\American.Dad.S02E03.NTSC.DVD.DD5.1.x264-Jason28
[18:19:38] [DEBUG]::MAIN: Checking for empty folders in:G:\Downloads\Newzbin\UnRar\nzbdrone\American.Dad.S02E03.NTSC.DVD.DD5.1.x264-Jason28
[18:19:38] [DEBUG]::MAIN: Checking for empty folders in:G:\Downloads\Newzbin\UnRar\nzbdrone\American.Dad.S02E03.NTSC.DVD.DD5.1.x264-Jason28\WaiHbDARTsx7OpBsUGcWtFGbEhJ5Ya814Nqu5rZs
[18:19:38] [DEBUG]::MAIN: Removing empty folder:G:\Downloads\Newzbin\UnRar\nzbdrone\American.Dad.S02E03.NTSC.DVD.DD5.1.x264-Jason28\WaiHbDARTsx7OpBsUGcWtFGbEhJ5Ya814Nqu5rZs
[18:19:38] [POSTPROCESS]::NZBDRONE: SUCCESS: The download succeeded, sending a post-process request
[18:19:38] [INFO]::MAIN: Checking for files to be transcoded
Traceback (most recent call last):
  File "G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 764, in <module>
    exit(main(sys.argv))
  File "G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 682, in main
    download_id='')
  File "G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 578, in process
    inputCategory)
  File "G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbtomedia\autoProcess\autoProcessTV.py", line 209, in processEpisode
    result, newDirName = transcoder.Transcode_directory(dirName)
  File "G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbtomedia\transcoder\transcoder.py", line 433, in Transcode_directory
    command = buildCommands(file, newDir)
  File "G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbtomedia\transcoder\transcoder.py", line 308, in buildCommands
    subs1 = [ item for item in subStreams if item["tags"]["language"] == lan ]
KeyError: 'tags'

With languages set to ""

[18:15:14] [INFO]::MAIN: Checking for files to be transcoded
[18:15:14] [INFO]::MAIN: Transcoding video: G:\Downloads\Newzbin\UnRar\nzbdrone\American.Dad.S02E02.NTSC.DVD.DD5.1.x264-Jason28\american.dad.s02e02.ntsc.dvd.dd5.1.x264-jason28.mkv
[18:15:14] [DEBUG]::MAIN: calling command: G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\ffmpeg\bin\ffmpeg.exe -loglevel warning -i G:\Downloads\Newzbin\UnRar\nzbdrone\American.Dad.S02E02.NTSC.DVD.DD5.1.x264-Jason28\american.dad.s02e02.ntsc.dvd.dd5.1.x264-jason28.mkv -map 0:0 -map 0:1 -map 0:1 -c:v copy -c:a:0 copy -b:a:0 640000 -c:a:1 copy -c:s copy G:\Downloads\Newzbin\UnRar\nzbdrone\American.Dad.S02E02.NTSC.DVD.DD5.1.x264-Jason28\american.dad.s02e02.ntsc.dvd.dd5.1.x264-jason28.mp4
[18:15:16] [INFO]::MAIN: Transcoding of video G:\Downloads\Newzbin\UnRar\nzbdrone\American.Dad.S02E02.NTSC.DVD.DD5.1.x264-Jason28\american.dad.s02e02.ntsc.dvd.dd5.1.x264-jason28.mkv to G:\Downloads\Newzbin\UnRar\nzbdrone\American.Dad.S02E02.NTSC.DVD.DD5.1.x264-Jason28\american.dad.s02e02.ntsc.dvd.dd5.1.x264-jason28.mp4 succeeded
[18:15:16] [DEBUG]::NZBDRONE: SUCCESS: Transcoding succeeded for files in G:\Downloads\Newzbin\UnRar\nzbdrone\American.Dad.S02E02.NTSC.DVD.DD5.1.x264-Jason28
[18:15:16] [DEBUG]::NZBDRONE: path: G:\Downloads\Newzbin\UnRar\nzbdrone\American.Dad.S02E02.NTSC.DVD.DD5.1.x264-Jason28
[18:15:16] [DEBUG]::NZBDRONE: Opening URL: http://localhost:8989/api/command with data: {"path": "G:\\Downloads\\Newzbin\\UnRar\\nzbdrone\\American.Dad.S02E02.NTSC.DVD.DD5.1.x264-Jason28", "name": "DownloadedEpisodesScan"}
[18:15:16] [POSTPROCESS]::NZBDRONE: {
[18:15:16] [POSTPROCESS]::NZBDRONE:   "name": "DownloadedEpisodesScan",
[18:15:16] [POSTPROCESS]::NZBDRONE:   "startedOn": "0001-01-01T00:00:00Z",
[18:15:16] [POSTPROCESS]::NZBDRONE:   "stateChangeTime": "2014-07-29T22:15:16.7131093Z",
[18:15:16] [POSTPROCESS]::NZBDRONE:   "sendUpdatesToClient": false,
[18:15:16] [POSTPROCESS]::NZBDRONE:   "state": "pending",
[18:15:16] [POSTPROCESS]::NZBDRONE:   "id": 2265
[18:15:16] [POSTPROCESS]::NZBDRONE: }
[18:15:36] [DEBUG]::NZBDRONE: The directory G:\Downloads\Newzbin\UnRar\nzbdrone\American.Dad.S02E02.NTSC.DVD.DD5.1.x264-Jason28 has been removed. Renaming was successful.
Traceback (most recent call last):
  File "G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 764, in <module>
    exit(main(sys.argv))
  File "G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 682, in main
    download_id='')
  File "G:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 591, in process
    if result[0] == 0:
TypeError: 'int' object has no attribute '__getitem__'
clinton-hall commented 10 years ago

thanks for this... you identified a bug in the NZBDrone script... I have just fixed this. I have also fixed the issue with subtitles when "tags" aren't found.

imadunatic commented 10 years ago

Confirmed. Transocoded 2 files, one with "eng" set, and one blank. Both successfully completed.

Thanks again.

clinton-hall commented 10 years ago

no worries.. thanks for helping debug this.

Given the amount of changes, I'm still quite happy with the way it went... I was always expecting to have a few cases/combinations that I didn't test...