Code Monkey home page Code Monkey logo

sickbeard_mp4_automator's Introduction

SMA Conversion/Tagging Automation Script

Automatically converts media files downloaded by various programs to a standardized format, and tags them with the appropriate metadata from TMDB if the container supports tagging.

The Matrix

Works on Windows, OSX, and Linux. Despite the name works with much more than just Sickbeard and handles more than MP4s

Integration

Media Managers Supported

Downloaders Supported

Dependencies

Default Settings

  • Container - MP4
  • Video - H264
  • Audio - AAC 2.0 with additional AC3 track when source has >2 channels (ex 5.1)
  • Subtitles - mov_text

Docker

Two official Docker containers are maintained for Radarr and Sonarr with SMA included. These are meant to work with completed download handling enabled. See the respective Docker Hub pages for details

General Configuration

  1. Download or compile FFmpeg
  2. Install requirements/dependencies
  3. Rename setup\autoProcess.ini.sample to autoProcess.ini and place inside your config directory (or attempt to run the script which will generate a new config file if absent)
  4. Set the configuration options to your desired output and include the path of your new FFmpeg / FFprobe binaries
  5. Run manual.py and test out a conversion
  6. Configure direct integration using the instructions below

Sonarr Setup

  1. Set your Sonarr settings in autoProcess.ini
  2. Browse to the Settings>Download Client tab and enable advanced settings [Show].
  3. Setup the postSonarr.py script via Settings > Connect > Connections > + (Add)
    • name - postSonarr
    • On Grab - No
    • On Download \ On Import - Yes
    • On Upgrade - Yes
    • On Rename - No
    • On Movie Delete - No
    • On Movie File Delete - No
    • On Health Issue - No
    • Path - Full path to your python executable
    • Arguments - Full path to postSonarr.py
    • For Sonarr V3 you'll need to make a .sh or .bat file to combine your path to python and script
  4. OPTIONAL If you desire to convert the file before it is handed back to Sonarr, disable 'Completed Download Handling' in Sonarr settings and configure your download client to use its included script (scroll down to your relevant download client in the readme). The script will trigger a specific path re-scan, allowing the conversion to be completed before Sonarr starts moving stuff around. You must use either a download script or enabled Completed Download Handling. If neither are used the file will never be passed back

Radarr Setup

  1. Set your Radarr settings in autoProcess.ini
  2. Browse to the Settings>Download Client tab and enable advanced settings [Show].
  3. Setup the postRadarr.py script via Settings > Connect > Connections > + (Add)
    • name - postRadarr
    • On Grab - No
    • On Download \ On Import - Yes
    • On Upgrade - Yes
    • On Rename - No
    • On Movie Delete - No
    • On Movie File Delete - No
    • On Health Issue - No
    • Path - Full path to your python executable
    • Arguments - Full path to postRadarr.py
    • For Radarr V3 you'll need to make a .sh or .bat file to combine your path to python and script
  4. OPTIONAL If you desire to convert the file before it is handed back to Radarr, disable 'Completed Download Handling' in Radarr settings and configure your download client to use its included script (scroll down to your relevant download client in the readme). The script will trigger a specific path re-scan, allowing the conversion to be completed before Radarr starts moving stuff around. You must use either a download script or enabled Completed Download Handling. If neither are used the file will never be passed back

Sickbeard Setup

  1. Open Sickbeard's config.ini in Sick Beard installation folder
    • Set "extra_scripts" value in the general section to the full path to "python postSickbeard.py" using double backslashes
      • Example: C:\\Python27\\python C:\\Scripts\\postSickbeard.py
      • Make sure this is done while Sick Beard is not running or it will be reverted
  2. Set your SickBeard settings in autoProcess.ini

SickRage Setup

  1. Open the configuration page in Sickrage and scroll down to the option labelled "Extra Scripts". Here enter the path to python followed by the full script path. Examples:
    • C:\\Python27\\python.exe C:\\sickbeard_mp4_automator\\postSickbeard.py
    • /usr/bin/python /home/user/sickbeard_mp4_automator/postSickbeard.py
  2. Set the Sickrage settings in autoProcess.ini

NZBGet Setup

  1. Copy the script NZBGetPostProcess.py to NZBGet's script folder.
    • Default location is /opt/nzbget/scripts/
  2. Start/Restart NZBGet
  3. Configure NZBGETPOSTPROCESS
    • Access NZBGet's WebUI
      • Default localhost:6789
    • Go to Settings
    • Select NZBGETPOSTPROCESS option at the bottom of the left hand navigation panel and configure the options
      • MP4_FOLDER - default ~/sickbeard_mp4_automator/ - Location of the script. Use full path with trailing backslash.
      • SHOULDCONVERT - True/False - Convert file before passing to destination
      • SONARR_CAT - default sonarr - category of downloads that will be passed to Sonarr
      • SICKBEARD_CAT - default sickbeard - category of downloads that will be passed to Sickbeard
      • SICKRAGE_CAT - default sickrage - category of downloads that will be passed to Sickrage
      • BYPASS_CAT - default bypass - category of downloads that may be converted but won't be passed on further
    • Save changes
    • Reload NZBGet
  4. When assigning categories in NZBGet and your chosen media manager, ensure they match the label settings specified here so that file will be passed back to the appropriate location.
    • In the relevant category set PostScript to NZBGetPostProcess.py to ensure SMA is called.

Not required if using Completed Download Handling with Sonarr/Radarr

SABNZBD Setup

  1. Set your SABNZBD settings in autoProcess.ini
  2. Point SABNZBD's script directory to the root directory where you have extract the script.
  3. Configure categories. Categories will determine where the download is sent when it is finished
    • Settings > Categories
    • Configure name to match the settings from the SABNZBD section of autoProcess.ini
      • Default sickbeard
      • Default sickrage
      • Default sonarr
      • Default bypass
    • Select the SABPostProcess.py script
    • Save EACH category
  4. Verify that whatever media manager you are using is assigning the label to match the label settings specified here so that file will be passed back to the appropriate location

Not required if using Completed Download Handling with Sonarr/Radarr

Deluge Daemon Setup

  1. Create username and password for deluge daemon
    • Navigate to your deluge configuration folder
      • %appdata%\Roaming\Deluge in Windows
      • /var/lib/deluge/.config/deluge/ in Linux
    • Open the auth file
    • Add a username and password in the format <username>:<password>:<level>. Replace and with your choice and level with your desired authentication level. Default level is 10. Save auth.
      • Ex: sampleuser:samplepass:10
  2. Start/Restart deluged
    • deluged not deluge
    • If you're running Deluge on Windows and not setting up the daemon as a service, you can trigger the daemon to run in the background by disabling Classic Mode in your Deluge preferences under the Interface section
  3. Access the WebUI
    • Default port is 8112
    • Default password is deluge
  4. Enabled the Execute plugin
    • Add event for Torrent Complete
    • Set path to the full path to delugePostProcess.py or a batch file wrapper that passes command line arguments for Windows users with difficulty executing python files directly
  5. Set your Deluge settings in autoProcess.ini
  6. Verify that whatever downloader you are using is assigning the label to match the label settings specified here so that file will be passed back to the appropriate location

Not required if using Completed Download Handling with Sonarr/Radarr

uTorrent Setup

  1. Launch uTorrent
  2. Set Run Program option
    • Go to Options > Preferences > Advanced > Run Program
    • Point to uTorrentPostProcess.py with command line parameters: %L %T %D %K %F %I %N in that exact order.
  3. Set your uTorrent settings in autoProcess.ini
  4. Verify that whatever media manager you are using is assigning the label to match the label settings specified here so that file will be passed back to the appropriate location

Not required if using Completed Download Handling with Sonarr/Radarr

qBittorrent Setup

  1. Launch qBittorrent
  2. Set Run Program option
    • Go to Tools > Options > Run external program on torrent completion
    • Point to qBittorrentPostProcess.py with command line parameters: "%L" "%T" "%R" "%F" "%N" "%I" in that exact order.
  3. Set your qBittorrent settings in autoProcess.ini
  4. Verify that whatever media manager you are using is assigning the label to match the label settings specified here so that file will be passed back to the appropriate location

Not required if using Completed Download Handling with Sonarr/Radarr

Plex Notification

Send a Plex notification as the final step when all processing is completed. This feature prevents a file from being flagged as "in use" by Plex before processing has completed.

  1. Disable automatic refreshing on your Plex server
    • Settings > Server > Library and disable Update my library automatically and Update my library periodically.
  2. Set your Plex settings in autoProcess.ini

If you have secure connections enabled with Plex you will need to add your local IP addresss that the refresh requests are coming from to allow them to trigger the refresh, otherwise you will get an HTTP error. You can alternatively not force encryption by changing Secure Connections from Required to Preferred but this is not recommended as its less secure.

Found under Plex Server Settings > Network > Advanced image

Override Configuration Path

If for some reason you need to override the path to autoProcess.ini (for virtual environments, containers, etc) you can use the environment variable SMA_CONFIG to the absolute path

Post Process Scripts

Manual Script Usage

To run the script manually, simply run the manual.py file and follow the prompts it presents. If you wish to run it via the command line (good for batch operations) follow this format:

Help output
manual.py -h
usage: manual.py [-h] [-i INPUT] [-a] [-tv TVDBID] [-s SEASON] [-e EPISODE]
                 [-imdb IMDBID] [-tmdb TMDBID] [-nm] [-nc] [-nd]

Manual conversion and tagging script for sickbeard_mp4_automator

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        The source that will be converted. May be a file or a
                        directory
  --config              Specify an alternate configuration file location
  -a, --auto            Enable auto mode, the script will not prompt you for
                        any further input, good for batch files. It will guess
                        the metadata using guessit
  -tmdb TMDBID, --tmdbid TMDBID
                        Specify the TMDB ID for media
  -tvdb TVDBID, --tvdbid TMBDID
                        Specify the TVDB ID for media
  -imdb IMDBID, --imdbid IMDBID
                        Specify the IMDB ID for media
  -s SEASON, --season SEASON
                        Specifiy the season number
  -e EPISODE, --episode EPISODE
                        Specify the episode number
  -nm, --nomove         Overrides and disables the custom moving of file
                        options that come from output_dir and move-to
  -m, --moveto          Override move-to value setting in autoProcess.ini
                        changing the final destination of the file
  -nc, --nocopy         Overrides and disables the custom copying of file
                        options that come from output_dir and move-to
  -nt, --notag          Overrides and disables tagging when using the
                        automated option
  -to, --tagonly        Only tag without conversion
  -nd, --nodelete       Overrides and disables deleting of original files
  -pr, --preserverelative
                        Preserves relative directories when processing
                        multiple files using the copy-to or move-to
                        functionality
  -pse, --processsameextensions   
                        Overrides process-same-extensions setting in 
                        autoProcess.ini enabling the reprocessing of files
  -fc, --forceconvert   Overrides force-convert setting in autoProcess.ini and 
                        also enables process-same-extenions if true forcing the conversion of files
  -oo, --optionsonly    Display generated conversion options only, do not perform conversion
  -cl, --codeclist      Print a list of supported codecs and their paired FFMPEG encoders
  -pa, --processedarchive
                        Specify a processed list/archive so already processed files are skipped

Examples

Movies (using IMDB ID):
manual.py -i mp4path -imdb imdbid
Example: manual.py -i "C:\The Matrix.mkv" -imdb tt0133093

Movies (using TMDB ID)
manual.py -i mp4path -tmdb tmdbid
Example: manual.py -i "C:\The Matrix.mkv" -tmdb 603

TV
manual.py -i mp4path -tvdb tmbdid -s season -e episode
Example: manual.py -i "C:\Futurama S03E10.mkv" -tvdb 73871โ€Ž -s 3 -e 10

Auto Single File (will gather movie ID or TV show ID / season / spisode from the file name if possible)
manual.py -i mp4path -a
Example: manual.py -i "C:\Futurama S03E10.mkv" -a

Directory (you will be prompted at each file for the type of file and ID)
manual.py -i directory_path
Example: manual.py -i C:\Movies

Automated Directory (The script will attempt to figure out appropriate tagging based on file name)
manual.py -i directory_path -a
Example: manual.py -i C:\Movies -a

Process a directory but manually specific TVDB ID (Good for shows that don't correctly match using the guess)
manual.py -i directory -a -tvdb tvdbid
Example: manual.py -i C:\TV\Futurama\ -a -tvdb 615

You may also simply run manual.py -i 'C:\The Matrix.mkv and the script will prompt you for the missing information or attempt to guess based on the file name. You may run the script with a --auto or -a switch, which will let the script guess the tagging information based on the file name, avoiding any need for user input. This is the most ideal option for large batch file operations. The script may also be pointed to a directory, where it will process all files in the directory. If you run the script without the -a switch, you will be prompted for each file with options on how to tag, to convert without tagging, or skip.

External Cover Art

To use your own cover art instead of what the script pulls from TMDB or TVDB, simply place an image file in the same directory as the input video with the same name before processing and it will be used. Must be jpg or png

Import External Subtitles

To import external subtitles, place the .srt file in the same directory as the file to be processed. The srt must have the same name as the input video file, as well as the language code for which the subtitle is. Subtitle importing obeys the langauge rules set in autoProcess.ini, so languages that aren't whitelisted will be ignored.

Naming example:

input mkv - The.Matrix.1999.mkv
subtitle srt - The.Matrix.1999.eng.srt

Credits

This project makes use of, integrates with, or was inspired by the following projects:

Enjoy

sickbeard_mp4_automator's People

Contributors

1stian avatar andrewkhunn avatar collisionc avatar danielgtaylor avatar dbr avatar djrarky avatar echelonfour avatar ehvanr avatar etabard avatar ethanopp avatar greenacorn-michael avatar jzucker2 avatar kurtisvargas avatar lolobored avatar mdhiggins avatar mflagler avatar midgetspy avatar mirabis avatar moussa avatar mstrelan avatar mtrolley avatar nzbjamz avatar outlyer avatar patrickkettner avatar petterooe avatar senko avatar stevemk14ebr avatar unr34l avatar viearical avatar zybeon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sickbeard_mp4_automator's Issues

No audio on Apple TV: surround track should be disabled if 2.0 track present

The MP4 files created by your tool have two audio tracks, the AAC stereo and the AC3 5.1 track, as expected. However, to work correctly with the AppleTV the AC3 track should be disabled, as two 'default' tracks are not allowed. (This is at least a problem for firmware 6.0, 5.1 has also been reported, see: http://forums.macrumors.com/showthread.php?t=1455090&page=3). This results in the audio of the resulting file not playing on the AppleTV unless a track is selected explicitly. Files in which the AC3 tracks have been disabled correctly play audio straight away.

Mp4box info output of an incorrect file:

Track # 2 Info - TrackID 2 - TimeScale 48000 - Duration 00:42:37.237
Media Info: Language "Undetermined" - Type "soun:mp4a" - 119871 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40
MPEG-4 Audio MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 48000
Synchronized on stream 1
Alternate Group ID 1

Track # 3 Info - TrackID 3 - TimeScale 48000 - Duration 00:42:37.216
Media Info: Language "Undetermined" - Type "soun:ac-3" - 79913 samples
AC3 stream - Sample Rate 48000 - 6 channel(s) - bitrate 0
Alternate Group ID 1

Mp4box info output of a correct file:

Track # 2 Info - TrackID 2 - TimeScale 48000 - Duration 00:43:11.573
Media Info: Language "Undetermined" - Type "soun:mp4a" - 121480 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40
MPEG-4 Audio MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 48000
Synchronized on stream 1
Alternate Group ID 1

Track # 3 Info - TrackID 3 - TimeScale 48000 - Duration 00:43:11.552
Track is disabled
Media Info: Language "Undetermined" - Type "soun:ac-3" - 80986 samples
AC3 stream - Sample Rate 48000 - 5.1 channel(s) - bitrate 384000
Alternate Group ID 1

Dev branch

So, this is without doing much research into the code changes but it appears that the conversion is shooting the output directly into the destination directory (presumably to avoid a move action). This creates a few issues for me, but may not be big enough deals for the majority of script users. My destination is the "Automatically move to iTunes" folder.
The concern is two fold, There have been conversion failures that have left empty mp4's in the folder and imported as movies into iTunes and secondly there is a risk that the file will be imported into iTunes between conversion and tagging. This has been evidenced by a couple films that have been imported with no cover or tagging (EDIT: Further validated with running dev branch with sabnzbd, TV shows have imported without being tagged).
Firstly it would be nice to convert in-place to the same location as the source and then move afterwards.
Second perhaps it would be valuable to offer a -log flag to direct the output to a log file, this would help with large batch jobs so we can see where and if there were issues along the way.

Short of all that longwindedness the manual script is running very well.
Thoughts?

SAB and Sick on separate computers

I am currently experiencing an issue after separating my sabnzbd and sick beard setup into two servers. Once the download completes it kicks off the post process and the file converts. At that point, when it attempts to communicate back to sickbeard SAB spits out "Download failed - Out of your server's retention?" which I normally only get when the download can not complete. Perhaps the call to a different server is causing some a weird return error code to sab? The file does get moved by sickbeard to it's location, but not to the "move_to" location in this script.
Normally I see [Completed folder]->[sickbeard folder]->[automator move_to folder]

Set track number attribute

Sick of me yet? Next issue is more of a workaround for iTunes being dumb. If you don't set the track number tag, and iTunes is responsible for organising your library, the file ends up something like C:\Path\To\iTunes\TV Shows\Arrested Development\Season 2\The One Where They Build a House.m4v, which is missing the episode number.

Personally I believe iTunes should use the "episode number" tag instead of "track number" for naming the files, but unfortunately Apple don't agree on that one.

Is it easy enough to set the track number while you're at it?

File Moving to wrong directory

Hi, Sorry if this is a stupid post...

I have a problem where the converted mp4 is being moved straight from the SABnzbd completed dir (which is where the mkv->mp4 conversion is done), straight into the sick beard tv show directory.

This would normally be ok but I'm trying to use the import to iTunes folder.

I've tried a few things, sorting in SAB is disabled and post processing is disabled in Sickbeard. At the moment I'm only calling the SABtoSickbeardwithConvert.py script from SAB, I have not enabled the extra_script in sick beard.

Let me know what info you need me to post, here's an extract from my autoprocess.ini.

[MP4]
ffmpeg=ffmpeg
ffprobe=ffprobe
output_directory=
copy_to=
move_to=/mnt/iTunes/
output_extension=mp4
delete_original=True
relocate_moov=False
audio-codec=ac3
ios-audio=True
audio-language=eng
audio-default-language=eng
subtitle-language=eng
subtitle-default-language=eng
fullpathguess=True
convert-mp4=False
tagfile=True

failed to run extra script

Hi

i converted a and places the file in post processing folder.
sickbeard failed to execute your script and i cannot see why.

here is the error

Mar-27 11:18:42 INFO POSTPROCESSER :: Unable to run extra_script: 6
Mar-27 11:18:42 INFO POSTPROCESSER :: Executing command ['c:\Scripts\postConversion.cmd', u'D:\90210\90210 - S1E03 - Lucky Strike - SD TV.m4v', u'D:\post\90210 - S01E03 - Lucky Strike - SD TV.m4v', '82716', '1', '3', '2008-09-09']

attached is a screenshot of my sickbeard ini file and the autoprocess file in your directory

autoprocess ini
sickbeard config ini

Unable to add external .srt files with manual.py

I am unable to add external .srt files with manual.py -silent. The srt files are in the same file as the original file and are named as recommended: for a video called 'video.mkv', the two subtitles are named 'video.eng.srt' and 'video.nld.srt'. However, the script does not recognize either file, which are therefore not muxed into the final version.

Writing Tags for larger videos

I'm getting the following error when I try to tag a larger file:

C:\Users\Owner\Downloads\Pacific.Rim.2013.720p.WEB-DL.H264-PublicHD\Pacific.rim.
2013.720p.web-dl.h264-publichd-1.m4v detected - already correct format, skipping
reprocessing
Tagging file :C:\Users\Owner\Downloads\Pacific.Rim.2013.720p.WEB-DL.H264-PublicH
D\Pacific.rim.2013.720p.web-dl.h264-publichd-1.m4v
Trying to write tags
Traceback (most recent call last):
File "C:\scripts\manual.py", line 127, in
main()
File "C:\scripts\manual.py", line 121, in main
tagmp4.writeTags(convert.output)
File "C:\scripts\tmdb_mp4.py", line 87, in writeTags
video.save()
File "C:\scripts\mutagen__init__.py", line 134, in save
return self.tags.save(filename, **kwargs)
File "C:\scripts\mutagen\mp4.py", line 299, in save
self.__save_existing(fileobj, atoms, path, data)
File "C:\scripts\mutagen\mp4.py", line 352, in __save_existing
insert_bytes(fileobj, delta, offset)
File "C:\scripts\mutagen_util.py", line 226, in insert_bytes
map = mmap.mmap(fobj.fileno(), filesize + size)
OverflowError: cannot fit 'long' into an index-sized integer

Automatically add subtitles during processing

I have a number of foreign language shows with .srt subtitles (same name as the video files) in the same folder.

Would it be possible to have ffmpeg automatically include the .srt if it finds one with the same filename in the processing folder (as soft subs) and then delete the .srt file when it's done?

Some of the original files will be .mp4 files, so not sure whether this processing can be triggered for them only if they don't already have a subtitle track (ie just adding the subtitle in rather than full processing), or if that will just mean they'll have to be ignored.

Thanks in advance

Ignore Files

Just wondering if there is a way to only convert mkv files when sickbeard runs, at the moment when a video is sent to sickbeard it converts it even if its an avi.

leave audio in 5.1

Hi

im looking to use your script, but i see that during the mkvtomp4 script it forces audio to stereo, is there a way i can keep it in what ever format it is, so if it is 5.1 it will convert it to aac 5.1 or if its in stereo it will convert it to 2.0 aac

thanks

Move MOOV atom to start of file

Wow, lots of commits lately, I'll have to check it out. I've read a fair bit about relocating the "MOOV" atom to the start of the file to allow for much faster streaming of large files. I haven't really found any good reference material on it, but I downloaded Atomboxstudio to inspect the atoms, and an Adobe Air application called QT Index Swapper to rearrange the atoms.

You can see the correct order of atoms in the right hand pane here:
new-girl-atoms

Is this easy/possible to do in sickbeard_mp4_automator? I imagine it involves tinkering with mp4.py. I found this issue but the patch doesn't really seem to do anything - http://code.google.com/p/mutagen/issues/detail?id=80&colspec=ID%20Type%20Status%20Priority%20Milestone%20Summary

Manual script respects tagfile setting when using -silent parameter

I would like to make a pull request to change the manual script so that it respects the tagfile setting. (in this particular case I want to convert my files and relocate moov atom but not tag them). Is there any reason this would not be a good idea? I only started using this script and I am certain I don't have a full grasp of everything.

Improve README and prompts for manual post-processing

I used manual.py for the first time today and was a little confused about which id to put in for the tvdb, I assumed the episode id. The script complained about a 404 not found and I had to start again. It would be an improvement to specify that you need to enter the series id, or perhaps even instead you could opt to enter the episode id and skip the series id, season number and episode number.

MkvtoMp4 failures

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

Convert .ts files

Can this support converting .ts files to mp4? Apparently this should be possible with ffmpeg. I hadn't heard of .ts until Sickbeard downloaded some 1080p Web-Rips last night. The streams are already h264/aac. If I had .ts to the valid input files and take the raw ffmpeg command I get this error below. Any ideas?

Input #0, mpegts, from 'D:\myfile.ts':
  Duration: 00:31:18.69, start: 0.000022, bitrate: 8621 kb/s
  Program 1
    Stream #0:0[0x64]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x65]: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 218 kb/s
[NULL @ 00000000044e00a0] Unable to find a suitable output format for 'c:a:0'
c:a:0: Invalid argument

Subtitle skipping

I dislike subtitles. I know they can be disabled by most video playing clients, however I'd really like to just get rid of them.

Please add the ability to skip subtitles. (do not copy from original file)

Convert files in local folder

I'm looking for a way to force the video conversion to be done in the original (local) path.

I'm running sickbeard and the postconverter on a pc with the files saved locally. After conversion and sickbeard processing they will be stored on a nas. As present, the original avi file (for instance) is copied to the nas first before mkv2mp4 is triggered. This leads to an increase in router/ethernet traffic back and forward and bottlenecks the conversion.

Would it be easy to edit the script (or create an option in the script) so that it can convert on the local disk (either in a temporary local folder, or in the original sickbeard processing folder), rather than only after the file has been transferred to the output path?

Script to do a basic conversion without any tagging

How about a script that does nothing more then do the basic mkv->mp4 conversion without anything else? I thought a wrapper around manual.py would work but it doesn't seem to take a command line option to do that.

Issue with converted media

Hey, I am having an issue with my converted media.

I use plex which stream to my ps3, all my mp4 (non-converted) files play fine but I receive an error on the ps3 when I try to play any of the converted files.

Error code from the sony is "The data type is not supported. (800288C9)", yet if I turn off directplay from plex, plex converts the file on the fly but only the audio not the video.

I have tried changing the audio to aac and ac3, still no luck.

The only difference in files I can see is when you open both files in mediainfo is;

Converted MKV
Format: MPEG-4
Format Profile: Quicktime
Codec ID: qt

Non-converted MP4
Format: MPEG-4
Format Profile: Base Media
Codec ID: isom

Hope you can shed some light on my little problem.

Auto-tagging not working

I'm having trouble getting automatic tagging to work with sabToSickBeardwithConverter.py. The m4v file is created, but it is not tagged and I don't think the mov atom is relocated either. I have to run manual.py over everything that is downloaded. Have I got something wrong?

autoProcess.ini

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

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

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

Output from SABnzbd+

Video codec detected: h264
Audio stream detected: ac3 eng [Stream 1]
Creating dual audio channels for iOS compatability for this stream
Subtitle stream detected: subrip nor [Stream 2]
E:\Downloads\complete\Homeland.S03E09.720p.WEB-DL.DD5.1.H.264-BS\Homeland.S03E09.One.Last.Time.720p.WEB-DL.DD5.1.H.264-BS.m4v created
E:\Downloads\complete\Homeland.S03E09.720p.WEB-DL.DD5.1.H.264-BS\Homeland.S03E09.One.Last.Time.720p.WEB-DL.DD5.1.H.264-BS.mkv deleted
Loading config from C:\SickBeard\autoProcessTV\sickbeard_mp4_automator\autoProcess.ini
Opening URL: http://localhost:8081/home/postprocess/processEpisode?nzbName=Homeland.S03E09.720p.WEB-DL.DD5.1.H.264-BS.nzb&quiet=1&dir=E%3A%5CDownloads%5Ccomplete%5CHomeland.S03E09.720p.WEB-DL.DD5.1.H.264-BS
Processing folder E:\Downloads\complete\Homeland.S03E09.720p.WEB-DL.DD5.1.H.264-BS

Processing E:\Downloads\complete\Homeland.S03E09.720p.WEB-DL.DD5.1.H.264-BS\Homeland.S03E09.One.Last.Time.720p.WEB-DL.DD5.1.H.264-BS.m4v (Homeland.S03E09.720p.WEB-DL.DD5.1.H.264-BS.nzb)

Found result in history: (247897, 3, [])

Parsed Homeland.S03E09.720p.WEB-DL.DD5.1.H.264-BS.nzb into Homeland - S3E9 - 720p.WEB-DL.DD5.1.H.264 (BS) [ABD: False]

Checking scene exceptions for a match on Homeland

Looking up Homeland in the DB

Lookup successful, using tvdb id 247897

Loading show object for tvdb_id 247897

Retrieving episode object for 3x9

The old status had a quality in it, using that: 720p WEB-DL

SB snatched this episode so I'm marking it as priority

Is ep a priority download: True

There is no existing file so there's no worries about replacing it

This download is marked a priority download so I'm going to replace an existing file if I find one

Found release name Homeland.S03E09.720p.WEB-DL.DD5.1.H.264-BS

Destination folder for this episode: E:\TV Shows\Homeland

Moving file from E:\Downloads\complete\Homeland.S03E09.720p.WEB-DL.DD5.1.H.264-BS\Homeland.S03E09.One.Last.Time.720p.WEB-DL.DD5.1.H.264-BS.m4v to E:\TV Shows\Homeland\Homeland - 3x09 - Horse and Wagon.m4v

Deleting folder E:\Downloads\complete\Homeland.S03E09.720p.WEB-DL.DD5.1.H.264-BS

Processing succeeded for E:\Downloads\complete\Homeland.S03E09.720p.WEB-DL.DD5.1.H.264-BS\Homeland.S03E09.One.Last.Time.720p.WEB-DL.DD5.1.H.264-BS.m4v

Higher quality audio

Is there a reason 448 is used as the bitrate of converted audio streams? From what I've read the maximum bitrate of AAC format is 640. Perhaps this could be configurable? MkvToMp4 has options for 192, 224, 320, 384, 448 and 640. I generally try and stick with as higher quality as possible.

imdb_mp4.py

I know this is going away soon but I get misc errors from time to time with the imdv_mp4.py module.

Fetching info for imdb id 2306745
Tagging file :/home/craig/Movies/Movies/Sound City (2013)/Sound City.mp4
Traceback (most recent call last):
File "/home/craig/sickbeard_mp4_automator/manualConvert.py", line 55, in
imdbmp4.writeTags(convert.output)
File "/home/craig/sickbeard_mp4_automator/imdb_mp4.py", line 69, in writeTags
video["----:com.apple.iTunes:iTunEXTC"] = self.rating()
File "/home/craig/sickbeard_mp4_automator/imdb_mp4.py", line 98, in rating
mpaa = self.movie['mpaa']
File "/home/craig/sickbeard_mp4_automator/imdb/utils.py", line 1433, in getitem
rawData = self.data[key]
KeyError: 'mpaa'

Better handling when season has no poster

Currently if a season has no poster on thetvdb.com the script will just throw an IOError. In this case I think it would be ideal to then find a poster for the series instead. If that doesn't exist we need to skip adding a poster.

An example of a show like this is 90210 Season 5 (my wife watches it).
http://thetvdb.com/?tab=season&seriesid=82716&seasonid=493163&lid=7

Probably the first "poster" for the series would be best.
http://thetvdb.com/?tab=series&id=82716&lid=7

Full output below of the error below.

C:>python "C:\Users\Michael\SickBeard\sickbeard_mp4_automator\postConversion.py
" "D:\TV Shows\90210\Season 5\90210 5x14 Brother From Another Mother.mkv" I:\Dow
nloads\Usenet\Complete\90210.S05E14.720p.HDTV.x264-EVOLVE\90210.S05E14.720p.HDTV
.x264-EVOLVE.mkv 82716 5 14 2013-02-18
Video codec detected: h264
Audiocodec detected: ac3
Channels detected: 6
[ ] 0%
[ ] 1%
[ ] 1%
[ ] 2%
[ ] 2%
[ ] 3%
[ ] 4%
[ ] 4%
[ ] 5%
[ ] 5%
[ ] 6%
[ ] 6%
[ ] 7%
[ ] 7%
[ ] 8%
[ ] 9%
[ ] 9%
[# ] 10%
[# ] 11%
[# ] 11%
[# ] 12%
[# ] 12%
[# ] 13%
[# ] 13%
[# ] 14%
[# ] 14%
[# ] 15%
[# ] 16%
[# ] 16%
[# ] 17%
[# ] 17%
[# ] 18%
[# ] 18%
[# ] 19%
[# ] 19%
[## ] 20%
[## ] 20%
[## ] 21%
[## ] 21%
[## ] 22%
[## ] 22%
[## ] 23%
[## ] 24%
[## ] 24%
[## ] 25%
[## ] 25%
[## ] 26%
[## ] 26%
[## ] 27%
[## ] 27%
[## ] 28%
[## ] 28%
[## ] 29%
[## ] 29%
[### ] 30%
[### ] 30%
[### ] 31%
[### ] 31%
[### ] 32%
[### ] 33%
[### ] 33%
[### ] 34%
[### ] 34%
[### ] 35%
[### ] 35%
[### ] 36%
[### ] 36%
[### ] 37%
[### ] 38%
[### ] 38%
[### ] 39%
[### ] 39%
[### ] 39%
[#### ] 40%
[#### ] 41%
[#### ] 41%
[#### ] 41%
[#### ] 42%
[#### ] 43%
[#### ] 43%
[#### ] 43%
[#### ] 44%
[#### ] 44%
[#### ] 45%
[#### ] 45%
[#### ] 46%
[#### ] 47%
[#### ] 47%
[#### ] 48%
[#### ] 48%
[#### ] 49%
[#### ] 49%
[##### ] 50%
[##### ] 50%
[##### ] 51%
[##### ] 51%
[##### ] 52%
[##### ] 52%
[##### ] 53%
[##### ] 53%
[##### ] 54%
[##### ] 54%
[##### ] 55%
[##### ] 55%
[##### ] 56%
[##### ] 57%
[##### ] 57%
[##### ] 57%
[##### ] 58%
[##### ] 58%
[##### ] 59%
[##### ] 59%
[###### ] 60%
[###### ] 61%
[###### ] 61%
[###### ] 61%
[###### ] 62%
[###### ] 62%
[###### ] 63%
[###### ] 63%
[###### ] 64%
[###### ] 64%
[###### ] 65%
[###### ] 65%
[###### ] 66%
[###### ] 66%
[###### ] 67%
[###### ] 67%
[###### ] 67%
[###### ] 68%
[###### ] 68%
[###### ] 69%
[###### ] 69%
[###### ] 69%
[####### ] 70%
[####### ] 70%
[####### ] 71%
[####### ] 71%
[####### ] 72%
[####### ] 72%
[####### ] 73%
[####### ] 73%
[####### ] 74%
[####### ] 74%
[####### ] 75%
[####### ] 75%
[####### ] 76%
[####### ] 76%
[####### ] 77%
[####### ] 77%
[####### ] 78%
[####### ] 78%
[####### ] 79%
[####### ] 79%
[######## ] 80%
[######## ] 81%
[######## ] 81%
[######## ] 82%
[######## ] 82%
[######## ] 83%
[######## ] 83%
[######## ] 84%
[######## ] 84%
[######## ] 85%
[######## ] 86%
[######## ] 86%
[######## ] 87%
[######## ] 87%
[######## ] 88%
[######## ] 88%
[######## ] 89%
[######## ] 89%
[######### ] 90%
[######### ] 91%
[######### ] 91%
[######### ] 92%
[######### ] 92%
[######### ] 92%
[######### ] 93%
[######### ] 94%
[######### ] 94%
[######### ] 95%
[######### ] 95%
[######### ] 96%
[######### ] 96%
[######### ] 97%
[######### ] 97%
[######### ] 98%
[######### ] 99%
[######### ] 99%
[##########] 100%
Conversion complete
90210 has queued to be refreshed
{}
success
Tagging file :D:\TV Shows\90210\Season 5\90210 5x14 Brother From Another Moth
er.m4v
Traceback (most recent call last):
File "C:\Users\Michael\SickBeard\sickbeard_mp4_automator\postConversion.py", l
ine 30, in
tagmp4.writeTags(path)
File "C:\Users\Michael\SickBeard\sickbeard_mp4_automator\tvdb_mp4.py", line 54
, in writeTags
path = self.getArtwork()
File "C:\Users\Michael\SickBeard\sickbeard_mp4_automator\tvdb_mp4.py", line 15
8, in getArtwork
return urllib.urlretrieve(posters.topPoster().bannerpath, tempfile.gettempdi
r() + "\poster.jpg")[0]
File "C:\Python27\lib\urllib.py", line 93, in urlretrieve
return _urlopener.retrieve(url, filename, reporthook, data)
File "C:\Python27\lib\urllib.py", line 239, in retrieve
fp = self.open(url, data)
File "C:\Python27\lib\urllib.py", line 207, in open
return getattr(self, name)(url)
File "C:\Python27\lib\urllib.py", line 462, in open_file
return self.open_local_file(url)
File "C:\Python27\lib\urllib.py", line 476, in open_local_file
raise IOError(e.errno, e.strerror, e.filename)
IOError: [Errno 2] The system cannot find the path specified: ''

Only 1 set of subtitles is copied, seems to be hard coded to English

Accidentally submitted this before writing a description, however I think the title sums it up. An important consideration would be handling "forced" subtitles, eg. when a show (like Breaking Bad) is primarily in English but has a few Spanish parts there are two English tracks - English (forced) and English. The former is just the Spanish bits and the latter is everything. Is this doable via ffmpeg?

file extensions not being renamed after convert

I pulled down the latest bits from the master branch yesterday and now after converting a mkv the converted files are not renamed with the .m4v extension like my autoProcess.ini states, they remain with the .mkv extension. On the converted files, if I manually remove the .mkv and replace it with a .m4v it successfully plays in quicktime and iTunes.

my autoprocess.ini looks like:
[SickBeard]
host = localhost
port = 8091
username =
password =
web_root =
ssl = 0
api_key = 83d02c177b6d409b12918ae786be6477

[MP4]
ffmpeg = /usr/local/bin/ffmpeg
ffprobe = /usr/local/bin/ffprobe
output_directory = /Volumes/Courage/addToiTunes
output_extension = m4v
delete_original = False
relocate_moov = True
audio-codec = dts
ios-audio = True
audio-language = eng
audio-default-language = eng
subtitle-language = eng
subtitle-default-language =
convert-mp4 = False

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

Manual processing of files with apostrophes in the file name crashes

This is clearly an unexpected consequence of the ability to manually process files. I was updating the metadata on some files I'd previously acquired when I noticed the issue. To demonstrate the issue I copied a short video so that one filename had an apostrophe and the other didn't. First video runs fine and the subsequent one fails. Thanks.

saadiq@el-gigante:~/tmp$ cp blah.avi "don't blah.avi"
saadiq@el-gigante:~/tmp$ python ~/dev/sickbeard_mp4_automator/manual.py blah.avi -tv 247808 2 14
Processing Suits Season 2 Episode 14 - He's Back
Video codec detected: mpeg4
Audio stream detected: adpcm_ms und [Stream 1]
Undefined language detected, defaulting to eng
{'subtitle': {}, 'audio': {0: {'channels': 1, 'map': 1, 'codec': 'aac', 'bitrate': 256, 'language': 'eng'}}, 'video': {'map': 0, 'codec': 'h264', 'bitrate': 3902610.0}, 'format': 'mp4'}
Conversion complete
blah.avi deleted
Relocating MOOV atom to start of file
Cleanup successful
Tagging file :blah.mp4
Trying to write tags
Tags written successfully
saadiq@el-gigante:~/tmp$ python ~/dev/sickbeard_mp4_automator/manual.py don\'t\ blah.avi -tv 247808 2 14
Processing Suits Season 2 Episode 14 - He's Back
Traceback (most recent call last):
  File "/Users/saadiq/dev/sickbeard_mp4_automator/manual.py", line 159, in <module>
    main()
  File "/Users/saadiq/dev/sickbeard_mp4_automator/manual.py", line 151, in main
    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, audio_codec=settings.acodec)
  File "/Users/saadiq/dev/sickbeard_mp4_automator/mkvtomp4.py", line 19, in __init__
    self.height = info.video.video_height
AttributeError: 'NoneType' object has no attribute 'video'
saadiq@el-gigante:~/tmp$

tmdb_api

Need to add an empty init.py file to the folder at a minimum....I can start testing this branch as soon as you would like. I have about 100 movies to convert/tag

Error when subtitle language is not detected

In some scenario (not sure what) s.language is not a string, but a "NoneType". This causes the script to fail. See traceback below.

Traceback (most recent call last):

File "C:\Users\Michael\SickBeard\sickbeard_mp4_automator\postConversion.py", line 18, in

convert = MkvtoMp4(path, settings.ffmpeg, settings.ffprobe, settings.delete, settings.output_extension, settings.relocate_moov)

File "C:\Users\Michael\SickBeard\sickbeard_mp4_automator\mkvtomp4.py", line 44, in init

print "Subtitle stream detected: " + s.language

TypeError: cannot concatenate 'str' and 'NoneType' objects

Set the HD flag on the mp4 file

The previous tool I was using to convert videos (http://www.videohelp.com/tools/MkvToMp4) would set a flag on the generated file that would display a little HD logo in iTunes if the file was at least 720p. I have no idea how this was done, but I know it relies on a bunch of third party tools, such as MP4Box and ExifTool - http://www.sno.phy.queensu.ca/~phil/exiftool/

I wonder if this is easy, or at all possible to do in sickbeard_mp4_automator. This is obviously a very minor feature but it all adds up!

Disable Lookup

Hi,

I was wondering if you could implement an option to not lookup show information? Or even just the poster, as plex chooses to use the poster instead of the image grab it creates?

lxml.html module error

About halfway through a movie remux/audio encode this pops up...Everything is fine, just wondering if we are missing something in the lib's

[##### ] 58%
[##### ] 58%
[##/Users/craigsmith/sickbeard_mp4_automator/imdb/parser/http/utils.py:472: UserWarning: unable to use "lxml": No module named lxml.html
warnings.warn('unable to use "%s": %s' % (mod, str(e)))
/Users/craigsmith/sickbeard_mp4_automator/imdb/parser/http/utils.py:463: UserWarning: falling back to "beautifulsoup"
warnings.warn('falling back to "%s"' % mod)

] 58%

[##### ] 58%
[##### ] 58%
[##### ] 58%

CentOS 6.4 manual.py throws error

Running on CentOS 6.4 I get the following when running manual.py:

Traceback (most recent call last):
File "manual.py", line 240, in
main()
File "manual.py", line 237, in main
main()
File "manual.py", line 230, in main
walkDir(path, silent)
File "manual.py", line 181, in walkDir
print "Processing file %s" % (filepath.encode(sys.stdout.encoding, errors='ignore'))
TypeError: encode() takes no keyword arguments

Any ideas what is causing it?

Thanks!

Potential improvement to settings handling

Can I suggest an improvement to the handling of settings? When you add new features that require new settings you need to ship a new tvdb_mp4.ini file which overwrites any existing file and customisations. A common way to get around this is to ship a "default" settings file, eg tvdb_mp4.ini.default and ask users to copy it to tvdb_mp4.ini to perform their own customisations. Then when you're reading in the settings you can check the users customised file for the setting and if it doesn't exist you provide a default value, which ideally should be the same as in tvdb_mp4.ini.default. That way if a user has created their tvdb_mp4.ini file and updates to a newer version their old file remains in tact, and they inherit the default value for any new settings, which they can add to their customised file at any time.

I am not sure of any "best practise" ways of doing this in python, but other examples of this include MySQL (which ships my.ini, my.ini.huge,my-innodb-heavy-4G etc) and Drupal (of which I'm most familiar), shipping default.settings.php which you copy to settings.php. Oh and sublimetext2 is similar, in that it has Packages\Default\Preferences.sublime-settings and Packages\User\Preferences.sublime-settings.

Syntax Error nzbtocouchpotato

I must have messed something up....

File "/home/craig/sickbeard_mp4_automator/nzbToCouchPotatoMP4.py", line 61
except AttributeError:
^
SyntaxError: invalid syntax

Passed Args

Another bug found. Passed args are not always being read correctly.

I tried via python manual.py "/Volumes/NAS/TV Shows/Arrow/Arrow - 1x01 - Pilot - 720p.mkv" and python manual.py /Volumes/NAS/TV\ Shows/Arrow/Arrow\ -\ 1x01\ -\ Pilot\ -\ 720p.mkv

Both fail giving output "Enter path to file:" This also seems a bit dodgy as its worked once and failed many other times.

This kills automation.

Enter path to file:

: ^CTraceback (most recent call last):

File "manual.py", line 240, in
main()
File "manual.py", line 228, in main
path = getValue("Enter path to file")
File "manual.py", line 36, in getValue
value = raw_input("#: ").strip(' "')
KeyboardInterrupt

Movie Posters

At one point tagging was adding movie posters, that has seemed to stop before the switch to tmdb as well as after. Is this intended functionality?

codec can't encode character u'\xe5'

So far this is the only movie with the issue....

CouchPotatoServer did not append the IMDB id to the nzb, guessing instead
Guessed movie title as: Good Will Hunting
Matched movie title as: Good Will Hunting 1997-12-05
Fetching info for imdb id tt0119217
http://api.themoviedb.org/2.1/Movie.imdbLookup/en/json/45e408d2851e968e6e4d0353ce621c66/tt0119217
Failed to connect to tMDB, trying again in 20 seconds
'ascii' codec can't encode character u'\xe5' in position 14: ordinal not in range(128)
http://api.themoviedb.org/2.1/Movie.imdbLookup/en/json/45e408d2851e968e6e4d0353ce621c66/tt0119217
Failed to connect to tMDB, trying again in 20 seconds
'ascii' codec can't encode character u'\xe5' in position 14: ordinal not in range(128)

writing to output_directory now changed?

Before the latest merge of the dev and master branches my setup was working fine. Processing via sickbeard worked fine including downloading, transcoding, tagging and moving to the output_directory, which for me is the iTunes auto import directory.

However, after checking out the latest from master, manual processing of files is failing with an error saying the file can't be found but referencing it in the output_directory. If I remove the output_directory setting from my autoProcess.ini file it runs fine.

Additionally, processing by way of sickbeard is also failing with files seemingly being placed in my sickbeard file location rather than the defined output_directory. After both manual and sickbeard runs, I can find in my iTunes auto import directory, an unprocessed copy of the file in question in a "Not Added" folder.

I've checked the updated readme and added all the new config options with no luck. Any tips? Thanks!

Import external .srt with no language in the filename

Is it possible to import an external .srt file without specifying the language in the filename? I would imagine that it ought to just default to subtitle-default-language but instead it just ignores the subtitle file. This would save having to rename a season worth of subtitle files.

fails to convert avi files

I've tried multiple ways to convert avi files with manual.py I continualy receive this error:

Video codec detected: mpeg4
Audio stream detected: mp3 und [Stream 1]
Undefined language detected, defaulting to eng
{
"subtitle": {},
"audio": {
"0": {
"channels": 2,
"map": 1,
"codec": "aac",
"bitrate": 512,
"language": "eng"
}
},
"video": {
"map": 0,
"codec": "h264",
"bitrate": 1081576.0
},
"format": "mov"
}
Traceback (most recent call last):
File "./manual.py", line 240, in
main()
File "./manual.py", line 221, in main
processFile(path, tagdata)
File "./manual.py", line 167, in processFile
output = converter.process(inputfile, True)
File "/Users/ncl/Development/sickbeard_mp4_automator/mkvtomp4.py", line 73, in process
outputfile, inputfile = self.convert(inputfile, options, reportProgress)
File "/Users/ncl/Development/sickbeard_mp4_automator/mkvtomp4.py", line 269, in convert
for timecode in conv:
File "/Users/ncl/Development/sickbeard_mp4_automator/converter/init.py", line 246, in convert
timeout=timeout):
File "/Users/ncl/Development/sickbeard_mp4_automator/converter/ffmpeg.py", line 454, in convert
raise FFMpegConvertError('Unknown ffmpeg error ' + line)
converter.ffmpeg.FFMpegConvertError: Unknown ffmpeg error Unknown encoder 'libx264'

waiting for FFMPEG timeout

Getting this more and more specifically when working with larger files. Unsure what is going on

File "/home/craig/sickbeard_mp4_automator/mkvtomp4.py", line 105, in init
for timecode in conv:
File "/home/craig/sickbeard_mp4_automator/converter/init.py", line 240, in convert
timeout=timeout):
File "/home/craig/sickbeard_mp4_automator/converter/ffmpeg.py", line 406, in convert
ret = fd.read(10)
File "/home/craig/sickbeard_mp4_automator/converter/ffmpeg.py", line 389, in on_sigalrm
raise Exception('timed out while waiting for ffmpeg')
Exception: timed out while waiting for ffmpeg

Manual post-processing

This is something what I want to try

But i'm not sure were to start. To begin with a fully automated process is not an option due to subtitles, sometimes i have to wait for subtitle and sometimes it's hard to find subtitle with correct framrate.

For me a perfect solution would be an inbox (mkv +optional srt) and a outbox (m4v +optional org. mkv and srt).

It would be great if I could run this post-processing script on my synology either manual or if the script is watching the inbox.

I'm more or less a noob on Linux so any guidelines would be very much appreciated.

I know what DTS is supported in mp4/m4v, is it possible with DTS passthrough?
I have never succeeded to create a m4v with DTS using subler and playback with DTS on aTV using aTV Flash.
Most of my mkv contains DTS and I have no problem to play them using aTV Flash with DTS sound

Ref: http://forums.plexapp.com/index.php/topic/39265-my-solution-for-all-apple-devices/page-1#entry249587

iOS Audio

My settings create two audio streams one AAC and another AAC 2.0 (iOS compatible). When trying to force mp4 to convert, which this script had made. It created a third AAC 2.0 audio stream.

This seems to be a bug.

Subtitles not added via manual.py when using a relative filepath

When I run manual.py I usually run it from the directory the show is in, that way when I am asked to enter the file path I can just enter the file name without the full path. However I've just found out that this is the reason my external subtitles are not added.

The problem code is here

for dirName, subdirList, fileList in os.walk(input_dir):

input_dir is empty in this scenario

Is there a way to get the full path of input_dir? In PHP there is a function "realpath" which takes an absolute OR relative path as the input and returns the full absolute path. If python has something similar you could run that on the input_dir variable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.