mdhiggins / sickbeard_mp4_automator

Automatically convert video files to a standardized format with metadata tagging to create a beautiful and uniform media library
MIT License
1.53k stars 200 forks source link

MkvtoMp4 failures #48

Closed nctiggy closed 11 years ago

nctiggy commented 11 years ago

I have been seeing this about 25% of the time now. Unusual to have this sort of failure rate on remuxes.

{ "subtitle": { "0": { "default": 1, "map": 2, "codec": "mov_text", "language": "eng", "forced": 0 } }, "audio": { "0": { "channels": 7, "map": 1, "codec": "aac", "bitrate": 1792, "language": "eng" } }, "video": { "map": 0, "codec": "copy", "bitrate": 7527035.0 }, "format": "mp4" } Traceback (most recent call last): File "./manual.py", line 261, in main() File "./manual.py", line 248, in main processFile(path, inputs) File "./manual.py", line 213, in processFile fileInfo = convertFile(filepath) File "./manual.py", line 67, in convertFile convert = MkvtoMp4(path, FFMPEG_PATH=settings.ffmpeg, FFPROBE_PATH=settings.ffprobe, delete=settings.delete, output_extension=settings.output_extension, relocate_moov=settings.relocate_moov, iOS=settings.iOS, awl=settings.awl, swl=settings.swl, adl=settings.adl, sdl=settings.sdl, processMP4=settings.processMP4) File "/home/craig/sicktest/mkvtomp4.py", line 155, in init for timecode in conv: File "/home/craig/sicktest/converter/init.py", line 246, in convert timeout=timeout): File "/home/craig/sicktest/converter/ffmpeg.py", line 452, in convert raise FFMpegConvertError('Encoding error: ' + line) converter.ffmpeg.FFMpegConvertError: Encoding error: Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

mdhiggins commented 11 years ago

Can you give me some more info on the source file? Most importantly the audio channel. I suspect the calculation to set the bitrate (which is done by channels*256) is too high and creating this error, possibly because its 7 channel audio.

mdhiggins commented 11 years ago

I preemptively pushed an update to hard cap the max audio bitrate to 1536 for any audio stream. Grab that update, I suspect it will fix the problem.

nctiggy commented 11 years ago

Testing right now. On the flip side I have tested the dev branch manual.py with the non-commandline pieces. IMDB movie, Guessit movie, TVDB TV show, TV Guess it. I will run a tmdb test this evening and that should be the end of that. let me know what your thoughts are.

nctiggy commented 11 years ago

Still failing even with hard cap. Is there any data you would like me to gather on the files that are getting this error? { "subtitle": { "0": { "default": 1, "map": 2, "codec": "mov_text", "language": "eng", "forced": 0 } }, "audio": { "0": { "channels": 7, "map": 1, "codec": "aac", "bitrate": 1536, "language": "eng" } }, "video": { "map": 0, "codec": "copy", "bitrate": 7527035.0 }, "format": "mp4" } Traceback (most recent call last): File "./manual.py", line 261, in main() File "./manual.py", line 248, in main processFile(path, inputs) File "./manual.py", line 213, in processFile fileInfo = convertFile(filepath) File "./manual.py", line 67, in convertFile convert = MkvtoMp4(path, FFMPEG_PATH=settings.ffmpeg, FFPROBE_PATH=settings.ffprobe, delete=settings.delete, output_extension=settings.output_extension, relocate_moov=settings.relocate_moov, iOS=settings.iOS, awl=settings.awl, swl=settings.swl, adl=settings.adl, sdl=settings.sdl, processMP4=settings.processMP4) File "/home/craig/sicktest/mkvtomp4.py", line 155, in init for timecode in conv: File "/home/craig/sicktest/converter/init.py", line 246, in convert timeout=timeout): File "/home/craig/sicktest/converter/ffmpeg.py", line 452, in convert raise FFMpegConvertError('Encoding error: ' + line) converter.ffmpeg.FFMpegConvertError: Encoding error: Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

mdhiggins commented 11 years ago

Can you give me more information regarding the input source?

elit3ge commented 11 years ago

Hi, when importing with sickbeard I am now receiving an error 6.

Executing command ['python', 'D:\mkvtomp4\trunk\postConversion.py', u'D:\data\sickbeard_tv_data\Scandal (2012)\Season 3\Scandal.2012.S03E02.Guess.Whos.Coming.to.Dinner.SD.TV.mp4', u'D:\temptv\Scandal.US.S03E02.HDTV.x264-LOL\scandal.us.302.hdtv-lol.mp4', '248841', '3', '2', '2013-10-10']

Absolute path to script: D:\SickBeard\python

Unable to run extra_script: 6

mdhiggins commented 11 years ago

Sometimes Sickbeard just throws that error for no reason. Try restarting your computer to resolve.

Also please post your autoprocess.ini if that doesn't fix it, as I suspect you may have the path to extra_script entered incorrectly.

elit3ge commented 11 years ago

[SickBeard] host=localhost port=8081 username= password= web_root= ssl=0 api_key=

[MP4] ffmpeg=C:\ffmpeg\bin\ffmpeg.exe ffprobe=C:\ffmpeg\bin\ffprobe.exe output_directory= copy_to= move_to= output_extension=mp4 delete_original=True relocate_moov=True audio-codec=ac3 ios-audio=True audio-language= audio-default-language= subtitle-language= subtitle-default-language= fullpathguess=True convert-mp4=False tagfile=False

[CouchPotato] host = localhost port = 5050 username = password = web_root = ssl = 0 apikey = delay = 65 method = renamer delete_failed = 0

I have removed my api keys and usernames and passwords.

mdhiggins commented 11 years ago

My mistake, I didn't mean your autoProcess.ini (sorry long day). Just post your 'extra_script' line from your Sickbeard config please.

elit3ge commented 11 years ago

extra_scripts = "python D:\mkvtomp4\trunk\postConversion.py"

mdhiggins commented 11 years ago

Gotta read the readMe more carefully! Change it to

extra_scripts = "python D:\\mkvtomp4\\trunk\\postConversion.py"

and make sure typing 'python' from your command line actually loads python.exe. Otherwise you'll need to add your python directory to the environment variables.

elit3ge commented 11 years ago

It worked for a couple of days then the error, but after stopping sickbeard and then going to edit the config it had what the readme said but it had dropped the " " from the start and the end.

Working again. Cheers! :D

mdhiggins commented 11 years ago

Hm, strange haha. Glad its working again