Closed herbi3 closed 4 months ago
Any chance you can post the sma.log data in a more readable format? Parsing through this is miserable
Particularly include whatever ffmpeg error you get
Most of the time if you adjust your subtitle options and or encoding options you can eliminate these issues; cleanit can also be useful
thanks @mdhiggins - I do have cleanit enabled too
hopefully this looks better.
2024-05-13 11:48:24 - resources.mediaprocessor - ERROR - M:\Media\TV Shows\For All Mankind\Season 2\For All Mankind - S2 E9 - Triage.tmp deleted.
2024-05-13 12:42:43 - SickbeardPostProcess - INFO - Sickbeard extra script post processing started.
2024-05-13 12:42:43 - resources.readsettings - INFO - C:\Python39\python.exe
2024-05-13 12:42:43 - resources.readsettings - INFO - Loading config file C:\Users\admin\AppData\MP4_Automator\config\autoProcess.ini.
2024-05-13 12:42:43 - resources.readsettings - WARNING - Force-convert is true, so process-same-extensions is being overridden to true as well
2024-05-13 12:42:43 - resources.mediaprocessor - INFO - Processing M:\Media\TV Shows\Resident Alien\Season 2\Resident Alien - S2 E6 - An Alien in New York.mkv.
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Input Data
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - {
"format": "matroska,webm",
"format-fullname": "Matroska / WebM",
"video": {
"index": 0,
"codec": "h264",
"pix_fmt": "yuv420p",
"profile": "high",
"fps": 23.976023976023978,
"framedata": {
"pix_fmt": "yuv420p"
},
"dimensions": "1280x720",
"level": 3.1,
"field_order": "progressive"
},
"audio": [
{
"index": 1,
"codec": "aac",
"channels": 2,
"samplerate": 48000,
"language": "eng",
"disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
}
],
"subtitle": [],
"attachment": []
}
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Reading video stream.
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Video codec detected: h264.
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Pix Fmt: yuv420p.
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Profile: high.
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Acceptable profile match found for VBR 1665.4773 using CRF 23, maxrate 4m, bufsize 8m.
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Video codec parameters None.
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Creating hevc_nvenc video stream from source stream 0.
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Reading audio streams.
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - The following stream indexes have been identified as being copies: [] [stream-codec-combinations].
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Audio detected for stream 1 - aac eng 2 channel.
2024-05-13 12:42:47 - resources.mediaprocessor - WARNING - Unable to determine audio bitrate from source stream 1, defaulting to 128 per channel.
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Creating opus audio stream from source stream 1.
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Found 0 streams that can be removed from the output file since they will be duplicates [stream-codec-combinations].
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Final sorting:
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - ['0->0']
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Final sorting:
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - ['0->0']
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Default audio stream set to eng opus 2 channel stream [audio-default-sorting: ['channels.d', 'map', 'd.comment']].
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Reading subtitle streams.
2024-05-13 12:42:47 - resources.mediaprocessor - INFO - Scanned for external subtitles and found 1 results in your approved languages.
2024-05-13 12:42:48 - resources.mediaprocessor - INFO - Creating mov_text subtitle stream by importing Text-based subtitle Resident Alien - S2 E6 - An Alien in New York.srt [embed-subs].
2024-05-13 12:42:48 - resources.mediaprocessor - INFO - Final sorting:
2024-05-13 12:42:48 - resources.mediaprocessor - INFO - ['0->0']
2024-05-13 12:42:48 - resources.mediaprocessor - INFO - cuda hwaccel is supported by this ffmpeg build and will be used [hwaccels].
2024-05-13 12:42:48 - resources.mediaprocessor - INFO - h264_cuvid decoder is supported by this ffmpeg build and will also be used [hwaccel-decoders].
2024-05-13 12:42:48 - resources.mediaprocessor - INFO - Output Data
2024-05-13 12:42:48 - resources.mediaprocessor - INFO - {
"source": [
"M:\\Media\\TV Shows\\Resident Alien\\Season 2\\Resident Alien - S2 E6 - An Alien in New York.mkv",
"M:\\Media\\TV Shows\\Resident Alien\\Season 2\\Resident Alien - S2 E6 - An Alien in New York.srt"
],
"format": "mp4",
"video": {
"codec": "hevc_nvenc",
"map": 0,
"bitrate": 999.28638,
"crf": 23,
"maxrate": "4m",
"bufsize": "8m",
"level": 4.1,
"profile": null,
"preset": "fast",
"pix_fmt": null,
"field_order": "progressive",
"width": null,
"filter": null,
"params": null,
"framedata": {
"pix_fmt": "yuv420p"
},
"bsf": null,
"debug": "video",
"title": "HD"
},
"audio": [
{
"map": 1,
"codec": "opus",
"channels": 2,
"bitrate": 256,
"profile": null,
"quality": 0,
"filter": null,
"samplerate": null,
"sampleformat": "",
"language": "eng",
"disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"bsf": null,
"debug": "universal-audio",
"title": "Stereo"
}
],
"subtitle": [
{
"source": 1,
"map": 0,
"codec": "mov_text",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "eng",
"debug": "subtitle.embed-subs",
"title": null
}
],
"attachment": []
}
2024-05-13 12:42:48 - resources.mediaprocessor - INFO - Preopts
2024-05-13 12:42:48 - resources.mediaprocessor - INFO - [
"-fix_sub_duration",
"-hwaccel",
"cuda",
"-vcodec",
"h264_cuvid"
]
2024-05-13 12:42:48 - resources.mediaprocessor - INFO - Postopts
2024-05-13 12:42:48 - resources.mediaprocessor - INFO - [
"-threads",
"0",
"-metadata:g",
"encoding_tool=SMA"
]
2024-05-13 12:42:48 - resources.mediaprocessor - INFO - Starting conversion.
2024-05-13 12:42:48 - resources.mediaprocessor - INFO - FFmpeg command:
2024-05-13 12:42:48 - resources.mediaprocessor - INFO - ======================
2024-05-13 12:42:48 - resources.mediaprocessor - INFO - C:\Users\Admin\AppData\FFMPEG\bin\ffmpeg.exe -fix_sub_duration -hwaccel cuda -vcodec h264_cuvid -i "M:\Media\TV Shows\Resident Alien\Season 2\Resident Alien - S2 E6 - An Alien in New York.mkv" -i "M:\Media\TV Shows\Resident Alien\Season 2\Resident Alien - S2 E6 - An Alien in New York.srt" -map_metadata -1 -vcodec hevc_nvenc -map 0:0 -field_order progressive -metadata:s:v title=HD -metadata:s:v handler_name=HD -preset fast -level 4.1 -tag:v hvc1 -qp 23 -maxrate:v 4m -bufsize 8m -c:a:0 libopus -map 0:1 -ac:a:0 2 -b:a:0 256k -metadata:s:a:0 BPS=256000 -metadata:s:a:0 BPS-eng=256000 -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:s:0 mov_text -map 1:0 -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 0 -metadata:g encoding_tool=SMA -y "M:\Media\TV Shows\Resident Alien\Season 2\Resident Alien - S2 E6 - An Alien in New York.tmp"
2024-05-13 12:42:48 - resources.mediaprocessor - INFO - ======================
2024-05-13 12:42:48 - resources.mediaprocessor - ERROR - Error converting file, FFMPEG error.
Traceback (most recent call last):
File "C:\Users\Admin\AppData\MP4_Automator\resources\mediaprocessor.py", line 2317, in convert
for timecode, debug in conv:
File "C:\Users\Admin\AppData\MP4_Automator\converter\__init__.py", line 329, in convert
for timecode, debug in self.ffmpeg.convert(outfile,
File "C:\Users\Admin\AppData\MP4_Automator\converter\ffmpeg.py", line 798, in convert
raise FFMpegConvertError('Exited with code %d' % p.returncode, cmd,
converter.ffmpeg.FFMpegConvertError: <unprintable FFMpegConvertError object>
2024-05-13 12:42:48 - resources.mediaprocessor - ERROR - C:\Users\Admin\AppData\FFMPEG\bin\ffmpeg.exe -fix_sub_duration -hwaccel cuda -vcodec h264_cuvid -i M:\Media\TV Shows\Resident Alien\Season 2\Resident Alien - S2 E6 - An Alien in New York.mkv -i M:\Media\TV Shows\Resident Alien\Season 2\Resident Alien - S2 E6 - An Alien in New York.srt -map_metadata -1 -vcodec hevc_nvenc -map 0:0 -field_order progressive -metadata:s:v title=HD -metadata:s:v handler_name=HD -preset fast -level 4.1 -tag:v hvc1 -qp 23 -maxrate:v 4m -bufsize 8m -c:a:0 libopus -map 0:1 -ac:a:0 2 -b:a:0 256k -metadata:s:a:0 BPS=256000 -metadata:s:a:0 BPS-eng=256000 -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:s:0 mov_text -map 1:0 -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 0 -metadata:g encoding_tool=SMA -y M:\Media\TV Shows\Resident Alien\Season 2\Resident Alien - S2 E6 - An Alien in New York.tmp
2024-05-13 12:42:48 - resources.mediaprocessor - ERROR - ffmpeg version 2024-05-08-git-e8e84dc325-full_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 13.2.0 (Rev5, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libxevd --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxeve --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 59. 17.100 / 59. 17.100
libavcodec 61. 5.103 / 61. 5.103
libavformat 61. 3.103 / 61. 3.103
libavdevice 61. 2.100 / 61. 2.100
libavfilter 10. 2.101 / 10. 2.101
libswscale 8. 2.100 / 8. 2.100
libswresample 5. 2.100 / 5. 2.100
libpostproc 58. 2.100 / 58. 2.100
Input #0, matroska,webm, from 'M:\Media\TV Shows\Resident Alien\Season 2\Resident Alien - S2 E6 - An Alien in New York.mkv':
Metadata:
encoder : libebml v1.4.2 + libmatroska v1.6.4
Duration: 00:44:19.16, start: 0.000000, bitrate: 1881 kb/s
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default)
Stream #0:1(eng): Audio: aac (HE-AAC), 48000 Hz, stereo, fltp (default)
Input #1, srt, from 'M:\Media\TV Shows\Resident Alien\Season 2\Resident Alien - S2 E6 - An Alien in New York.srt':
Duration: N/A, bitrate: N/A
Stream #1:0: Subtitle: subrip (srt)
Stream mapping:
Stream #0:0 -> #0:0 (h264 (h264_cuvid) -> hevc (hevc_nvenc))
Stream #0:1 -> #0:1 (aac (native) -> opus (libopus))
Stream #1:0 -> #0:2 (subrip (srt) -> mov_text (native))
Press [q] to stop, [?] for help
Output #0, mp4, to 'M:\Media\TV Shows\Resident Alien\Season 2\Resident Alien - S2 E6 - An Alien in New York.tmp':
Metadata:
encoding_tool : SMA
encoder : Lavf61.3.103
Stream #0:0: Video: hevc (Main) (hvc1 / 0x31637668), nv12(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 2000 kb/s, 23.98 fps, 24k tbn (default)
Metadata:
title : HD
handler_name : HD
encoder : Lavc61.5.103 hevc_nvenc
Side data:
cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000 vbv_delay: N/A
Stream #0:1(eng): Audio: opus (Opus / 0x7375704F), 48000 Hz, stereo, flt, 256 kb/s (default)
Metadata:
BPS : 256000
BPS-eng : 256000
title : Stereo
handler_name : Stereo
encoder : Lavc61.5.103 libopus
Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874)
Metadata:
encoder : Lavc61.5.103 mov_text
[mp4 @ 0000028bd57571c0] Application provided duration: 14400002000 is invalid
[vost#0:0/hevc_nvenc @ 0000028bd5bf00c0] Error submitting a packet to the muxer: Invalid argument
Last message repeated 1 times
[out#0/mp4 @ 0000028bd5d3e700] Error muxing a packet
[out#0/mp4 @ 0000028bd5d3e700] Task finished with error code: -22 (Invalid argument)
[out#0/mp4 @ 0000028bd5d3e700] Terminating thread with return code -22 (Invalid argument)
[out#0/mp4 @ 0000028bd5d3e700] video:8KiB audio:41KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 4.715447%
frame= 2 fps=0.0 q=22.0 Lsize= 52KiB time=00:00:00.08 bitrate=5064.5kbits/s speed=0.381x
Conversion failed!
2024-05-13 12:42:48 - resources.mediaprocessor - ERROR - M:\Media\TV Shows\Resident Alien\Season 2\Resident Alien - S2 E6 - An Alien in New York.tmp deleted.
Hm, "Error muxing a packet" doesn't quite sound like a subtitle error suspect this has to do with the hardware acceleration; its definitely not an ffmpeg error I've ever seen before
If you eliminate the subtitle does that change the outcome of the file? And does this fail every time for the same file or is it intermittently failing?
thanks for the response. it fails only for some files. ive generally noticed thisApplication provided duration: 14400002000 is invalid
is common for the files that don't get converted. which in milliseconds, seems to be 166 days.
if I remove the .srt subtitle file, it will process this as per normal
That information is helpful, and I have a theory!
Wondering if a -fix_sub_duration
parameter is needed before each input not just the first one, assuming your paths are the same, try this command and see if it errors
C:\Users\Admin\AppData\FFMPEG\bin\ffmpeg.exe -fix_sub_duration -hwaccel cuda -vcodec h264_cuvid -i M:\Media\TV Shows\Resident Alien\Season 2\Resident Alien - S2 E6 - An Alien in New York.mkv -fix_sub_duration -i M:\Media\TV Shows\Resident Alien\Season 2\Resident Alien - S2 E6 - An Alien in New York.srt -map_metadata -1 -vcodec hevc_nvenc -map 0:0 -field_order progressive -metadata:s:v title=HD -metadata:s:v handler_name=HD -preset fast -level 4.1 -tag:v hvc1 -qp 23 -maxrate:v 4m -bufsize 8m -c:a:0 libopus -map 0:1 -ac:a:0 2 -b:a:0 256k -metadata:s:a:0 BPS=256000 -metadata:s:a:0 BPS-eng=256000 -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:s:0 mov_text -map 1:0 -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 0 -metadata:g encoding_tool=SMA -y M:\Media\TV Shows\Resident Alien\Season 2\Resident Alien - S2 E6 - An Alien in New York.tmp
If that fixes it I have a change queued up
That seems to have done it!
e6b168791235771f8aa1849863ac01a6bdbc1f5c
Alright there's the update that should automate this, feel free to close it out if that fixes your issue
@mdhiggins great stuff! tested now without issues, thank you!
Describe the bug If processing of subtitles fail, ultimately the video itself is not converted.
Command or context you are trying to run Automatic using the sickchill post-processing
autoProcess.ini settings
Log files
FFMpeg headers
System Information
Expected behavior
Additional context Im just having a best guess that it's related to subtitles. these are automatically downloaded and seems unpreventable unless we completely disable subtitles. this only happens with some files, not all of them.
Issues posted without any logs or autoProcess settings will be closed