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 202 forks source link

Subtitle dual stream and error on reading .srt #192

Closed zybeon closed 9 years ago

zybeon commented 9 years ago

I was watching the conversion of some of my files recently and noticed a strange trend. I also has some other files error out for an unknown reason.

When a video has an embedded subtitle stream the script still attempts to download subtitles. Not sure if it uses the downloaded file or keeps the original. When a video has multiple subtitle streams in different languages it keeps all subtitles and only deletes the one that got embedded. Add option to delete all extra subtitle streams after embedding or all subs in language not specified. This last one is very strange. It has embedded subs and external subs. Yet the script still attempts to download subs. It also makes to sub streams, but something causes it to fail when reading the external or possibly the downloaded subs.

      Subtitles exist and subs still downloaded.

Processing file /tank/Movies/Clue (1985)/Clue1985.mkv Matched movie title as: Clue 1985-12-13 Processing Clue Video codec detected: h264 Audio stream detected: dca eng [Stream 1] Subtitle stream detected: srt eng [Stream 2] Attempting to download subtitles, please wait { "subtitle": { "0": { "map": 2, "codec": "mov_text", "language": "eng" } }, "audio": { "0": { "channels": 2, "map": 1, "codec": "aac", "bitrate": 192, "language": "eng" } }, "video": { "map": 0, "codec": "copy", "bitrate": 6460394.0 }, "format": "mp4" } /tank/Movies/Clue (1985)/Clue1985.mp4 created /tank/Movies/Clue (1985)/Clue1985.mkv deleted Tagging file :/tank/Movies/Clue (1985)/Clue1985.mp4 Trying to write tags Tags written successfully Relocating MOOV atom to start of file

Uses Eng subs but keeps subs detected in not selected language.

Processing file /tank/Movies/Star Wars (1977-2005)/Star Wars - Episode IV - A New Hope (1977)/Star Wars - Episode IV - A New Hope (1977).mkv Video codec detected: h264 Audio stream detected: dca eng [Stream 1] Creating dual audio channels for iOS compatability for this stream Audio stream detected: ac3 chi [Stream 2] Attempting to download subtitles, please wait External subtitle file detected, language Ignoring Star Wars - Episode IV - A New Hope (1977).srt external subtitle stream due to language: External subtitle file detected, language eng Importing Star Wars - Episode IV - A New Hope (1977).eng.srt subtitle stream { "subtitle": { "0": { "path": "/tank/Movies/Star Wars (1977-2005)/Star Wars - Episode IV - A New Hope (1977)/Star Wars - Episode IV - A New Hope (1977).eng.srt", "map": 0, "codec": "mov_text", "language": "eng", "source": 1 } }, "audio": { "0": { "channels": 2, "map": 1, "codec": "aac", "bitrate": 192, "language": "eng" }, "1": { "channels": 7, "map": 1, "codec": "copy", "bitrate": 1536, "language": "eng" } }, "video": { "map": 0, "codec": "copy", "bitrate": 7496474.0 }, "format": "mp4" } /tank/Movies/Star Wars (1977-2005)/Star Wars - Episode IV - A New Hope (1977)/Star Wars - Episode IV - A New Hope (1977).mp4 created /tank/Movies/Star Wars (1977-2005)/Star Wars - Episode IV - A New Hope (1977)/Star Wars - Episode IV - A New Hope (1977).mkv deleted /tank/Movies/Star Wars (1977-2005)/Star Wars - Episode IV - A New Hope (1977)/Star Wars - Episode IV - A New Hope (1977).eng.srtdeleted Relocating MOOV atom to start of file Processing file /tank/Movies/Star Wars (1977-2005)/Star Wars - Episode IV - A New Hope (1977)/Star Wars - Episode IV - A New Hope (1977).mp4 Relocating MOOV atom to start of file QT FastStart did not run - perhaps moov atom was at the start already Dual sub streams, with downloaded of extra subs then crashes on reading sub file. Processing file /tank/TVShows/Scorpion/Season 1/S01E02 - Single Point of Failure.mkv Matched TV episode as Scorpion (TVDB ID:281630) S01E02 Processing Scorpion Season 01 Episode 02 - Single Point of Failure Video codec detected: h264 Audio stream detected: ac3 eng [Stream 1] Creating dual audio channels for iOS compatability for this stream Subtitle stream detected: srt eng [Stream 2] Attempting to download subtitles, please wait External subtitle file detected, language eng Importing S01E02 - Single Point of Failure.eng.srt subtitle stream { "subtitle": { "0": { "map": 2, "codec": "mov_text", "language": "eng" }, "1": { "path": "/tank/TVShows/Scorpion/Season 1/S01E02 - Single Point of Failure.eng.srt", "map": 0, "codec": "mov_text", "language": "eng", "source": 1 } }, "audio": { "0": { "channels": 2, "map": 1, "codec": "aac", "bitrate": 192, "language": "eng" }, "1": { "channels": 6, "map": 1, "codec": "copy", "bitrate": 384, "language": "eng" } }, "video": { "map": 0, "codec": "copy", "bitrate": 4327242.0 }, "format": "mp4" } An unexpected error occurred, processing of this file has failed Unknown ffmpeg error /tank/TVShows/Scorpion/Season 1/S01E02 - Single Point of Failure.eng.srt: Invalid data found when processing input

mdhiggins commented 9 years ago

So this behavior I think is expected. For the first scenario, it looks like its behaving as it should. When subliminal attempts to download subtitle files its scans the file for existing subs of the appropriate language and determines if the subs need to be downloaded at all. In this case, no subs are downloaded.

The second scenario is a little confusing, I'm guessing the source file you're giving it came shipped with some files that simply weren't in the naming convention required by the script and it instead downloaded its own files, which are correctly imported. (Subtitle files have no metadata to analyze for a language so the naming convention is important).

The third scenario is the only one that doesn't seem quite right. I'm not sure if that subtitle file was downloaded by the script or provided by you, but either way it looks corrupt and something didn't work. Not sure if you just got a bad sub download or what. Technically based on what I'm seeing it shouldn't have tried to download subtitles at all. Sometimes, for whatever reason, subliminal seems to download when it shouldn't. This may be related to some subtitles being flagged as being for hearing impaired vs just regular subs, though I'm not certain of this.

Hope this explains everything.

mdhiggins commented 9 years ago

Gonna close this as it doesn't appear to be an issue