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

How to Push / Force mp4 automator to merge / embed subtitles into . mp4 files #1472

Closed coolvicky2 closed 3 years ago

coolvicky2 commented 3 years ago

How to Push / Force mp4 automator to merge / embed subtitles into . mp4 files , Radarr and Sonarr downlaoding some files on mp4 already, automator can't merge subtiltes into them like it's going it with .mkv or other files

This my is Autoprocess.ini looks like

[Converter] ffmpeg = /usr/local/bin/ffmpeg ffprobe = /usr/local/bin/ffprobe threads = 0 hwaccels = nvdec hwaccel-decoders = h264_cuvid, hevc_cuvid, mjpeg_cuvid, mpeg1_cuvid, mpeg2_cuvid, mpeg4_cuvid, vc1_cuvid, hevc_qsv, h264_qsv, hevc_vaapi, h264_vaapi hwdevices = cuda:/dev/dri/card1 hwaccel-output-format = cuda:cuda output-directory = output-format = mp4 output-extension = mp4 temp-extension = incomplete minimum-size = 0 ignored-extensions = nfo, dsstore copy-to = move-to = delete-original = True sort-streams = True process-same-extensions = True bypass-if-copying-all = True force-convert = False post-process = False wait-post-process = False detailed-progress = False opts-separator = , preopts = postopts = regex-directory-replace = [^\w-. ]

[Permissions] chmod = 0777 uid = 1001 gid = 1001

[Metadata] relocate-moov = False full-path-guess = False tag = False tag-language = download-artwork = False sanitize-disposition = strip-metadata = False keep-titles = False

[Video] codec = h264_nvenc max-bitrate = 0 bitrate-ratio = crf = -1 crf-profiles = preset = codec-parameters = dynamic-parameters = True max-width = 0 profile = max-level = 0.0 pix-fmt = nv12 filter = force-filter = False

[HDR] codec = pix-fmt = space = bt2020nc transfer = smpte2084 primaries = bt2020 preset = codec-parameters = filter = force-filter = False profile =

[Audio] codec = aac languages = default-language = first-stream-of-language = False allow-language-relax = True channel-bitrate = 128 max-bitrate = 0 max-channels = 0 prefer-more-channels = True default-more-channels = True filter = force-filter = False sample-rates = sample-format = copy-original = False copy-original-before = False aac-adtstoasc = False ignore-truehd = ignored-dispositions = unique-dispositions = False

[Universal Audio] codec = aac channel-bitrate = 128 first-stream-only = False move-after = False filter = force-filter = False

[Audio.ChannelFilters] 6-2 = pan=stereo|FL=0.5FC+0.707FL+0.707BL+0.5LFE|FR=0.5FC+0.707FR+0.707BR+0.5LFE

[Subtitle] codec = mov_text codec-image-based = languages = eng default-language = eng first-stream-of-language = False encoding = burn-subtitles = False burn-dispositions = embed-subs = True embed-image-subs = False embed-only-internal-subs = False filename-dispositions = forced ignore-embedded-subs = False ignored-dispositions = unique-dispositions = False attachment-codec =

[Subtitle.Subliminal] download-subs = True download-hearing-impaired-subs = False providers =

[Subtitle.Subliminal.Auth] opensubtitles = coolvicky2:a44W720BROnu tvsubtitles =

[Sonarr] host = localhost port = 8989 apikey = ssl = False webroot = force-rename = False rescan = True block-reprocess = False

[Radarr] host = 127.0.0.1 port = 7878 apikey = bf71340abe3d4c4783477562db60b10e ssl = False webroot = force-rename = False rescan = True block-reprocess = False

[Sickbeard] host = localhost port = 8081 ssl = False apikey = webroot = username = password =

[Sickrage] host = localhost port = 8081 ssl = False apikey = webroot = username = password =

[CouchPotato] host = localhost port = 5050 username = password = apikey = delay = 65 method = renamer delete-failed = False ssl = False webroot =

[SABNZBD] convert = True sickbeard-category = sickbeard sickrage-category = sickrage couchpotato-category = couchpotato sonarr-category = sonarr radarr-category = radarr bypass-category = bypass output-directory = path-mapping =

[Deluge] couchpotato-label = couchpotato sickbeard-label = sickbeard sickrage-label = sickrage sonarr-label = sonarr radarr-label = radarr bypass-label = bypass convert = True host = localhost port = 58846 username = password = output-directory = remove = False path-mapping =

[qBittorrent] couchpotato-label = couchpotato sickbeard-label = sickbeard sickrage-label = sickrage sonarr-label = sonarr radarr-label = radarr bypass-label = bypass convert = True action-before = action-after = host = localhost port = 8080 ssl = False username = password = output-directory = path-mapping =

[uTorrent] couchpotato-label = couchpotato sickbeard-label = sickbeard sickrage-label = sickrage sonarr-label = sonarr radarr-label = radarr bypass-label = bypass convert = True webui = False action-before = action-after = host = localhost ssl = False port = 8080 username = password = output-directory = path-mapping =

[Plex] host = localhost port = 32400 refresh = False token =

This is the output i get

2021-08-18 03:29:20 - RadarrPostProcess - INFO - Radarr extra script post processing started. 2021-08-18 03:29:20 - resources.readsettings - INFO - /usr/local/sma/venv/bin/python3 2021-08-18 03:29:20 - resources.readsettings - INFO - Loading config file /usr/local/sma/config/autoProcess.ini. 2021-08-18 03:29:20 - resources.mediaprocessor - INFO - Processing /home/Snake Eyes/Snake Eyes.mp4. 2021-08-18 03:29:20 - resources.mediaprocessor - INFO - Input Data 2021-08-18 03:29:20 - resources.mediaprocessor - INFO - { "format": "mov,mp4,m4a,3gp,3g2,mj2", "format-fullname": "unknown", "video": { "index": 0, "codec": "h264", "bitrate": 2075475, "pix_fmt": "yuv420p", "profile": "77", "fps": 23.976023976023978, "framedata": { "pix_fmt": "yuv420p" }, "dimensions": "1920x800", "level": 4.0, "field_order": "unknown" }, "audio": [ { "index": 1, "codec": "aac", "bitrate": 254381, "channels": 2, "samplerate": 48000, "language": "eng", "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired" }, { "index": 2, "codec": "aac", "bitrate": 739983, "channels": 6, "samplerate": 48000, "language": "eng", "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired" } ], "subtitle": [], "attachment": [] } 2021-08-18 03:29:20 - resources.mediaprocessor - INFO - Reading video stream. 2021-08-18 03:29:20 - resources.mediaprocessor - INFO - Video codec detected: h264. 2021-08-18 03:29:20 - resources.mediaprocessor - INFO - Pix Fmt: yuv420p. 2021-08-18 03:29:20 - resources.mediaprocessor - INFO - Profile: 77. 2021-08-18 03:29:20 - resources.mediaprocessor - INFO - Video codec parameters None. 2021-08-18 03:29:20 - resources.mediaprocessor - INFO - Creating h264_nvenc video stream from source stream 0. 2021-08-18 03:29:20 - resources.mediaprocessor - INFO - Reading audio streams. 2021-08-18 03:29:20 - resources.mediaprocessor - INFO - Audio detected for stream 2 - aac eng 6 channel. 2021-08-18 03:29:20 - resources.mediaprocessor - INFO - Creating copy audio stream from source stream 2. 2021-08-18 03:29:20 - resources.mediaprocessor - INFO - Creating aac audio stream from source audio stream 2 [universal-audio]. 2021-08-18 03:29:20 - resources.mediaprocessor - INFO - Audio detected for stream 1 - aac eng 2 channel. 2021-08-18 03:29:20 - resources.mediaprocessor - INFO - Creating copy audio stream from source stream 1. 2021-08-18 03:29:20 - resources.mediaprocessor - INFO - Default audio stream set to eng copy 6 channel stream [default-more-channels: True]. 2021-08-18 03:29:21 - resources.mediaprocessor - INFO - Reading subtitle streams. 2021-08-18 03:29:21 - resources.mediaprocessor - INFO - Attempting to download subtitles. 2021-08-18 03:29:22 - resources.mediaprocessor - INFO - Input and output extensions match and the file appears to have already been processed by SMA, enable force-convert to override [force-convert: False]. 2021-08-18 03:29:22 - resources.mediaprocessor - INFO - Bypassing conversion and setting outputfile to inputfile. 2021-08-18 03:29:34 - RadarrPostProcess - INFO - Rescan command completed successfully. 2021-08-18 03:29:34 - RadarrPostProcess - INFO - Radarr monitoring information updated for movie Snake Eyes 2021-08-18 03:29:34 - RadarrPostProcess - INFO - Radarr response Rename command: ID 6267 queued.

mdhiggins commented 3 years ago

I don't follow what you're asking

It didn't find any external subs

coolvicky2 commented 3 years ago

ffmpeg -i Clean.mp4 -i Clean.spa.srt -i clean.eng.srt -i clean.ar.srt -c:s mov_text -c:v copy -c:a copy -map 0:v -map 0:a -map 1 -map 2 -metadata:s:s:0 language=spa -metadata:s:s:1 language=eng -metadata:s:s:2 language=ar With2CC.mp4

Right now i'm forcing encode , i want [Subtitle.Subliminal] to download multiple language subtitles , as many as it can for a movie and make a part of conversion

if you look above that's how my autoprocess.ini , look like to convert .mkv and all the other extension and to embed subtitles from .mp4 i've change

process-same-extensions = True bypass-if-copying-all = True

so this way , it can process .mp4 and make subtitles part of .mp4 , simple hardcode them into stream and that what i'm trying to achieve , however i want [Subtitle.Subliminal] to download as many language available for that and make them part of final mp4 as explained in ffmpeg command above

mdhiggins commented 3 years ago

So is the issue that subliminal isn't finding subtitles?

mdhiggins commented 3 years ago

The sample FFMPEG command I needed was for your other issue though

mdhiggins commented 3 years ago

You'll need to turn force convert on as well in order to add in additional subtitles to the file. It will still remux

coolvicky2 commented 3 years ago

Thanks loads working like charm