Unmanic / unmanic-plugins

Official plugins for the Unmanic application
21 stars 70 forks source link

Extract text subtitle streams to SRT files throwing errors #157

Open 666dsa666 opened 2 years ago

666dsa666 commented 2 years ago

Errors are :

Stream map '0:s:1' matches no streams. To ignore this, add a trailing '?' to the map.

Log before the error :

 Metadata:

     encoder : libebml v1.4.2 + libmatroska v1.6.4

     creation_time : 2021-11-15T09:15:55.000000Z

   Duration: 00:27:24.64, start: 0.000000, bitrate: 10752 kb/s

     Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)

     Metadata:

       BPS : 9470540

       DURATION : 00:27:24.600000000

       NUMBER_OF_FRAMES: 41115

       NUMBER_OF_BYTES : 1946906261

       _STATISTICS_WRITING_APP: mkvmerge v56.1.0 ('My Friend') 64-bit

       _STATISTICS_WRITING_DATE_UTC: 2021-11-15 09:15:55

       _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

     Stream #0:1(fre): Audio: eac3, 48000 Hz, 5.1, fltp (default)

     Metadata:

       title : French

       BPS : 640000

       DURATION : 00:27:24.640000000

       NUMBER_OF_FRAMES: 51395

       NUMBER_OF_BYTES : 131571200

       _STATISTICS_WRITING_APP: mkvmerge v56.1.0 ('My Friend') 64-bit

       _STATISTICS_WRITING_DATE_UTC: 2021-11-15 09:15:55

       _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

     Stream #0:2(eng): Audio: eac3, 48000 Hz, 5.1, fltp

     Metadata:

       title : English

       BPS : 640000

       DURATION : 00:27:24.608000000

       NUMBER_OF_FRAMES: 51394

       NUMBER_OF_BYTES : 131568640

       _STATISTICS_WRITING_APP: mkvmerge v56.1.0 ('My Friend') 64-bit

       _STATISTICS_WRITING_DATE_UTC: 2021-11-15 09:15:55

       _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

     Stream #0:3(fre): Subtitle: subrip (default)

     Metadata:

       title : French

       BPS : 81

       DURATION : 00:25:45.160000000

       NUMBER_OF_FRAMES: 533

       NUMBER_OF_BYTES : 15751

       _STATISTICS_WRITING_APP: mkvmerge v56.1.0 ('My Friend') 64-bit

       _STATISTICS_WRITING_DATE_UTC: 2021-11-15 09:15:55

       _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

Second file :

   Metadata:

     encoder : libebml v1.4.2 + libmatroska v1.6.4

     creation_time : 2021-12-24T08:05:15.000000Z

   Duration: 01:42:07.04, start: 0.000000, bitrate: 953 kb/s

     Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)

     Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1, fltp

     Metadata:

       title : English

     Stream #0:2(fre): Audio: eac3, 48000 Hz, 5.1, fltp (default) (forced)

     Metadata:

       title : French

     Stream #0:3(fre): Subtitle: subrip (forced)

     Metadata:

       title : French [Forced]

     Stream #0:4(fre): Subtitle: subrip

     Metadata:

       title : French

Stream map '0:s:2' matches no streams.

I have many files acting the same way.

666dsa666 commented 2 years ago

I tried applying https://github.com/Unmanic/unmanic-plugins/issues/154 recommendations, but I did not solve the issue.

Though I believe I did find the problem.

I believe the list is not cleaned between each files. On second file metadata you can see 4 streams, of which 2 are subtitles. 6 files were created during the extraction.

666dsa666 commented 2 years ago

FFMPEG command for 2nd file : ffmpeg -hide_banner -loglevel info -i /library/movies/movie (2021)/movie.2021.WEBDL-1080p.mkv -strict -2 -max_muxing_queue_size 4096 -map 0:s:0 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.fre.French.srt -map 0:s:0 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.fre.French.srt -map 0:s:0 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.fre.Full.srt -map 0:s:1 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.fre.FORCED.srt -map 0:s:0 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.fre.French.srt -map 0:s:0 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.fre.French.srt -map 0:s:0 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.fre.French.srt -map 0:s:0 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.fre.French.srt -map 0:s:0 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.eng.srt -map 0:s:1 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.cze.srt -map 0:s:2 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.dut.srt -map 0:s:3 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.hun.srt -map 0:s:4 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.pol.srt -map 0:s:5 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.rum.srt -map 0:s:6 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.rus.srt -map 0:s:7 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.spa.srt -map 0:s:0 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.eng.English-[CC].srt -map 0:s:1 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.spa.Latin-American-Spanish-[CC].srt -map 0:s:0 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.fre.srt -map 0:s:0 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.fre.French.srt -map 0:s:0 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.eng.English.srt -map 0:s:1 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.jpn.Japanese.srt -map 0:s:2 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.kor.Korean.srt -map 0:s:2 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.eng.English.srt -map 0:s:3 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.jpn.Japanese.srt -map 0:s:4 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.kor.Korean.srt -map 0:s:0 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.eng.English.srt -map 0:s:1 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.jpn.Japanese.srt -map 0:s:2 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.kor.Korean.srt -map 0:s:0 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.fre.French-[Forced].srt -map 0:s:1 -y /library/movies/movie (2021)/movie.2021.WEBDL-1080p.fre.French.srt

Josh5 commented 2 years ago

I tried applying https://github.com/Unmanic/unmanic-plugins/issues/154 recommendations, but I did not solve the issue.

Though I believe I did find the problem.

I believe the list is not cleaned between each files. On second file metadata you can see 4 streams, of which 2 are subtitles. 6 files were created during the extraction.

Yea. That is the solution, though it may be more involved than what I wrote in that message. The list is being appended to. And the object is not being recreated between files. This never used to be an issue up until the last release.

dalkain commented 2 years ago

I am also experiencing this issue since upgrading to 0.1.4.

As an additional behavior, the plugin seems to 'extract' a bunch of empty and duplicate subtitle files for tracks for languages/types that matched previous media files but not in the currently processing file. This happens until it eventually spirals and just starts failing to process every file. The only way I've been able to get it to start processing things again is to restart the container.

What was originally just a frustrating (but overall inconsequential) inconvenience turned into garbage being littered throughout new media folders in my collection.

Josh5 commented 2 years ago

Everyone who has this plugin installed on the latest release will have this issue.

I'll fix it later this week

dalkain commented 2 years ago

I assumed it was a problem for everyone given the nature of the problem described in #154. Figured it might help to know of other behaviors being caused in case further work is needed after the expected fixes are in place.

666dsa666 commented 2 years ago

Im unsure if I need to open another issue or if the issue is actually the same, but for some file removing the subtitles simply does not work, while acting like it does, making them reappear and be treated endlessly.

Using MkvToolnix I can delete the subtitles without issues.

666dsa666 commented 2 years ago

Seems solved using latest plugin update (had to update manually as it was not detected).