clinton-hall / nzbToMedia

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

Transcoder Error: Could not convert string to float #473

Closed imadunatic closed 10 years ago

imadunatic commented 10 years ago

I have nzbtomedia running from source now, and it seems to be executing fine; however, I'm getting this error in my post proc script log:

Traceback (most recent call last): File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 676, in exit(main(sys.argv)) File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 530, in main nzbtomedia.initialize(section) File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbtomediainit.py", line 354, in initialize VFRAMERATE = float(CFG["Transcoder"]["outputVideoFramerate"].strip()) ValueError: could not convert string to float:

The postprocessor then exits and stops. I would like the transcoder to copy the video stream, transcode the audio to ac3 (if necessary) and remux the file to an mp4. These are the settings I have for the transcoder:

Define custom settings below.

outputVideoExtension = .mp4
outputVideoCodec = ""
VideoCodecAllow = ""
outputVideoPreset = ""
outputVideoFramerate = ""
outputVideoBitrate = ""
outputAudioCodec = ac3
AudioCodecAllow = ac3
outputAudioBitrate = 640000
outputAudioTrack2Codec = ""
AudioCodec2Allow = ""
outputAudioTrack2Bitrate = ""
outputAudioOtherCodec = ""
AudioOtherCodecAllow = ""
outputAudioOtherBitrate = ""
outputSubtitleCodec = ""

Is this correct? I know the old version I just left the fields blank and that equated to a copy, is it still the case now?

Thanks

imadunatic commented 10 years ago

I disabled the transcoder and I'm still getting the same result.... ?

clinton-hall commented 10 years ago

Ah... Can you try removing all of the "" and just leave those fields blank.

If you don't have ffprobe installed, then it will work similar to the old version. If you have ffprobe installed you need to specify the list of VideoCodecAllow or specify outputVideoCodec = copy

I hadn't considered this combination specifically when I re-wrote the transcoder...I'll no doubt need a few more tweaks.

imadunatic commented 10 years ago

I tried deleting them, but they keep coming back.... and oddly, I modified the couchpotato settings for my installation (which happens to be "movies" instead of "movie") and after saving, closing and reopening, the original entry is in the autoconfig file along with the one I created:

[CouchPotato]

autoProcessing for Movies

#### movie - category that gets called for post-processing with CPS
[[movie]]
    enabled = 0
    apikey = ""
    host = localhost
    port = 5050
    ###### ADVANCED USE - ONLY EDIT IF YOU KNOW WHAT YOU'RE DOING ######
    ssl = 0
    web_root = ""
    # Enable/Disable linking for Torrents
    Torrent_NoLink = 0
    method = renamer
    delete_failed = 0
    wait_for = 2
    extract = 1
    # Set this to minimum required size to consider a media file valid (in MB)
    minSize = 0
    # Enable/Disable deleteing ignored files (samples and invalid media files)
    delete_ignored = 0
    ##### Enable if Couchpotato is on a remote server for this category
    remote_path = 0
    ##### Set to path where download client places completed downloads locally for this category
    watch_dir = ""
[[movies]]
    enabled = 1
    apikey = (REMOVED)
    host = localhost
    port = 8082
    ssl = 0
    web_root = ""
    Torrent_NoLink = 0
    method = renamer
    delete_failed = 0
    wait_for = 2
    extract = 1
    minSize = 100
    delete_ignored = 1
    remote_path = 0
    watch_dir = F:\Downloads\Newzbin\UnRar\movies

I am cloning the directory via github, would this cause the file to be overwritten by anything?

I just installed ffprobe when I set this up to run from source, so I may not have that configured correctly either... I will try disabling ffprobe and see what happens.

Also, is there any way to manually run nzbtomedia to test these changes? I hate waiting for a download to complete to see if my script will work... if not, then I'll just be patient.

Thanks for the help.

clinton-hall commented 10 years ago

recreating [[movie]] is standard. don't worry about this.

I just pushed changes to nightly branch. these should stop errors when you don't have values specified...

I also now allow copy of streams if no codec is specified.

Try switching to nightly and see what happens.

what downloader are you using? NZBGet has an option to postprocess again.

imadunatic commented 10 years ago

I use sabnzbd.... I will switch to nightly and find a fairly small file to download and see what happens.

clinton-hall commented 10 years ago

if the postprocess failed, I thought SABnzbd did allow you to try again??? Been a while since I used SAB.

imadunatic commented 10 years ago

Could be... I'll research that. I'm a serious greenhorn on this setup....

imadunatic commented 10 years ago

Apparently no way to rerun the script.... SAB covers all it's tracks after download. No biggie, I just won't get the immediate satisfaction everybody wants...

clinton-hall commented 10 years ago

You can try running manually. just call nzbToCouchPotato.py

open command prompt

"F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToCouchPotato.py"

if that doesn't work, you can try

python "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToCouchPotato.py"
imadunatic commented 10 years ago

It seems to run; however, it's not transcoding and it appears to just be creating a sub-folder and moving the original file to it inside of my movies folder... The log file located in the nzbtomedia logs folder doesn't seem to have all the info:

2014-07-10 08:48:14 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. 2014-07-10 08:48:14 DEBUG ::MAIN: No git specified, can't use git commands 2014-07-10 08:48:14 INFO ::MAIN: Version checking is disabled, not checking for the newest version 2014-07-10 08:48:14 INFO ::MAIN: nzbToMedia Version:10.0 Branch:master (Windows 7) 2014-07-10 08:48:14 INFO ::MAIN: ######################################################### 2014-07-10 08:48:14 INFO ::MAIN: ## ..::[nzbToMedia.py]::.. ## 2014-07-10 08:48:14 INFO ::MAIN: ######################################################### 2014-07-10 08:48:14 DEBUG ::MAIN: Options passed into nzbToMedia: ['F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToCouchPotato.py'] 2014-07-10 08:48:14 WARNING ::MAIN: Invalid number of arguments received from client, Switching to manual run mode ... 2014-07-10 08:48:14 DEBUG ::MAIN: No directories identified in CouchPotato:movie for post-processing 2014-07-10 08:48:14 INFO ::MAIN: Searching F:\Downloads\Newzbin\UnRar\movies for mediafiles to post-process ... 2014-07-10 08:48:15 DEBUG ::MAIN: No directories identified in CouchPotato:movies for post-processing 2014-07-10 08:48:15 INFO ::MAIN: The F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToCouchPotato.py script completed successfully.

imadunatic commented 10 years ago

Just for grins, I'm downloading a file and letting the script run to see what I get. The script log file in SAB tends to have more info than the logfile in the nzbtomedia directory (maybe I'm looking at the wrong logfile?).... I'll post that if it's worth anything.

clinton-hall commented 10 years ago

The script didn't move any files. The files were not found when this script ran. Did CouchPotato already rename the files? Check CouchPotato, settings, renamer. run_every and force_every both need to be 0. Then restart CouchPotato.

Also, make sure you do re-enable ffprobe.... I forgot to address this previously.

imadunatic commented 10 years ago

I have the renamer turned off in couchpotato (I've been using nzbtomedia for a month or so) and the files are still in the download complete directory. I can't seem to figure out why it is creating a sub directory and moving the file to it... maybe couchpotato is doing something... I'll check those logs.

Is there anyway to check if ffprobe is installed correctly?

imadunatic commented 10 years ago

The nightly build is getting further, but now I'm getting a different error:

Stage Script KeyError: 'tags'

Output from user script "nzbToMedia.py" (Exit code = 1): [09:42:30] [INFO]::MAIN: Loading config from [F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\autoProcessMedia.cfg] [09:42:30] [INFO]::ENVIRONMENT: TMP: C:\Users\Kevin\AppData\Local\Temp [09:42:30] [INFO]::ENVIRONMENT: COMPUTERNAME: SERVER [09:42:30] [INFO]::ENVIRONMENT: USERDOMAIN: SERVER [09:42:30] [INFO]::ENVIRONMENT: PSMODULEPATH: C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ [09:42:30] [INFO]::ENVIRONMENT: COMMONPROGRAMFILES: C:\Program Files\Common Files [09:42:30] [INFO]::ENVIRONMENT: PROCESSOR_IDENTIFIER: x86 Family 15 Model 4 Stepping 9, GenuineIntel [09:42:30] [INFO]::ENVIRONMENT: PROGRAMFILES: C:\Program Files [09:42:30] [INFO]::ENVIRONMENT: PROCESSOR_REVISION: 0409 [09:42:30] [INFO]::ENVIRONMENT: SYSTEMROOT: C:\Windows [09:42:30] [INFO]::ENVIRONMENT: PATH: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Calibre2\;F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\Python;F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\ffmpeg\bin [09:42:30] [INFO]::ENVIRONMENT: WINDOWS_TRACING_FLAGS: 3 [09:42:30] [INFO]::ENVIRONMENT: TEMP: C:\Users\Kevin\AppData\Local\Temp [09:42:30] [INFO]::ENVIRONMENT: PROCESSOR_ARCHITECTURE: x86 [09:42:30] [INFO]::ENVIRONMENT: ALLUSERSPROFILE: C:\ProgramData [09:42:30] [INFO]::ENVIRONMENT: SESSIONNAME: Console [09:42:30] [INFO]::ENVIRONMENT: HOMEPATH: \Users\Kevin [09:42:30] [INFO]::ENVIRONMENT: USERNAME: Kevin [09:42:30] [INFO]::ENVIRONMENT: LOGONSERVER: \SERVER [09:42:30] [INFO]::ENVIRONMENT: PROMPT: $P$G [09:42:30] [INFO]::ENVIRONMENT: LOCALAPPDATA: C:\Users\Kevin\AppData\Local [09:42:30] [INFO]::ENVIRONMENT: PROGRAMDATA: C:\ProgramData [09:42:30] [INFO]::ENVIRONMENT: PUBLIC: C:\Users\Public [09:42:30] [INFO]::ENVIRONMENT: PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC [09:42:30] [INFO]::ENVIRONMENT: FP_NO_HOST_CHECK: NO [09:42:30] [INFO]::ENVIRONMENT: WINDIR: C:\Windows [09:42:30] [INFO]::ENVIRONMENT: WINDOWS_TRACING_LOGFILE: C:\BVTBin\Tests\installpackage\csilogfile.log [09:42:30] [INFO]::ENVIRONMENT: HOMEDRIVE: C: [09:42:30] [INFO]::ENVIRONMENT: SYSTEMDRIVE: C: [09:42:30] [INFO]::ENVIRONMENT: COMSPEC: C:\Windows\system32\cmd.exe [09:42:30] [INFO]::ENVIRONMENT: NUMBER_OF_PROCESSORS: 2 [09:42:30] [INFO]::ENVIRONMENT: APPDATA: C:\Users\Kevin\AppData\Roaming [09:42:30] [INFO]::ENVIRONMENT: PROCESSOR_LEVEL: 15 [09:42:30] [INFO]::ENVIRONMENT: OS: Windows_NT [09:42:30] [INFO]::ENVIRONMENT: UGII_3DCONNEXION_LIBRARY: %UGII_BASE_DIR%\ugalliance\vendor\startup\3DxNX.dll [09:42:30] [INFO]::ENVIRONMENT: USERPROFILE: C:\Users\Kevin [09:42:30] [INFO]::MAIN: Checking database structure... [09:42:30] [DEBUG]::MAIN: Checking Initial Schema database upgrade [09:42:30] [DB]::MAIN: nzbtomedia.db: SELECT 1 FROM sqlite_master WHERE name = ?; with args ('db_version',) [09:42:30] [DB]::MAIN: nzbtomedia.db: SELECT db_version FROM db_version [09:42:30] [DEBUG]::MAIN: InitialSchema upgrade not required [09:42:30] [DEBUG]::MAIN: Checking if we can use git commands: git version [09:42:30] [DEBUG]::MAIN: Executing git version with your shell in F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia [09:42:30] [DEBUG]::MAIN: git output: 'git' is not recognized as an internal or external command,

operable program or batch file. [09:42:30] [DEBUG]::MAIN: git version returned : 'git' is not recognized as an internal or external command,

operable program or batch file. [09:42:30] [DEBUG]::MAIN: Not using: git [09:42:30] [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. [09:42:30] [DEBUG]::MAIN: No git specified, can't use git commands [09:42:30] [INFO]::MAIN: Version checking is disabled, not checking for the newest version [09:42:30] [INFO]::MAIN: nzbToMedia Version:10.0 Branch:master (Windows 7) [09:42:30] [INFO]::MAIN: ######################################################### [09:42:30] [INFO]::MAIN: ## ..::[nzbToMedia.py]::.. ## [09:42:30] [INFO]::MAIN: ######################################################### [09:42:30] [DEBUG]::MAIN: Options passed into nzbToMedia: ['F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py', 'F:\Downloads\Newzbin\UnRar\tv', 'Building.Wild.S01E05.Log.Jam.720p.HDTV.x264-TERRA.nzb', 'Building.Wild.S01E05.Log.Jam.720p.HDTV.x264-TERRA', '', 'tv', 'alt.binaries.teevee', '0', 'h', 't', 't', 'p', 's', ':', '/', '/', 'd', 'o', 'g', 'n', 'z', 'b', '.', 'c', 'r', '/', 'f', 'a', 'i', 'l', '/', '9', '8', '6', 'f', '1', '8', '6', 'e', '0', '5', '1', 'f', 'd', 'e', '2', 'e', '1', '2', '9', 'b', '2', '7', '2', 'd', '9', '0', '7', '5', '6', 'd', 'c', 'a', '/', 'c', 'e', '0', '5', 'f', 'e', '0', 'b', '1', '7', '2', 'e', '5', '4', 'a', 'a', '5', '9', '8', '1', '3', 'a', '3', 'f', 'a', 'd', 'f', 'f', 'b', 'e', '9', 'b'] [09:42:30] [INFO]::MAIN: Script triggered from SABnzbd 0.7.17+ [09:42:30] [DEBUG]::MAIN: Adding NZB download info for directory F:\Downloads\Newzbin\UnRar\tv to database [09:42:30] [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', 735424, u'', u'', u'Building.Wild.S01E05.Log.Jam.720p.HDTV.x264-TERRA.nzb', u'F:\Downloads\Newzbin\UnRar\tv'] [09:42:30] [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', 735424, u'', u'', u'Building.Wild.S01E05.Log.Jam.720p.HDTV.x264-TERRA.nzb', u'F:\Downloads\Newzbin\UnRar\tv'] [09:42:30] [INFO]::MAIN: Auto-detected SECTION:SickBeard [09:42:30] [DEBUG]::MAIN: Checking for archives to extract in directory: F:\Downloads\Newzbin\UnRar\tv [09:42:30] [INFO]::MAIN: Calling SickBeard:tv to post-process:Building.Wild.S01E05.Log.Jam.720p.HDTV.x264-TERRA.nzb [09:42:30] [INFO]::MAIN: Attempting to auto-detect tv fork [09:42:34] [INFO]::MAIN: SickBeard:tv fork auto-detection successful ... [09:42:34] [INFO]::MAIN: SickBeard:tv fork set to default [09:42:34] [INFO]::TRANSCODER: Checking [Building.Wild.S01E04.License.to.Mill.720p.HDTV.x264-DHD.mkv] for corruption, please stand by ... [09:42:35] [INFO]::TRANSCODER: SUCCESS: [Building.Wild.S01E04.License.to.Mill.720p.HDTV.x264-DHD.mkv] has no corruption. [09:42:35] [INFO]::TRANSCODER: Checking [Building.Wild.S01E05.Log.Jam.720p.HDTV.x264-TERRA.mkv] for corruption, please stand by ... [09:42:35] [INFO]::TRANSCODER: SUCCESS: [Building.Wild.S01E05.Log.Jam.720p.HDTV.x264-TERRA.mkv] has no corruption. [09:42:35] [INFO]::MAIN: FLATTEN: Flattening directory: F:\Downloads\Newzbin\UnRar\tv [09:42:35] [DEBUG]::MAIN: Checking for empty folders in:F:\Downloads\Newzbin\UnRar\tv [09:42:35] [INFO]::MAIN: FLATTEN: Flattening directory: F:\Downloads\Newzbin\UnRar\tv [09:42:35] [DEBUG]::MAIN: Checking for empty folders in:F:\Downloads\Newzbin\UnRar\tv [09:42:35] [POSTPROCESS]::SICKBEARD: SUCCESS: The download succeeded, sending a post-process request [09:42:35] [INFO]::MAIN: Checking for files to be transcoded importing Mutex Traceback (most recent call last): File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 737, in exit(main(sys.argv)) File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 682, in main download_id='') File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 563, in process inputCategory) File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbtomedia\autoProcess\autoProcessTV.py", line 188, in processEpisode result, newDirName = transcoder.Transcode_directory(dirName) File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbtomedia\transcoder\transcoder.py", line 384, in Transcode_directory command = buildCommands(file, newDir) File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbtomedia\transcoder\transcoder.py", line 152, in buildCommands audio1 = [ item for item in audioStreams if item["tags"]["language"] == nzbtomedia.ALANGUAGE ] KeyError: 'tags'

Also, it didn't actually transcode the files even though it says success.

depraved22 commented 10 years ago

I'm actually on the nightly build and I'm seeing something similar with the error message. My current config looks like:

[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 = 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 = 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 = "libfdk_aac,libfaac,aac,ac3,mp3"
    outputAudioBitrate = 640k
    outputAudioTrack2Codec = libfdk_aac
    AudioCodec2Allow = ""
    outputAudioTrack2Bitrate = 128k
    outputAudioOtherCodec = libmp3lame
    AudioOtherCodecAllow = ""
    outputAudioOtherBitrate = 128k
    outputSubtitleCodec = ""

Error output with full debug looks like:

[11:26:19] [INFO]::MAIN: nzbToMedia Version:2be151fd3f847e442acaded2757bf8a48430f8f9 Branch:master (Linux 3.13.0-30-generic)
[11:26:19] [INFO]::MAIN: #########################################################
[11:26:19] [INFO]::MAIN: ## ..::[nzbToMedia.pyc]::.. ##
[11:26:19] [INFO]::MAIN: #########################################################
[11:26:19] [DEBUG]::MAIN: Options passed into nzbToMedia: ['./nzbToSickBeard.py']
[11:26:19] [WARNING]::MAIN: Invalid number of arguments received from client, Switching to manual run mode ...
[11:26:19] [INFO]::MAIN: Searching /data/stage/Done/TV for mediafiles to post-process ...
[11:26:19] [DEBUG]::MAIN: Checking for empty folders in:/data/stage/Done/TV
[11:26:19] [DEBUG]::MAIN: Checking for empty folders in:/data/stage/Done/TV/The Bachelorette
[11:26:19] [INFO]::MAIN: Starting manual run for SickBeard:tv - Folder:/data/stage/Done/TV/The Bachelorette
[11:26:19] [INFO]::MAIN: Checking database for download info for The Bachelorette ...
[11:26:19] [INFO]::MAIN: Unable to locate download info for The Bachelorette, continuing to try and process this release ...
[11:26:19] [INFO]::MAIN: Auto-detected SECTION:SickBeard
[11:26:19] [DEBUG]::MAIN: Checking for archives to extract in directory: /data/stage/Done/TV/The Bachelorette
[11:26:19] [INFO]::MAIN: Calling SickBeard:tv to post-process:The Bachelorette
[11:26:19] [INFO]::MAIN: SickBeard:tv fork set to default
[11:26:19] [INFO]::TRANSCODER: Checking [The.Bachelorette.S10E08.Episode.8.mkv] for corruption, please stand by ...
[11:26:20] [INFO]::TRANSCODER: SUCCESS: [The.Bachelorette.S10E08.Episode.8.mkv] has no corruption.
[11:26:20] [INFO]::MAIN: FLATTEN: Flattening directory: /data/stage/Done/TV/The Bachelorette
[11:26:20] [DEBUG]::MAIN: Checking for empty folders in:/data/stage/Done/TV/The Bachelorette
[11:26:20] [INFO]::MAIN: FLATTEN: Flattening directory: /data/stage/Done/TV/The Bachelorette
[11:26:20] [DEBUG]::MAIN: Checking for empty folders in:/data/stage/Done/TV/The Bachelorette
[11:26:20] [POSTPROCESS]::SICKBEARD: SUCCESS: The download succeeded, sending a post-process request
[11:26:20] [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 369, in Transcode_directory
    command = buildCommands(file, newDir)
  File "/opt/nzbToMedia/nzbtomedia/transcoder/transcoder.py", line 152, in buildCommands
    audio1 = [ item for item in audioStreams if item["tags"]["language"] == nzbtomedia.ALANGUAGE ]
KeyError: 'tags'
Exception AttributeError: "'NoneType' object has no attribute 'path'" in <bound method PosixProcess.__del__ of <nzbtomedia.nzbToMediaUtil.PosixProcess instance at 0x7fbbde07d878>> ignored
imadunatic commented 10 years ago

Off topic, but how do you paste your logs so that they don't word wrap and have the scroll bar at the bottom (like your logs depraved)?

depraved22 commented 10 years ago

Heh. You need to put 3 ` at the top and bottom around your code segment. That will mark it as code and leave the formatting alone :)

clinton-hall commented 10 years ago

Ok... Sorry for the delay. Been sleeping.

I can confirm that ffprobe is recognised and working. The issue now is that the tests I did all had details to show what the audio codecs where and these were listed under "tags" but not for you. This is either a different output from ffmpeg, or a different naming convention within the video file?

This is towards the end of the transcode command builder. So no transcoding has taken place. The first transcode success message is referring to the ffprobe check to make sure this isn't corrupt. I just need to run some tests here.... In a minute I will post a command for you to run ffprobe on the video files in question so that I can see the different output.

clinton-hall commented 10 years ago

Can you please run the following command in command prompt and then post the output here?

    "C:\path\to\ffprobe.exe" -v quiet -print_format json -show_format -show_streams -show_error "C:\path\to\video.mkv"

Obviously you need to change the paths in the command above...

depraved22 commented 10 years ago

I'm running a compiled version of ffmeg/ffprobe on Ubuntu 14.04. ffprobe version info

fprobe -v
ffprobe version N-64596-gbbeaae9 Copyright (c) 2007-2014 the FFmpeg developers
  built on Jul 10 2014 11:18:49 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 45.100 / 55. 45.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
ffprobe -v quiet -print_format json -show_format -show_streams -show_error The.Bachelorette.S10E08.Episode.8.mkv
{
    "streams": [
        {
            "index": 0,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "High",
            "codec_type": "video",
            "codec_time_base": "1001/120000",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",
            "width": 1280,
            "height": 720,
            "has_b_frames": 2,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "16:9",
            "pix_fmt": "yuv420p",
            "level": 41,
            "r_frame_rate": "19001/317",
            "avg_frame_rate": "19001/317",
            "time_base": "1/1000",
            "start_pts": 0,
            "start_time": "0.000000",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0
            },
            "tags": {
                "language": "eng"
            }
        },
        {
            "index": 1,
            "codec_name": "ac3",
            "codec_long_name": "ATSC A/52A (AC-3)",
            "codec_type": "audio",
            "codec_time_base": "1/48000",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",
            "sample_fmt": "fltp",
            "sample_rate": "48000",
            "channels": 2,
            "channel_layout": "stereo",
            "bits_per_sample": 0,
            "dmix_mode": "-1",
            "ltrt_cmixlev": "-1.000000",
            "ltrt_surmixlev": "-1.000000",
            "loro_cmixlev": "-1.000000",
            "loro_surmixlev": "-1.000000",
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/1000",
            "start_pts": 0,
            "start_time": "0.000000",
            "bit_rate": "384000",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0
            }
        }
    ],
    "format": {
        "filename": "The.Bachelorette.S10E08.Episode.8.mkv",
        "nb_streams": 2,
        "nb_programs": 0,
        "format_name": "matroska,webm",
        "format_long_name": "Matroska / WebM",
        "start_time": "0.000000",
        "duration": "5150.412000",
        "size": "2218164639",
        "bit_rate": "3445417",
        "probe_score": 100,
        "tags": {
            "encoder": "libebml v0.7.9 + libmatroska v0.8.1",
            "creation_time": "2014-07-07 23:38:09"
        }
    }
}
imadunatic commented 10 years ago

Well, I would love to post that had I not reverted my script back to the compiled 9.2 and let it download and run (and subsequently process the file that was in that directory).... It looks like Depraved and I have nearly the exact same issue on the same type of file though...

clinton-hall commented 10 years ago

Yeah... So your audio tracks don't have any tags to show language.... I guess for a single track file, where the language is in the video stream there is no point in having the language track shown...

I'll push a fix shortly.

clinton-hall commented 10 years ago

Please update nightly and test again.... This should work now.

imadunatic commented 10 years ago

Different error:

[17:46:43] [INFO]::MAIN: nzbToMedia Version:10.0 Branch:master (Windows 7)
importing Mutex
Traceback (most recent call last):
  File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 737, in <module>
    exit(main(sys.argv))
  File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 589, in main
    nzbtomedia.initialize(section)
  File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbtomedia\__init__.py", line 349, in initialize
    NICENESS = int(CFG["Transcoder"]["niceness"])
ValueError: invalid literal for int() with base 10: ''

I don't have anything in my niceness settings:

###### duplicate =1 will cretae a new file. =0 will replace the original
duplicate = 1
# Only works on Linux. Highest priority is -20, lowest priority is 19.
niceness =
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
imadunatic commented 10 years ago

Ooops... clicked the wrong button...

clinton-hall commented 10 years ago

Ok.. I'll fix this soon. For now just set niceness=0

depraved22 commented 10 years ago

Works fine with niceness=0 out and previous config file.

clinton-hall commented 10 years ago

now should work with outputqualitypercent and niceness left blank.

imadunatic commented 10 years ago

I'll try the latest commit, I just noticed your post...

imadunatic commented 10 years ago

Oh how I'm starting to hate Windows....

importing Mutex
Traceback (most recent call last):
  File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 737, in <module>
    exit(main(sys.argv))
  File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 589, in main
    nzbtomedia.initialize(section)
  File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbtomedia\__init__.py", line 377, in initialize
    ACODEC_ALLOW = CFG["Transcoder"]["AudioCodecAllow"].strip()
AttributeError: 'list' object has no attribute 'strip'
imadunatic commented 10 years ago

Could this be a problem with my settings?

outputVideoExtension = .mp4
outputVideoCodec = copy
VideoCodecAllow = ""
outputVideoPreset = ""
outputVideoFramerate = ""
outputVideoBitrate = ""
outputAudioCodec = ac3
AudioCodecAllow = ac3, mp3, aac
outputAudioBitrate = 640k
outputAudioTrack2Codec = ""
AudioCodec2Allow = ""
outputAudioTrack2Bitrate = ""
outputAudioOtherCodec = ""
AudioOtherCodecAllow = ""
outputAudioOtherBitrate = ""
outputSubtitleCodec = ""
imadunatic commented 10 years ago

It appears I just needed quotes around my audio codec allow list.... preliminary tests are promising...

clinton-hall commented 10 years ago

ah... quotes, or no spaces? ac3,mp3,aac

imadunatic commented 10 years ago

Quotes fixed it... I suspect you're right about the spaces too. Thanks for all the help! Glad to be successfully running from source on Windows finally!

clinton-hall commented 10 years ago

Yeah... sorry for the amount of extra work required to setup... but now that it is done you should be able to keep up-to-date without doing anything ;)

BTW... to enable auto-updates just set

[General]
    version_notify = 1
    auto_update = 1
    git_path = "C:\Program Files (x86)\Git\bin\git.exe"

in theory this should work...

clinton-hall commented 10 years ago

@depraved22

Can you confirm if this is also working for you?

As soon as I have these last few tweaks with transcoder confirmed I am going to merge this right on up to master.

depraved22 commented 10 years ago

@clinton-hall - All working here. I had a couple items come through via SickBeard and that worked just fine as well.

clinton-hall commented 10 years ago

Thanks for the confirmation. Please let me know if anything else turns up... While I had hoped to not introduce "bugs" when merging to master, given the number of changes I'm actually quite happy with it.

imadunatic commented 10 years ago

Maybe I spoke too soon (I really think this is more a problem with my transcoder settings vs code issues):

[08:05:32] [DEBUG]::MAIN: Not using: git
[08:05:32] [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.
[08:05:32] [DEBUG]::MAIN: No git specified, can't use git commands
[08:05:32] [INFO]::MAIN: Version checking is disabled, not checking for the newest version
[08:05:32] [INFO]::MAIN: nzbToMedia Version:10.0 Branch:master (Windows 7)
[08:05:32] [INFO]::MAIN: #########################################################
[08:05:32] [INFO]::MAIN: ## ..::[nzbToMedia.py]::.. ##
[08:05:32] [INFO]::MAIN: #########################################################
[08:05:32] [DEBUG]::MAIN: Options passed into nzbToMedia: ['F:\\Windows Stuff DO NOT DELETE WITHOUT CAUTION\\Program Files\\SABnzbd\\scripts\\nzbToMedia\\nzbToMedia.py', 'F:\\Downloads\\Newzbin\\UnRar\\tv', 'Silicon.Valley.S01E07.PROPER.720p.HDTV.x264-BATV (2).nzb', 'Silicon.Valley.S01E07.PROPER.720p.HDTV.x264-BATV (2)', '', 'tv', 'alt.binaries.boneless', '0']
[08:05:32] [INFO]::MAIN: Script triggered from SABnzbd
[08:05:32] [DEBUG]::MAIN: Adding NZB download info for directory F:\Downloads\Newzbin\UnRar\tv to database
[08:05:32] [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', 735425, u'', u'', u'Silicon.Valley.S01E07.PROPER.720p.HDTV.x264-BATV (2).nzb', u'F:\\Downloads\\Newzbin\\UnRar\\tv']
[08:05:32] [INFO]::MAIN: Auto-detected SECTION:SickBeard
[08:05:32] [DEBUG]::MAIN: Checking for archives to extract in directory: F:\Downloads\Newzbin\UnRar\tv
[08:05:32] [INFO]::MAIN: Calling SickBeard:tv to post-process:Silicon.Valley.S01E07.PROPER.720p.HDTV.x264-BATV (2).nzb
[08:05:32] [INFO]::MAIN: Attempting to auto-detect tv fork
[08:05:36] [INFO]::MAIN: SickBeard:tv fork auto-detection successful ...
[08:05:36] [INFO]::MAIN: SickBeard:tv fork set to default
[08:05:36] [INFO]::MAIN: FLATTEN: Flattening directory: F:\Downloads\Newzbin\UnRar\tv
[08:05:36] [DEBUG]::MAIN: Checking for empty folders in:F:\Downloads\Newzbin\UnRar\tv
[08:05:36] [INFO]::MAIN: FLATTEN: Flattening directory: F:\Downloads\Newzbin\UnRar\tv
[08:05:36] [DEBUG]::MAIN: Checking for empty folders in:F:\Downloads\Newzbin\UnRar\tv
[08:05:36] [POSTPROCESS]::SICKBEARD: SUCCESS: The download succeeded, sending a post-process request
[08:05:36] [INFO]::MAIN: Checking for files to be transcoded
importing Mutex
Traceback (most recent call last):
  File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 737, in <module>
    exit(main(sys.argv))
  File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 667, in main
    download_id='')
  File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbToMedia.py", line 563, in process
    inputCategory)
  File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbtomedia\autoProcess\autoProcessTV.py", line 188, in processEpisode
    result, newDirName = transcoder.Transcode_directory(dirName)
  File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbtomedia\transcoder\transcoder.py", line 390, in Transcode_directory
    command = buildCommands(file, newDir)
  File "F:\Windows Stuff DO NOT DELETE WITHOUT CAUTION\Program Files\SABnzbd\scripts\nzbToMedia\nzbtomedia\transcoder\transcoder.py", line 101, in buildCommands
    if nzbtomedia.OUTPUTSUBTITLECODEC and nzbtomedia.ALLOWSUBS:
AttributeError: 'module' object has no attribute 'OUTPUTSUBTITLECODEC'

I was getting an error with the ffprobe section, so I disabled ffprobe to try and do some debugging before posting here. Any ideas?

I can go back to V9.2 as it seems to be working as expected (I ran it this morning to clean up my directories); however, I'm not sure if you would rather I keep posting my findings here?

Thanks again.

imadunatic commented 10 years ago

Also, where is the log file for nzbtomedia? I found one log here: \SABnzbd\scripts\nzbToMedia\logs

However, there isn't any traceback information (I have been copying the traceback info from SAB) in that log file. Is there another location I should be looking?

For instance, the log file in that location shows this for the last attempt:

2014-07-11 08:05:32 DEBUG   ::MAIN: Not using: git
2014-07-11 08:05:32 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.
2014-07-11 08:05:32 DEBUG   ::MAIN: No git specified, can't use git commands
2014-07-11 08:05:32 INFO    ::MAIN: Version checking is disabled, not checking for the newest version
2014-07-11 08:05:32 INFO    ::MAIN: nzbToMedia Version:10.0 Branch:master (Windows 7)
2014-07-11 08:05:32 INFO    ::MAIN: #########################################################
2014-07-11 08:05:32 INFO    ::MAIN: ## ..::[nzbToMedia.py]::.. ##
2014-07-11 08:05:32 INFO    ::MAIN: #########################################################
2014-07-11 08:05:32 DEBUG   ::MAIN: Options passed into nzbToMedia: ['F:\\Windows Stuff DO NOT DELETE WITHOUT CAUTION\\Program Files\\SABnzbd\\scripts\\nzbToMedia\\nzbToMedia.py', 'F:\\Downloads\\Newzbin\\UnRar\\tv', 'Silicon.Valley.S01E07.PROPER.720p.HDTV.x264-BATV (2).nzb', 'Silicon.Valley.S01E07.PROPER.720p.HDTV.x264-BATV (2)', '', 'tv', 'alt.binaries.boneless', '0']
2014-07-11 08:05:32 INFO    ::MAIN: Script triggered from SABnzbd
2014-07-11 08:05:32 DEBUG   ::MAIN: Adding NZB download info for directory F:\Downloads\Newzbin\UnRar\tv to database
2014-07-11 08:05:32 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', 735425, u'', u'', u'Silicon.Valley.S01E07.PROPER.720p.HDTV.x264-BATV (2).nzb', u'F:\\Downloads\\Newzbin\\UnRar\\tv']
2014-07-11 08:05:32 INFO    ::MAIN: Auto-detected SECTION:SickBeard
2014-07-11 08:05:32 DEBUG   ::MAIN: Checking for archives to extract in directory: F:\Downloads\Newzbin\UnRar\tv
2014-07-11 08:05:32 INFO    ::MAIN: Calling SickBeard:tv to post-process:Silicon.Valley.S01E07.PROPER.720p.HDTV.x264-BATV (2).nzb
2014-07-11 08:05:32 INFO    ::MAIN: Attempting to auto-detect tv fork
2014-07-11 08:05:36 INFO    ::MAIN: SickBeard:tv fork auto-detection successful ...
2014-07-11 08:05:36 INFO    ::MAIN: SickBeard:tv fork set to default
2014-07-11 08:05:36 INFO    ::MAIN: FLATTEN: Flattening directory: F:\Downloads\Newzbin\UnRar\tv
2014-07-11 08:05:36 DEBUG   ::MAIN: Checking for empty folders in:F:\Downloads\Newzbin\UnRar\tv
2014-07-11 08:05:36 INFO    ::MAIN: FLATTEN: Flattening directory: F:\Downloads\Newzbin\UnRar\tv
2014-07-11 08:05:36 DEBUG   ::MAIN: Checking for empty folders in:F:\Downloads\Newzbin\UnRar\tv
2014-07-11 08:05:36 POSTPROCESS::SICKBEARD: SUCCESS: The download succeeded, sending a post-process request
2014-07-11 08:05:36 INFO    ::MAIN: Checking for files to be transcoded
clinton-hall commented 10 years ago

So sorry about this. That last error should now be fixed. It never showed up when using ffprobe....

If you are able to test on current nightly that is great as it helps resolve these issues. If you get tired of it, you can roll back... But there shouldn't be much more going wrong... Just these minor config loading issues and names which look to be resolved now.

You found the right logs, however if there is an error, the logs crash to so trace back is only in SABnzbd.

imadunatic commented 10 years ago

It's no problem, I just start to feel like a pest after awhile. I'm learning as we go and I like tinkering so I will keep at it...

I've found that the only way to get a true test is to download another file and let SAB postproc, otherwise I sometimes get false results... (by trying to manually run from the directory). So it will be a few minutes before I know...

Thanks for all the work

clinton-hall commented 10 years ago

Not a pest at all... Glad to have people testing all the features in combinations I haven't tested :)

clinton-hall commented 10 years ago

Night here. Time for some needed sleep. Let me know how it goes and if any more tweaks are needed, I'll try and get to them first thing in the morning.

imadunatic commented 10 years ago

Will do. Thanks again.

imadunatic commented 10 years ago

Looks like it just successfully processed the previously failed file as well as the new file I just downloaded... exactly what V9.2 used to do... I'll leave SAB attached to that script and see how it does. As of right now I would say all is well.....

imadunatic commented 10 years ago

I re-enabled ffprobe for grins and no errors there either..... As far as I can tell, it is successfully post processing and transcoding.

clinton-hall commented 10 years ago

Great news. Thanks for the confirmation.