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.51k stars 201 forks source link

Not automatically converting multiple files when running qBittorrentPostProcess.py #1495

Closed djs4000 closed 2 years ago

djs4000 commented 2 years ago

It seems that recently mp4_automator is having issues when qbittorrent passes a torrent with multiple files, such as a full season download. I thought qbittorrent may have been the issue, so I tried calling the qBittorrentPostProcess.py but got the same result as the logs. It converts one file and then stops.


2021-11-15 21:58:30 - qBittorrentPostProcess - INFO - qBittorrent post processing started.
2021-11-15 21:58:30 - resources.readsettings - INFO - /usr/bin/python3
2021-11-15 21:58:30 - resources.readsettings - INFO - Loading config file /media/xxxx/Data/Software/MP4_automator/config/autoProcess.ini.
2021-11-15 21:58:30 - qBittorrentPostProcess - INFO - Performing conversion
2021-11-15 21:58:30 - qBittorrentPostProcess - INFO - Processing file /media/xxxx/Data/Downloads/Yyyy.S01.COMPLETE.1080p.WEB.h264-KOGi[TGx]/Yyyy.S01E06.1080p.WEB.h264-KOGi.mkv.
2021-11-15 21:58:30 - resources.mediaprocessor - INFO - Input Data
2021-11-15 21:58:30 - resources.mediaprocessor - INFO - {
    "format": "matroska,webm",
    "format-fullname": "Matroska / WebM",
    "video": {
        "index": 0,
        "codec": "h264",
        "pix_fmt": "yuv420p",
        "profile": "high",
        "fps": 24.0,
        "framedata": {
            "pix_fmt": "yuv420p",
            "color_space": "bt709",
            "color_primaries": "bt709",
            "color_transfer": "bt709",
            "side_data_list": [
                {
                    "side_data_type": "SMPTE 12-1 timecode",
                    "timecodes": [
                        {
                            "value": "00:00:00:00"
                        }
                    ]
                }
            ]
        },
        "dimensions": "1920x1080",
        "level": 4.0,
        "field_order": "progressive"
    },
    "audio": [
        {
            "index": 1,
            "codec": "eac3",
            "channels": 6,
            "samplerate": 48000,
            "language": "eng",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired"
        }
    ],
    "subtitle": [
        {
            "index": 2,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "eng"
        },
        {
            "index": 3,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "dan"
        },
        {
            "index": 4,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "deu"
        },
        {
            "index": 5,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "spa"
        },
        {
            "index": 6,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "spa"
        },
        {
            "index": 7,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "fin"
        },
        {
            "index": 8,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "fra"
        },
        {
            "index": 9,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "ita"
        },
        {
            "index": 10,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "jpn"
        },
        {
            "index": 11,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "kor"
        },
        {
            "index": 12,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "nld"
        },
        {
            "index": 13,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "nor"
        },
        {
            "index": 14,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "pol"
        },
        {
            "index": 15,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "por"
        },
        {
            "index": 16,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "por"
        },
        {
            "index": 17,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "swe"
        },
        {
            "index": 18,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "zho"
        },
        {
            "index": 19,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "zho"
        },
        {
            "index": 20,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "language": "zho"
        }
    ],
    "attachment": []
}
2021-11-15 21:58:30 - resources.mediaprocessor - INFO - Reading video stream.
2021-11-15 21:58:30 - resources.mediaprocessor - INFO - Video codec detected: h264.
2021-11-15 21:58:30 - resources.mediaprocessor - INFO - Pix Fmt: yuv420p.
2021-11-15 21:58:30 - resources.mediaprocessor - INFO - Profile: high.
2021-11-15 21:58:30 - resources.mediaprocessor - INFO - Video codec parameters None.
2021-11-15 21:58:30 - resources.mediaprocessor - INFO - Creating copy video stream from source stream 0.
2021-11-15 21:58:30 - resources.mediaprocessor - INFO - Reading audio streams.
2021-11-15 21:58:30 - resources.mediaprocessor - INFO - Audio detected for stream 1 - eac3 eng 6 channel.
2021-11-15 21:58:30 - resources.mediaprocessor - INFO - Creating aac audio stream source audio stream 1 [universal-audio].
2021-11-15 21:58:30 - resources.mediaprocessor - INFO - Creating ac3 audio stream from source stream 1.
2021-11-15 21:58:30 - resources.mediaprocessor - INFO - Default audio stream set to eng ac3 6 channel stream [default-more-channels: True].
2021-11-15 21:58:30 - resources.mediaprocessor - INFO - Reading subtitle streams.
2021-11-15 21:58:30 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 2 - subrip eng.
2021-11-15 21:58:30 - resources.mediaprocessor - INFO - Creating mov_text subtitle stream from source stream 2.
2021-11-15 21:58:31 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 3 - subrip dan.
2021-11-15 21:58:31 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 4 - subrip deu.
2021-11-15 21:58:31 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 5 - subrip spa.
2021-11-15 21:58:31 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 6 - subrip spa.
2021-11-15 21:58:31 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 7 - subrip fin.
2021-11-15 21:58:32 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 8 - subrip fra.
2021-11-15 21:58:32 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 9 - subrip ita.
2021-11-15 21:58:32 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 10 - subrip jpn.
2021-11-15 21:58:32 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 11 - subrip kor.
2021-11-15 21:58:32 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 12 - subrip nld.
2021-11-15 21:58:33 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 13 - subrip nor.
2021-11-15 21:58:33 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 14 - subrip pol.
2021-11-15 21:58:33 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 15 - subrip por.
2021-11-15 21:58:33 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 16 - subrip por.
2021-11-15 21:58:33 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 17 - subrip swe.
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 18 - subrip zho.
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 19 - subrip zho.
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - Text-based subtitle detected for stream 20 - subrip zho.
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - Attempting to download subtitles.
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - Scanned for external subtitles and found 0 results in your approved languages.
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - Output Data
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - {
    "source": [
        "/media/xxxx/Data/Downloads/Yyyy.S01.COMPLETE.1080p.WEB.h264-KOGi[TGx]/Yyyy.S01E06.1080p.WEB.h264-KOGi.mkv"
    ],
    "format": "mp4",
    "video": {
        "codec": "copy",
        "map": 0,
        "bitrate": 5939.018,
        "crf": -1,
        "maxrate": null,
        "bufsize": null,
        "level": 0.0,
        "profile": "high",
        "preset": null,
        "pix_fmt": "yuv420p",
        "field_order": "progressive",
        "width": null,
        "filter": null,
        "params": null,
        "framedata": null,
        "title": "FHD",
        "debug": "video"
    },
    "audio": [
        {
            "map": 1,
            "codec": "aac",
            "channels": 2,
            "bitrate": 256,
            "samplerate": null,
            "filter": "pan=stereo|FL=0.5*FC+0.707*FL+0.707*BL+0.5*LFE|FR=0.5*FC+0.707*FR+0.707*BR+0.5*LFE",
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "title": "Stereo",
            "debug": "universal-audio"
        },
        {
            "map": 1,
            "codec": "ac3",
            "channels": 6,
            "bitrate": 768,
            "filter": null,
            "samplerate": null,
            "language": "eng",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "bsf": null,
            "title": "5.1 Channel",
            "debug": "audio"
        }
    ],
    "subtitle": [
        {
            "map": 2,
            "codec": "mov_text",
            "language": "eng",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "title": null,
            "debug": "subtitle.embed-subs"
        }
    ],
    "attachment": []
}
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - Preopts
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - [
    "-fix_sub_duration"
]
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - Postopts
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - [
    "-threads",
    "4",
    "-metadata:g",
    "encoding_tool=SMA"
]
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - Downloaded Subtitles
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - []
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - Starting conversion.
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - FFmpeg command:
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - ======================
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - /usr/bin/ffmpeg -fix_sub_duration -i /media/xxxx/Data/Downloads/Yyyy.S01.COMPLETE.1080p.WEB.h264-KOGi[TGx]/Yyyy.S01E06.1080p.WEB.h264-KOGi.mkv -map_metadata -1 -vcodec copy -map 0:0 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -c:a:0 aac -map 0:1 -ac:a:0 2 -b:a:0 256k -metadata:s:a:0 BPS=256000 -metadata:s:a:0 BPS-eng=256000 -filter:a:0 pan=stereo|FL=0.5*FC+0.707*FL+0.707*BL+0.5*LFE|FR=0.5*FC+0.707*FR+0.707*BR+0.5*LFE -metadata:s:a:0 title=Stereo -metadata:s:a:0 handler_name=Stereo -metadata:s:a:0 language=eng -disposition:a:0 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -strict experimental -c:a:1 ac3 -map 0:1 -ac:a:1 6 -b:a:1 768k -metadata:s:a:1 BPS=768000 -metadata:s:a:1 BPS-eng=768000 -metadata:s:a:1 "title=5.1 Channel" -metadata:s:a:1 "handler_name=5.1 Channel" -metadata:s:a:1 language=eng -disposition:a:1 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:s:0 mov_text -map 0:2 -metadata:s:s:0 title= -metadata:s:s:0 handler_name= -metadata:s:s:0 language=eng -disposition:s:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f mp4 -threads 4 -metadata:g encoding_tool=SMA -y /media/xxxx/Data/Downloads/Yyyy.S01.COMPLETE.1080p.WEB.h264-KOGi_TGx__-convert/Yyyy.S01E06.1080p.WEB.h264-KOGi.temp
2021-11-15 21:58:34 - resources.mediaprocessor - INFO - ======================
2021-11-15 21:58:52 - resources.mediaprocessor - INFO - /media/xxxx/Data/Downloads/Yyyy.S01.COMPLETE.1080p.WEB.h264-KOGi_TGx__-convert/Yyyy.S01E06.1080p.WEB.h264-KOGi.temp created.
2021-11-15 21:58:55 - qBittorrentPostProcess - INFO - Passing /media/xxxx/Data/Downloads/Yyyy.S01.COMPLETE.1080p.WEB.h264-KOGi_TGx__-convert directory to Sonarr.
2021-11-15 21:58:55 - autoprocess.sonarr - INFO - Sonarr notifier started.
2021-11-15 21:58:55 - autoprocess.sonarr - INFO - Requesting Sonarr to scan directory '/media/xxxx/Data/Downloads/Yyyy.S01.COMPLETE.1080p.WEB.h264-KOGi_TGx__-convert'.
2021-11-15 21:58:55 - autoprocess.sonarr - INFO - Sonarr response: queued.
mdhiggins commented 2 years ago

qBittorrentPostProcess.py has supported multi file torrents for some time, are you seeing this with every torrent or just this one?

Please post a set of logs with debug logging enabled if this is persistent

single_file = os.path.isfile(content_path) is the line where this determination is made, the content_path variable is the sys.argv[4] command line parameter, ensure that you have this appropriately configured as well if you're seeing issues

https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/Debug-Level-Logging

djs4000 commented 2 years ago

Hi @mdhiggins ! Turns out it wasn't picking up the files due to filesize facepalm I had two torrents recently that had a few videos under 100mb and since I had set that as the minimum file-size it kept skipping them. I was pulling my hair out trying to work out why it wasn't working.

Sorry about that, you're script has truly being amazing. Might be worth adding a "Skipping file due to minimum size" so other people have an easier troubleshooting in case they make a dumb mistake like mine.