bramp / ffmpeg-cli-wrapper

Java wrapper around the FFmpeg command line tool
BSD 2-Clause "Simplified" License
1.71k stars 411 forks source link

use ffrpobe get NumberFormatException #356

Open ChenYangY opened 5 hours ago

ChenYangY commented 5 hours ago

when i use ffrpobe to get media infomation, the ecxception occurs.

here is the exception stack:

image

code is simple:

FFprobe ffprobe = new FFprobe("/usr/local/opt/ffmpeg@5/bin/ffprobe");
FFmpegProbeResult probeResult = ffprobe.probe(filePath);

environment:


 jdk 1.8
net.bramp.ffmpeg ffmpeg  0.8.0

ffprobe 5.1.6

system: MacOS 12.7

execute command

ffprobe ${fileUrl} -show_streams -select_streams v -print_format json
"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,
                "captions": 0,
                "descriptions": 0,
                "metadata": 0,
                "dependent": 0,
                "still_image": 0
            },
            "tags": {
                "creation_time": "2024-02-27T04:24:08.000000Z",
                "language": "und",
                "handler_name": "\fVideoHandler",
                "vendor_id": "[0][0][0][0]",
                "encoder": "h264"
            },
            "side_data_list": [
                {
                    "side_data_type": "Display Matrix",
                    "displaymatrix": "\n00000000:            0           0           0\n00000001:            0           0           0\n00000002:            0           0  1073741824\n",
                    "rotation": -9223372036854775808
                }
            ]
        }

i tried use 0.6.2, this is ok

bramp commented 4 hours ago

I think in 0.6.2 we didn't parse side_data_list. Now we are there is clearly an issue handling the rotation field. I'm not sure what "rotation": -9223372036854775808 is meant to represent. An actual rotation of that? A corrupt value? Or some indication of no value?

Either way, happy to accept pull requests to fix.