MediaBrowser / Emby

Emby Server is a personal media server with apps on just about every device.
https://emby.media
GNU General Public License v2.0
4.2k stars 811 forks source link

[BUG] FFProbe: StartIndex cannot be less than zero #2324

Closed karbowiak closed 7 years ago

karbowiak commented 7 years ago
2016-12-03 18:05:54.4208 Error App: Error in ffprobe
        *** Error Report ***
        Version: 3.1.6181.14901
        Command line: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe -programdata /var/lib/emby-server -restartpath /usr/lib/emby-server/restart.sh
        Operating system: Unix 4.8.0.28
        64-Bit OS: True
        64-Bit Process: True
        Mono: 4.6.2 (Stable 4.6.2.7/08fd525 Mon Nov 28 20:04:50 UTC 2016)
        Processor count: 4
        Program data path: /var/lib/emby-server
        Application directory: /usr/lib/emby-server/bin
        System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
        Parameter name: startIndex
          at System.String.Substring (System.Int32 startIndex, System.Int32 length) [0x00016] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.String.Substring (System.Int32 startIndex) [0x00008] in <8f2c484307284b51944a1a13a14c0266>:0
          at MediaBrowser.MediaEncoding.Probing.ProbeResultNormalizer.FetchFromItunesInfo (System.String xml, MediaBrowser.Model.MediaInfo.MediaInfo info) [0x0000d] in <860d259c10884cdebeb3e90d8a082ede>:0
          at MediaBrowser.MediaEncoding.Probing.ProbeResultNormalizer.GetMediaInfo (MediaBrowser.MediaEncoding.Probing.InternalMediaInfoResult data, MediaBrowser.Model.Entities.VideoType videoType, System.Boolean isAudio, System.String path, MediaBrowser.Model.MediaInfo.MediaProtocol protocol) [0x0041a] in <860d259c10884cdebeb3e90d8a082ede>:0
          at MediaBrowser.MediaEncoding.Encoder.MediaEncoder+<GetMediaInfoInternal>c__async2.MoveNext () [0x002fa] in <860d259c10884cdebeb3e90d8a082ede>:0
        --- End of stack trace from previous location where exception was thrown ---
          at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
          at MediaBrowser.Providers.MediaInfo.FFProbeVideoInfo+<GetMediaInfo>c__async1.MoveNext () [0x00102] in <725282b36c104899b6d46d5f6595b80f>:0
        --- End of stack trace from previous location where exception was thrown ---
          at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
          at MediaBrowser.Providers.MediaInfo.FFProbeVideoInfo+<ProbeVideo>c__async0`1[T].MoveNext () [0x00321] in <725282b36c104899b6d46d5f6595b80f>:0
        --- End of stack trace from previous location where exception was thrown ---
          at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
          at MediaBrowser.Providers.Manager.MetadataService`2+<RunCustomProvider>c__async7[TItemType,TIdType].MoveNext () [0x000db] in <725282b36c104899b6d46d5f6595b80f>:0
        System.ArgumentOutOfRangeException
          at System.String.Substring (System.Int32 startIndex, System.Int32 length) [0x00016] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.String.Substring (System.Int32 startIndex) [0x00008] in <8f2c484307284b51944a1a13a14c0266>:0
          at MediaBrowser.MediaEncoding.Probing.ProbeResultNormalizer.FetchFromItunesInfo (System.String xml, MediaBrowser.Model.MediaInfo.MediaInfo info) [0x0000d] in <860d259c10884cdebeb3e90d8a082ede>:0
          at MediaBrowser.MediaEncoding.Probing.ProbeResultNormalizer.GetMediaInfo (MediaBrowser.MediaEncoding.Probing.InternalMediaInfoResult data, MediaBrowser.Model.Entities.VideoType videoType, System.Boolean isAudio, System.String path, MediaBrowser.Model.MediaInfo.MediaProtocol protocol) [0x0041a] in <860d259c10884cdebeb3e90d8a082ede>:0
          at MediaBrowser.MediaEncoding.Encoder.MediaEncoder+<GetMediaInfoInternal>c__async2.MoveNext () [0x002fa] in <860d259c10884cdebeb3e90d8a082ede>:0
        --- End of stack trace from previous location where exception was thrown ---
          at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
          at MediaBrowser.Providers.MediaInfo.FFProbeVideoInfo+<GetMediaInfo>c__async1.MoveNext () [0x00102] in <725282b36c104899b6d46d5f6595b80f>:0
        --- End of stack trace from previous location where exception was thrown ---
          at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
          at MediaBrowser.Providers.MediaInfo.FFProbeVideoInfo+<ProbeVideo>c__async0`1[T].MoveNext () [0x00321] in <725282b36c104899b6d46d5f6595b80f>:0
        --- End of stack trace from previous location where exception was thrown ---
          at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0
          at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
          at MediaBrowser.Providers.Manager.MetadataService`2+<RunCustomProvider>c__async7[TItemType,TIdType].MoveNext () [0x000db] in <725282b36c104899b6d46d5f6595b80f>:0

Seems that ffprobe is having an issue returning data appropriately for Emby. Here's the ffprobe output for the video in question

Command: ffprobe -v quiet -print_format json -show_format -show_streams /mnt/storage/Movies/Foreign/Source\ Code\ (2011)/Source\ Code\ (2011).mp4

{
    "streams": [
        {
            "index": 0,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "High",
            "codec_type": "video",
            "codec_time_base": "12769642/612331017",
            "codec_tag_string": "avc1",
            "codec_tag": "0x31637661",
            "width": 1280,
            "height": 720,
            "coded_width": 1280,
            "coded_height": 720,
            "has_b_frames": 2,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "16:9",
            "pix_fmt": "yuv420p",
            "level": 41,
            "chroma_location": "left",
            "refs": 1,
            "is_avc": "true",
            "nal_length_size": "4",
            "r_frame_rate": "24000/1001",
            "avg_frame_rate": "2145392000/89480647",
            "time_base": "1/16000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 89480656,
            "duration": "5592.541000",
            "bit_rate": "5199126",
            "bits_per_raw_sample": "8",
            "nb_frames": "134087",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "language": "eng",
                "handler_name": "VideoHandler"
            }
        },
        {
            "index": 1,
            "codec_name": "aac",
            "codec_long_name": "AAC (Advanced Audio Coding)",
            "profile": "LC",
            "codec_type": "audio",
            "codec_time_base": "1/48000",
            "codec_tag_string": "mp4a",
            "codec_tag": "0x6134706d",
            "sample_fmt": "fltp",
            "sample_rate": "48000",
            "channels": 2,
            "channel_layout": "stereo",
            "bits_per_sample": 0,
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/48000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 268445136,
            "duration": "5592.607000",
            "bit_rate": "255997",
            "max_bit_rate": "256000",
            "nb_frames": "262155",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "language": "eng",
                "handler_name": "SoundHandler"
            }
        },
        {
            "index": 2,
            "codec_name": "ac3",
            "codec_long_name": "ATSC A/52A (AC-3)",
            "codec_type": "audio",
            "codec_time_base": "1/48000",
            "codec_tag_string": "ac-3",
            "codec_tag": "0x332d6361",
            "sample_fmt": "fltp",
            "sample_rate": "48000",
            "channels": 6,
            "channel_layout": "5.1(side)",
            "bits_per_sample": 0,
            "dmix_mode": "-1",
            "ltrt_cmixlev": "-1.000000",
            "ltrt_surmixlev": "-1.000000",
            "loro_cmixlev": "-1.000000",
            "loro_surmixlev": "-1.000000",
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/48000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 268445904,
            "duration": "5592.623000",
            "bit_rate": "640000",
            "nb_frames": "174769",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "language": "eng",
                "handler_name": "SoundHandler"
            },
            "side_data_list": [
                {
                    "side_data_type": "Audio Service Type",
                    "side_data_size": 4
                }
            ]
        },
        {
            "index": 3,
            "codec_name": "mov_text",
            "codec_long_name": "MOV text",
            "codec_type": "subtitle",
            "codec_time_base": "0/1",
            "codec_tag_string": "tx3g",
            "codec_tag": "0x67337874",
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/1000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 5592629,
            "duration": "5592.629000",
            "bit_rate": "66",
            "nb_frames": "2337",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "language": "eng",
                "handler_name": "SubtitleHandler"
            }
        },
        {
            "index": 4,
            "codec_name": "mov_text",
            "codec_long_name": "MOV text",
            "codec_type": "subtitle",
            "codec_time_base": "0/1",
            "codec_tag_string": "tx3g",
            "codec_tag": "0x67337874",
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/1000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 5592629,
            "duration": "5592.629000",
            "bit_rate": "30",
            "nb_frames": "1053",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "language": "dan",
                "handler_name": "SubtitleHandler"
            }
        },
        {
            "index": 5,
            "codec_name": "mjpeg",
            "codec_long_name": "Motion JPEG",
            "codec_type": "video",
            "codec_time_base": "0/1",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",
            "width": 500,
            "height": 750,
            "coded_width": 500,
            "coded_height": 750,
            "has_b_frames": 0,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "2:3",
            "pix_fmt": "yuvj420p",
            "level": -99,
            "color_range": "pc",
            "color_space": "bt470bg",
            "chroma_location": "center",
            "refs": 1,
            "r_frame_rate": "90000/1",
            "avg_frame_rate": "0/0",
            "time_base": "1/90000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 503336610,
            "duration": "5592.629000",
            "bits_per_raw_sample": "8",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 1,
                "timed_thumbnails": 0
            }
        }
    ],
    "format": {
        "filename": "/mnt/storage/Movies/Foreign/Source Code (2011)/Source Code (2011).mp4",
        "nb_streams": 6,
        "nb_programs": 0,
        "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
        "format_long_name": "QuickTime / MOV",
        "start_time": "0.000000",
        "duration": "5592.629000",
        "size": "4269785404",
        "bit_rate": "6107732",
        "probe_score": 100,
        "tags": {
            "major_brand": "isom",
            "minor_version": "512",
            "compatible_brands": "isomiso2avc1mp41",
            "title": "Source Code",
            "genre": "Thriller",
            "date": "2011-03-30",
            "encoder": "MDH:Source Code (2011).mp4",
            "iTunEXTC": "m",
            "iTunMOVI": "<",
            "media_type": "9",
            "hd_video": "1",
            "description": "Make Every Second Count",
            "synopsis": "Decorated soldier Captain Colter Stevens wakes up in the body of an unknown man, discovering he's involved in a mission to find the bomber of a Chicago commuter train. He learns he's part of a top-secret experimental program that enables him to experience the final 8 minutes of another person's life. Colter re-lives the train incident over and over again, gathering more clues each time. But can he discover who is responsible for the attack before the next one happens?"
        }
    }
}
LukePulverenti commented 7 years ago

Thanks, resolved for next release.