artwork.tmdb: missing video Duration aborts NFO/artwork generation

All your suggestions, requests and ideas for future development
Post Reply
psilly
Posts: 2
Joined: Yesterday, 05:18

artwork.tmdb: missing video Duration aborts NFO/artwork generation

Post by psilly »

When running fn:artwork.tmdb against a Matroska movie containing MPEG-2 video, NFO generation fails when the video stream has no MediaInfo Duration value. The container and audio stream do have duration values, and the movie passes a full FFmpeg decode. No NFO or artwork is produced.

Environment

Debian GNU/Linux 13.6, x86-64. Sanitized output from filebot -script fn:sysinfo on the same host and installation:

Code: Select all

FileBot 5.2.3 (r10990)
JNA Native: 7.0.0
MediaInfo: 26.01
7-Zip-JBinding: 16.02
Tools: fpcalc/1.5.0
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2026-09-10 (r1040)
Groovy: 4.0.28
JRE: OpenJDK Runtime Environment 21.0.3
JVM: OpenJDK 64-Bit Server VM
OS: Linux (amd64)
This diagnostic used a fresh isolated application profile on 2026-09-11, without copying production credentials or settings. Its Script Bundle line describes the diagnostic profile; the cached scripts involved in the failure are identified by their hashes below. License, host-specific paths and resource details are omitted.

Invocation and observed result

The application invoked the following command; only the temporary root path is replaced with a placeholder:

Code: Select all

filebot -script fn:artwork.tmdb /path/to/temporary-metadata-root \
  --q 'Annie Hall (1977)' -non-strict --lang en --log INFO -no-xattr
That root contained Annie Hall (1977) {tmdb-703}/Annie Hall (1977).mkv, a symlink to the input movie. The application removed the temporary symlink after the call.

The corresponding FileBot log ended with:

Code: Select all

Undefined Variable: Cannot invoke method toFloat() on null object
The log modification time was 2026-09-11T03:45:34.959245Z; the application's metadata result was recorded at 03:45:35.305622Z with no generated files.

The process also appears to have returned zero: our application reached a branch that only accepts return code zero. We did not retain the original per-call return-code/stdout/stderr record, so this is an inference from that branch and the saved result, not a separately captured exit-code transcript. Our application should also check for missing outputs; that is a separate issue on our side.

Relevant media information

Read-only inspection using FileBot's bundled libmediainfo.so returned:

Code: Select all

General.Format   = Matroska
General.Duration = 5587515
Video.Format     = MPEG Video
Video.Duration   = <empty>
Video.FrameRate  = <empty>
Video.Width      = 720
Video.Height     = 480
Audio.Format     = AC-3
Audio.Duration   = 5587515
FFprobe reports a container duration of 5587.515 seconds and MPEG-2 video at 30000/1001 fps. A full audio/video decode completed with no error diagnostics.

Suspected failing code and expected behavior

In the cached lib/htpc.groovy, line 429 calls the following while building the movie NFO, before saving the XML:

Code: Select all

duration(s.'Duration'.toFloat().div(60000).round(4))
fetchMovieArtworkAndNfo builds the NFO before fetching artwork, so this exception also prevents artwork generation. artwork.tmdb.groovy wraps that call in tryLogCatch, which appears to explain the apparent successful process exit.

Cached script SHA-256 identifiers:

Code: Select all

lib/htpc.groovy:
c38647483ad858dc7532d55651d95b5f22732a9a0096ec794f223d5849c23233
artwork.tmdb.groovy:
79c16bc6cfe2cc1f4ee1da7a767364696cdf544f6d0614b5f6be3b163f13b2f9
Could the NFO builder handle an absent stream duration by omitting the optional field or using an appropriate fallback, so other metadata and artwork can still be generated? If generation cannot proceed, a clear failure result would also help callers detect it.

This report describes an observed failure and subsequent read-only diagnosis. We have not yet produced a standalone synthetic reproducer or rerun the artwork operation in the fresh diagnostic profile. No movie file is attached.

Codex session ID: 01a08c57-70d6-7bd2-b4dd-84ac5ce47d89
User avatar
rednoah
The Source
Posts: 24671
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: artwork.tmdb: missing video Duration aborts NFO/artwork generation

Post by rednoah »

:?: Can you share the raw MediaInfo table (exported via FileBot) for one of your test files?

:idea: I've added null checks to simply ignore missing video duration values: https://github.com/filebot/scripts/comm ... 1765d4ec86
:idea: Please read the FAQ and How to Request Help.
psilly
Posts: 2
Joined: Yesterday, 05:18

Re: artwork.tmdb: missing video Duration aborts NFO/artwork generation

Post by psilly »

Thanks — here is the raw MediaInfo output exported by FileBot using fn:mediainfo (not the standalone MediaInfo tool). The forum reply form does not offer file attachments, so I have provided the complete table as a plain-text paste:

https://paste.rs/Y4edC

Command used:

Code: Select all

filebot -no-xattr -script fn:mediainfo /path/to/Annie-Hall.mkv --mode raw
The paste contains the complete 397-line output from FileBot 5.2.3 (r10990) / MediaInfoLib 26.01. It shows:

Code: Select all

General Duration : 5587515
Video: no Duration field
Audio Duration : 5587515
The file is Matroska with MPEG-2 video, AC-3 audio, two VobSub subtitle streams, and chapters. FileBot exited 0, and the source file was not modified.
User avatar
rednoah
The Source
Posts: 24671
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: artwork.tmdb: missing video Duration aborts NFO/artwork generation

Post by rednoah »

Alright! We'll keep the sample data here for future reference as well:

Properties: Select all

# General
Count                            : 359
StreamCount                      : 1
StreamKind                       : General
StreamKind/String                : General
StreamKindID                     : 0
UniqueID                         : 249428130972228472661032004804030464715
UniqueID/String                  : 249428130972228472661032004804030464715 (0xBBA61C52FB3CC328A089FE058F8B82CB)
VideoCount                       : 1
AudioCount                       : 1
TextCount                        : 2
MenuCount                        : 1
Video_Format_List                : MPEG Video
Video_Format_WithHint_List       : MPEG Video
Video_Codec_List                 : MPEG Video
Video_Language_List              : en
Audio_Format_List                : AC-3
Audio_Format_WithHint_List       : AC-3
Audio_Codec_List                 : AC-3
Audio_Language_List              : en
Audio_Channels_Total             : 2
Text_Format_List                 : VobSub / VobSub
Text_Format_WithHint_List        : VobSub / VobSub
Text_Codec_List                  : VobSub / VobSub
Text_Language_List               : en / en
Format                           : Matroska
Format/String                    : Matroska
Format/Url                       : https://matroska.org/downloads/windows.html
Format/Extensions                : mkv mk3d mka mks
Format_Commercial                : Matroska
Format_Version                   : Version 2
FileSize                         : 4084175837
FileSize/String                  : 3.80 GiB
FileSize/String1                 : 4 GiB
FileSize/String2                 : 3.8 GiB
FileSize/String3                 : 3.80 GiB
FileSize/String4                 : 3.804 GiB
Duration                         : 5587515
Duration/String                  : 1h 33mn
Duration/String1                 : 1h 33mn 7s 515ms
Duration/String2                 : 1h 33mn
Duration/String3                 : 01:33:07.515
Duration/String5                 : 01:33:07.515
OverallBitRate_Mode              : VBR
OverallBitRate_Mode/String       : VBR
OverallBitRate                   : 5847574
OverallBitRate/String            : 5848 Kbps
IsStreamable                     : Yes
Encoded_Date                     : 2014-01-13 01:28:08 UTC
Encoded_Application              : MakeMKV v1.8.7 win(x64-release)
Encoded_Application/String       : MakeMKV 1.8.7 win(x64-release)
Encoded_Application_Name         : MakeMKV
Encoded_Application_Version      : 1.8.7 win(x64-release)
Encoded_Library                  : libmakemkv v1.8.7 (1.3.0/1.4.1) win(x64-release)
Encoded_Library/String           : libmakemkv 1.8.7 (1.3.0/1.4.1) win(x64-release)
Encoded_Library_Name             : libmakemkv
Encoded_Library_Version          : 1.8.7 (1.3.0/1.4.1) win(x64-release)

# Video
Count                            : 399
StreamCount                      : 1
StreamKind                       : Video
StreamKind/String                : Video
StreamKindID                     : 0
StreamOrder                      : 0
ID                               : 1
ID/String                        : 1
UniqueID                         : 1
Format                           : MPEG Video
Format/String                    : MPEG Video
Format_Commercial                : MPEG-2 Video
Format_Version                   : Version 2
Format_Profile                   : Main@Main
Format_Settings                  : CustomMatrix / BVOP
Format_Settings_BVOP             : Yes
Format_Settings_BVOP/String      : Yes
Format_Settings_Matrix           : Custom
Format_Settings_Matrix/String    : Custom
Format_Settings_Matrix_Data      : 0808080908090B0B0B0B0B0B0D0C0D0D0D0D0D0D0D0D0D0D0D0E0E0E1111110E0E0E0D0D0E0E10101111121312111111111313141414181817171C1C1D222229 / 080808090909090909090A0A0A0A0A0A0A0A0A0A0A0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0C0C0C0C0C0C0C0C0D0D0D0D0C0D0D0D0D0D0E0E0E0E0F0F0F0F0F10
Format_Settings_GOP              : M=3, N=12
InternetMediaType                : video/MPV
CodecID                          : V_MPEG2
CodecID/Info                     : MPEG 1 or 2 Video
CodecID/Url                      : http://ffdshow-tryout.sourceforge.net/
BitRate_Mode                     : VBR
BitRate_Mode/String              : VBR
BitRate                          : 5539207
BitRate/String                   : 5539 Kbps
BitRate_Maximum                  : 9800000
BitRate_Maximum/String           : 9800 Kbps
Width                            : 720
Width/String                     : 720 pixel
Height                           : 480
Height/String                    : 480 pixel
Sampled_Width                    : 720
Sampled_Height                   : 480
PixelAspectRatio                 : 0.889
DisplayAspectRatio               : 1.333
DisplayAspectRatio/String        : 4:3
FrameRate_Mode                   : VFR
FrameRate_Mode/String            : VFR
FrameRate_Num                    : 24000
FrameRate_Den                    : 1001
FrameRate_Original               : 23.976
FrameRate_Original/String        : 23.976 fps
Standard                         : Component
ColorSpace                       : YUV
ChromaSubsampling                : 4:2:0
ChromaSubsampling/String         : 4:2:0
BitDepth                         : 8
BitDepth/String                  : 8 bit
ScanType                         : Progressive
ScanType/String                  : Progressive
ScanOrder                        : 2:3 Pulldown
ScanOrder/String                 : 2:3 Pulldown
Compression_Mode                 : Lossy
Compression_Mode/String          : Lossy
Delay                            : 0
Delay/String3                    : 00:00:00.000
Delay/String5                    : 00:00:00.000
Delay_Source                     : Container
Delay_Source/String              : Container
Delay_Original                   : 3600000
Delay_Original/String            : 1h 0mn
Delay_Original/String1           : 1h 0mn 0s 0ms
Delay_Original/String2           : 1h 0mn
Delay_Original/String3           : 01:00:00.000
Delay_Original/String5           : 01:00:00.000
Delay_Original_Settings          : drop_frame_flag=1 / closed_gop=1 / broken_link=0
Delay_Original_DropFrame         : Yes
Delay_Original_Source            : Stream
TimeCode_FirstFrame              : 01:00:00;00
TimeCode_DropFrame               : Yes
TimeCode_Source                  : Group of pictures header
Gop_OpenClosed                   : Open
Gop_OpenClosed/String            : Open
Gop_OpenClosed_FirstFrame        : Closed
Gop_OpenClosed_FirstFrame/String : Closed
Language                         : en
Language/String                  : en
Language/String1                 : en
Language/String2                 : en
Language/String3                 : eng
Language/String4                 : en
Default                          : No
Default/String                   : No
Forced                           : No
Forced/String                    : No
BufferSize                       : 229376
colour_description_present       : Yes
colour_description_present_Sourc : Stream
colour_primaries                 : BT.601 NTSC
colour_primaries_Source          : Stream
transfer_characteristics         : BT.601
transfer_characteristics_Source  : Stream
matrix_coefficients              : BT.601
matrix_coefficients_Source       : Stream
intra_dc_precision               : 8

# Audio
Count                            : 322
StreamCount                      : 1
StreamKind                       : Audio
StreamKind/String                : Audio
StreamKindID                     : 0
StreamOrder                      : 1
ID                               : 2
ID/String                        : 2
UniqueID                         : 2
Format                           : AC-3
Format/String                    : AC-3
Format/Info                      : Audio Coding 3
Format/Url                       : https://en.wikipedia.org/wiki/AC3
Format_Commercial                : Dolby Digital
Format_Commercial_IfAny          : Dolby Digital
Format_Settings_Endianness       : Big
CodecID                          : A_AC3
Duration                         : 5587515
Duration/String                  : 1h 33mn
Duration/String1                 : 1h 33mn 7s 515ms
Duration/String2                 : 1h 33mn
Duration/String3                 : 01:33:07.515
Duration/String5                 : 01:33:07.515
BitRate_Mode                     : CBR
BitRate_Mode/String              : CBR
BitRate                          : 192000
BitRate/String                   : 192 Kbps
Channel(s)                       : 2
Channel(s)/String                : 2 channel
ChannelPositions                 : Front: L R
ChannelPositions/String2         : 2/0/0
ChannelLayout                    : L R
SamplesPerFrame                  : 1536
SamplingRate                     : 48000
SamplingRate/String              : 48.0 KHz
SamplingCount                    : 268200720
FrameRate                        : 31.250
FrameRate/String                 : 31.250 fps (1536 SPF)
Compression_Mode                 : Lossy
Compression_Mode/String          : Lossy
Delay                            : 18
Delay/String                     : 18ms
Delay/String1                    : 18ms
Delay/String2                    : 18ms
Delay/String3                    : 00:00:00.018
Delay/String5                    : 00:00:00.018
Delay_Source                     : Container
Delay_Source/String              : Container
Video_Delay                      : 18
Video_Delay/String               : 18ms
Video_Delay/String1              : 18ms
Video_Delay/String2              : 18ms
Video_Delay/String3              : 00:00:00.018
Video_Delay/String5              : 00:00:00.018
StreamSize                       : 134100360
StreamSize/String                : 128 MiB (3%)
StreamSize/String1               : 128 MiB
StreamSize/String2               : 128 MiB
StreamSize/String3               : 128 MiB
StreamSize/String4               : 127.9 MiB
StreamSize/String5               : 128 MiB (3%)
StreamSize_Proportion            : 0.03283
Title                            : 2/0
Language                         : en
Language/String                  : en
Language/String1                 : en
Language/String2                 : en
Language/String3                 : eng
Language/String4                 : en
ServiceKind                      : CM
ServiceKind/String               : Complete Main
Default                          : Yes
Default/String                   : Yes
Forced                           : No
Forced/String                    : No
bsid                             : 8
dialnorm                         : -27
dialnorm                         : -27 dB
compr                            : 13.53
compr                            : 13.53 dB
dynrng                           : 13.76
dynrng                           : 13.76 dB
dsurmod                          : 1
dsurmod                          : Not Dolby Surround encoded
acmod                            : 2
lfeon                            : 0
mixlevel                         : 105
mixlevel                         : 105 dB
roomtyp                          : Large
dialnorm_Average                 : -27
dialnorm_Average                 : -27 dB
dialnorm_Minimum                 : -27
dialnorm_Minimum                 : -27 dB
dialnorm_Maximum                 : -27
dialnorm_Maximum                 : -27 dB
dialnorm_Count                   : 834
compr_Average                    : 21.01
compr_Average                    : 21.01 dB
compr_Minimum                    : -0.56
compr_Minimum                    : -0.56 dB
compr_Maximum                    : 23.80
compr_Maximum                    : 23.80 dB
compr_Count                      : 823
dynrng_Average                   : 21.11
dynrng_Average                   : 21.11 dB
dynrng_Minimum                   : -0.56
dynrng_Minimum                   : -0.56 dB
dynrng_Maximum                   : 23.94
dynrng_Maximum                   : 23.94 dB
dynrng_Count                     : 832
SamplingCount_Source             : General_Duration
Duration_Source                  : General_Duration


:arrow: I have pushed a new script jar that should fix the issue. You just need to run filebot -clear-cache once and then the next script call should be using the latest script revision automatically:

Console Output: Select all

$ filebot -script fn:sysinfo
...
Script Bundle: 2026-09-12 (r1042)
...
:idea: Please read the FAQ and How to Request Help.
Post Reply