sonarr-sma
sonarr-sma copied to clipboard
Sonarr stuck "importing file" after sma script execution
Hey everyone, I configured the container as explained in the README file
- Complete download handling enable
- Connect -> custom script ->
On File Import(the documentation says it is the formeronDownload),On File Upgrade-> script/usr/local/sma/postSonarr.sh
It seems to run after the download. The converted file has been put in the right folder as expected. But Sonarr remains stuck in "importing file". It doesn't proceed, and it doesn't know the converted file in its list
Have I forgotten to configure something?
Post logs
sma.log
2025-03-01 18:30:41 - SonarrPostProcess - INFO - Sonarr extra script post processing started.
2025-03-01 18:30:41 - resources.readsettings - INFO - /usr/local/sma/venv/bin/python3
2025-03-01 18:30:41 - resources.readsettings - INFO - Loading config file /usr/local/sma/config/autoProcess.ini.
2025-03-01 18:30:42 - resources.mediaprocessor - INFO - Processing /tv/Example/Season 2/Example - S02E08 - Example WEBDL-2160p.mkv.
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Input Data
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - {
"format": "matroska,webm",
"format-fullname": "Matroska / WebM",
"video": {
"index": 0,
"codec": "hevc",
"bitrate": 13529681,
"pix_fmt": "yuv420p10le",
"profile": "main10",
"fps": 23.976023976023978,
"framedata": {
"pix_fmt": "yuv420p10le",
"color_space": "bt2020nc",
"color_primaries": "bt2020",
"color_transfer": "smpte2084",
"side_data_list": [
{
"side_data_type": "H.26[45] User Data Unregistered SEI message"
},
{
"side_data_type": "H.26[45] User Data Unregistered SEI message"
},
{
"side_data_type": "Mastering display metadata",
"red_x": "34000/50000",
"red_y": "16000/50000",
"green_x": "13250/50000",
"green_y": "34500/50000",
"blue_x": "7500/50000",
"blue_y": "3000/50000",
"white_point_x": "15635/50000",
"white_point_y": "16450/50000",
"min_luminance": "1/10000",
"max_luminance": "10000000/10000"
},
{
"side_data_type": "Content light level metadata",
"max_content": 500,
"max_average": 491
},
{
"side_data_type": "HDR Dynamic Metadata SMPTE2094-40 (HDR10+)",
"application version": 1,
"num_windows": 1,
"targeted_system_display_maximum_luminance": "500/1",
"maxscl": "0/100000",
"average_maxrgb": "0/100000",
"num_distribution_maxrgb_percentiles": 9,
"distribution_maxrgb_percentage": 99,
"distribution_maxrgb_percentile": "0/100000",
"fraction_bright_pixels": "0/1000",
"knee_point_x": "0/4095",
"knee_point_y": "0/4095",
"num_bezier_curve_anchors": 9,
"bezier_curve_anchors": "922/1023"
},
{
"side_data_type": "Dolby Vision RPU Data"
},
{
"side_data_type": "Dolby Vision Metadata",
"rpu_type": 2,
"rpu_format": 18,
"vdr_rpu_profile": 1,
"vdr_rpu_level": 0,
"chroma_resampling_explicit_filter_flag": 0,
"coef_data_type": 0,
"coef_log2_denom": 23,
"vdr_rpu_normalized_idc": 1,
"bl_video_full_range_flag": 0,
"bl_bit_depth": 10,
"el_bit_depth": 10,
"vdr_bit_depth": 12,
"spatial_resampling_filter_flag": 0,
"el_spatial_resampling_filter_flag": 0,
"disable_residual_flag": 1,
"vdr_rpu_id": 0,
"mapping_color_space": 0,
"mapping_chroma_format_idc": 0,
"nlq_method_idc": -1,
"nlq_method_idc_name": "none",
"num_x_partitions": 1,
"num_y_partitions": 1,
"components": [
{
"pivots": "0 1023",
"pieces": [
{
"mapping_idc": 0,
"mapping_idc_name": "polynomial",
"poly_order": 1,
"poly_coef": "0 8388608"
}
]
},
{
"pivots": "0 1023",
"pieces": [
{
"mapping_idc": 0,
"mapping_idc_name": "polynomial",
"poly_order": 1,
"poly_coef": "0 8388608"
}
]
},
{
"pivots": "0 1023",
"pieces": [
{
"mapping_idc": 0,
"mapping_idc_name": "polynomial",
"poly_order": 1,
"poly_coef": "0 8388608"
}
]
}
],
"dm_metadata_id": 0,
"scene_refresh_flag": 1,
"ycc_to_rgb_matrix": "9574/8192 0/8192 13802/8192 9574/8192 -1540/8192 -5348/8192 9574/8192 17610/8192 0/8192",
"ycc_to_rgb_offset": "16777216/268435456 134217728/268435456 134217728/268435456",
"rgb_to_lms_matrix": "7222/16384 8771/16384 390/16384 2654/16384 12430/16384 1300/16384 0/16384 422/16384 15962/16384",
"signal_eotf": 65535,
"signal_eotf_param0": 0,
"signal_eotf_param1": 0,
"signal_eotf_param2": 0,
"signal_bit_depth": 12,
"signal_color_space": 0,
"signal_chroma_format": 0,
"signal_full_range_flag": 1,
"source_min_pq": 7,
"source_max_pq": 3079,
"source_diagonal": 42
}
]
},
"dimensions": "3840x2160",
"level": 5.0,
"field_order": "unknown"
},
"audio": [
{
"index": 1,
"codec": "eac3",
"bitrate": 224000,
"channels": 2,
"samplerate": 48000,
"language": "ita",
"disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
},
{
"index": 2,
"codec": "eac3",
"bitrate": 768000,
"channels": 6,
"samplerate": 48000,
"language": "eng",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
}
],
"subtitle": [
{
"index": 3,
"codec": "subrip",
"disposition": "+default-dub-original-comment-lyrics-karaoke+forced-hearing_impaired-visual_impaired-captions",
"language": "ita"
},
{
"index": 4,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "ita"
},
{
"index": 5,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced+hearing_impaired-visual_impaired-captions",
"language": "eng"
}
],
"attachment": []
}
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Reading video stream.
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Video codec detected: hevc.
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Pix Fmt: yuv420p10le.
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Profile: main10.
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - HDR video stream detected for 0.
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Video codec parameters None.
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Creating h264 video stream from source stream 0.
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Reading audio streams.
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - The following stream indexes have been identified as being copies: [] [stream-codec-combinations].
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Audio detected for stream 1 - eac3 ita 2 channel.
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Creating aac audio stream from source stream 1.
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Audio detected for stream 2 - eac3 eng 6 channel.
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Creating ac3 audio stream from source stream 2.
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Creating aac audio stream from source audio stream 2 [universal-audio].
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Found 0 streams that can be removed from the output file since they will be duplicates [stream-codec-combinations].
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Final sorting:
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - ['0->0', '1->1', '2->2']
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Final sorting:
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - ['0->0', '1->1', '2->2']
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Default audio stream set to ita aac 2 channel stream [audio-default-sorting: ['channels.d', 'map', 'd.comment']].
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Reading subtitle streams.
2025-03-01 18:30:43 - resources.mediaprocessor - INFO - Subtitle detected for stream 3 - subrip ita.
2025-03-01 18:30:44 - resources.mediaprocessor - INFO - Stream 3 is text-based subtitle for codec subrip.
2025-03-01 18:30:44 - resources.mediaprocessor - INFO - Creating mov_text subtitle stream from source stream 3.
2025-03-01 18:30:44 - resources.mediaprocessor - INFO - Subtitle detected for stream 4 - subrip ita.
2025-03-01 18:30:44 - resources.mediaprocessor - INFO - Stream 4 is text-based subtitle for codec subrip.
2025-03-01 18:30:44 - resources.mediaprocessor - INFO - Creating mov_text subtitle stream from source stream 4.
2025-03-01 18:30:44 - resources.mediaprocessor - INFO - Subtitle detected for stream 5 - subrip eng.
2025-03-01 18:30:45 - resources.mediaprocessor - INFO - Stream 5 is text-based subtitle for codec subrip.
2025-03-01 18:30:45 - resources.mediaprocessor - INFO - Creating mov_text subtitle stream from source stream 5.
2025-03-01 18:30:45 - resources.mediaprocessor - INFO - Scanned for external subtitles and found 0 results in your approved languages.
2025-03-01 18:30:45 - resources.mediaprocessor - INFO - Final sorting:
2025-03-01 18:30:45 - resources.mediaprocessor - INFO - ['0->0', '1->1', '2->2']
2025-03-01 18:30:45 - resources.mediaprocessor - INFO - Output Data
2025-03-01 18:30:45 - resources.mediaprocessor - INFO - {
"source": [
"/tv/Example/Season 2/Example - S02E08 - Example WEBDL-2160p.mkv"
],
"format": "mp4",
"video": {
"codec": "h264",
"map": 0,
"bitrate": 12855.6546,
"crf": -1,
"maxrate": null,
"bufsize": null,
"level": 0.0,
"profile": null,
"preset": null,
"pix_fmt": null,
"field_order": "unknown",
"width": null,
"filter": null,
"params": null,
"framedata": null,
"bsf": null,
"debug": "video.hdrInput",
"title": "4K HDR"
},
"audio": [
{
"map": 1,
"codec": "aac",
"channels": 2,
"bitrate": 256,
"profile": null,
"quality": 0,
"filter": null,
"samplerate": null,
"sampleformat": "",
"language": "ita",
"disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"bsf": null,
"debug": "universal-audio",
"title": "Stereo"
},
{
"map": 2,
"codec": "ac3",
"channels": 6,
"bitrate": 768,
"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": "audio",
"title": "5.1 Channel"
},
{
"map": 2,
"codec": "aac",
"channels": 2,
"bitrate": 256,
"quality": 0,
"profile": null,
"samplerate": null,
"sampleformat": "",
"filter": null,
"language": "eng",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"debug": "universal-audio",
"title": "Stereo"
}
],
"subtitle": [
{
"map": 3,
"codec": "mov_text",
"language": "ita",
"disposition": "+default-dub-original-comment-lyrics-karaoke+forced-hearing_impaired-visual_impaired-captions",
"debug": "subtitle.embed-subs",
"title": "Forced"
},
{
"map": 4,
"codec": "mov_text",
"language": "ita",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"debug": "subtitle.embed-subs",
"title": null
},
{
"map": 5,
"codec": "mov_text",
"language": "eng",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced+hearing_impaired-visual_impaired-captions",
"debug": "subtitle.embed-subs",
"title": "Hearing Impaired"
}
],
"attachment": []
}
2025-03-01 18:30:45 - resources.mediaprocessor - INFO - Preopts
2025-03-01 18:30:45 - resources.mediaprocessor - INFO - []
2025-03-01 18:30:45 - resources.mediaprocessor - INFO - Postopts
2025-03-01 18:30:45 - resources.mediaprocessor - INFO - [
"-threads",
"0",
"-metadata:g",
"encoding_tool=SMA",
"-strict",
"unofficial"
]
2025-03-01 18:30:45 - resources.mediaprocessor - INFO - Starting conversion.
2025-03-01 18:30:46 - resources.mediaprocessor - INFO - FFmpeg command:
2025-03-01 18:30:46 - resources.mediaprocessor - INFO - ======================
2025-03-01 18:30:46 - resources.mediaprocessor - INFO - /usr/local/bin/ffmpeg -fix_sub_duration -i "/tv/Exmaple/Season 2/Example - S02E08 - Example WEBDL-2160p.mkv" -vcodec libx264 -map 0:0 -vb 12855k -metadata:s:v BPS=12855000 -metadata:s:v BPS-eng=12855000 -metadata:s:v "title=4K HDR" -metadata:s:v "handler_name=4K HDR" -tag:v avc1 -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 -metadata:s:a:0 title=Stereo -metadata:s:a:0 handler_name=Stereo -metadata:s:a:0 language=ita -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:1 ac3 -map 0:2 -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:a:2 aac -map 0:2 -ac:a:2 2 -b:a:2 256k -metadata:s:a:2 BPS=256000 -metadata:s:a:2 BPS-eng=256000 -metadata:s:a:2 title=Stereo -metadata:s:a:2 handler_name=Stereo -metadata:s:a:2 language=eng -disposition:a:2 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:s:0 mov_text -map 0:3 -metadata:s:s:0 title=Forced -metadata:s:s:0 handler_name=Forced -metadata:s:s:0 language=ita -disposition:s:0 +default-dub-original-comment-lyrics-karaoke+forced-hearing_impaired-visual_impaired-captions -c:s:1 mov_text -map 0:4 -metadata:s:s:1 title= -metadata:s:s:1 handler_name= -metadata:s:s:1 language=ita -disposition:s:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:s:2 mov_text -map 0:5 -metadata:s:s:2 "title=Hearing Impaired" -metadata:s:s:2 "handler_name=Hearing Impaired" -metadata:s:s:2 language=eng -disposition:s:2 -default-dub-original-comment-lyrics-karaoke-forced+hearing_impaired-visual_impaired-captions -f mp4 -threads 0 -metadata:g encoding_tool=SMA -strict -2 -y "/tv/Example/Season 2/Example - S02E08 - Example WEBDL-2160p.mp4"
2025-03-01 18:30:46 - resources.mediaprocessor - INFO - ======================
sonarr debug logs
2025-03-01 18:44:36.5|Error|VideoFileInfoReader|Unable to parse media info from file: /tv/Example/Season 2/Example - S02E08 - Example WEBDL-2160p.mp4
[v4.0.13.2932] FFMpegCore.Exceptions.FFMpegException: ffprobe exited with non-zero exit-code (1 - [mov,mp4,m4a,3gp,3g2,mj2 @ 0x31e36320] moov atom not found
/tv/Example/Season 2/Example - S02E08 - Example WEBDL-2160p.mp4: Invalid data found when processing input)
at FFMpegCore.FFProbe.GetStreamJson(String filePath, Int32 outputCapacity, FFOptions ffOptions)
at NzbDrone.Core.MediaFiles.MediaInfo.VideoFileInfoReader.GetMediaInfo(String filename) in ./Sonarr.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs:line 68
2025-03-01 18:45:08.4|Error|VideoFileInfoReader|Unable to parse media info from file: /tv/Example/Season 2/Example - S02E07 - Thermopylae WEBDL-2160p.mp4
[v4.0.13.2932] FFMpegCore.Exceptions.FFMpegException: ffprobe exited with non-zero exit-code (1 - [mov,mp4,m4a,3gp,3g2,mj2 @ 0x169bc320] moov atom not found
/tv/Example/Season 2/Example - S02E07 - Thermopylae WEBDL-2160p.mp4: Invalid data found when processing input)
at FFMpegCore.FFProbe.GetStreamJson(String filePath, Int32 outputCapacity, FFOptions ffOptions)
at NzbDrone.Core.MediaFiles.MediaInfo.VideoFileInfoReader.GetMediaInfo(String filename) in ./Sonarr.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs:line 68
2025-03-01 18:45:22.7|Error|VideoFileInfoReader|Unable to parse media info from file: /tv/Example/Season 2/Example - S02E07 - Thermopylae WEBDL-2160p.mp4
[v4.0.13.2932] FFMpegCore.Exceptions.FFMpegException: ffprobe exited with non-zero exit-code (1 - [mov,mp4,m4a,3gp,3g2,mj2 @ 0x32fdd320] moov atom not found
/tv/Example/Season 2/Example - S02E07 - Thermopylae WEBDL-2160p.mp4: Invalid data found when processing input)
at FFMpegCore.FFProbe.GetStreamJson(String filePath, Int32 outputCapacity, FFOptions ffOptions)
at NzbDrone.Core.MediaFiles.MediaInfo.VideoFileInfoReader.GetMediaInfo(String filename) in ./Sonarr.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs:line 68
2025-03-01 18:45:28.2|Error|VideoFileInfoReader|Unable to parse media info from file: /tv/Example/Season 2/Example - S02E08 - Example WEBDL-2160p.mp4
[v4.0.13.2932] FFMpegCore.Exceptions.FFMpegException: ffprobe exited with non-zero exit-code (1 - [mov,mp4,m4a,3gp,3g2,mj2 @ 0xd0c2320] moov atom not found
/tv/Example/Season 2/Example - S02E08 - Example WEBDL-2160p.mp4: Invalid data found when processing input)
at FFMpegCore.FFProbe.GetStreamJson(String filePath, Int32 outputCapacity, FFOptions ffOptions)
at NzbDrone.Core.MediaFiles.MediaInfo.VideoFileInfoReader.GetMediaInfo(String filename) in ./Sonarr.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs:line 68
2025-03-01 18:45:55.7|Error|VideoFileInfoReader|Unable to parse media info from file: /tv/Example/Season 2/Example - S02E08 - Example WEBDL-2160p.mp4
[v4.0.13.2932] FFMpegCore.Exceptions.FFMpegException: ffprobe exited with non-zero exit-code (1 - [mov,mp4,m4a,3gp,3g2,mj2 @ 0x30ccd320] moov atom not found
/tv/Example/Season 2/Example - S02E08 - Example WEBDL-2160p.mp4: Invalid data found when processing input)
at FFMpegCore.FFProbe.GetStreamJson(String filePath, Int32 outputCapacity, FFOptions ffOptions)
at NzbDrone.Core.MediaFiles.MediaInfo.VideoFileInfoReader.GetMediaInfo(String filename) in ./Sonarr.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs:line 68
Does the mp4 file work/play? Sonar throwing lots of ffprobe errors and I don't see the final completion information about the conversion finishing, should be some more info on the sma logs after the command is issued