Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • FFmpeg function avformat_open_input for USB video device throws exception : No such file or directory

    8 juin, par ffvideoner

    Windows & C# & FFmpeg.AutoGen

    I used the ffmpeg-function (from library FFmpeg.AutoGen) to show video from rtsp-stream:

    ffmpeg.avformat_open_input(&pFormatContext, "rtsp://127.0.0.1:8554/abc", iformat, null);
    

    It works right.

    Now I want to use this function for USB video device.

    FFmpeg outputs this device name:

    ffmpeg -list_devices true -f dshow -i dummy
    
    [dshow @ 0000000000163000] "GENERAL WEBCAM" (video)
    

    This is how I'm trying to get the video:

    string deviceName = "GENERAL WEBCAM";
    

    or

    string deviceName = "video=GENERAL WEBCAM";
    
    ffmpeg.avformat_open_input(&pFormatContext, deviceName, ffmpeg.av_find_input_format("dshow"), null);
    

    For both variants of device names, I get an error:

    No such file or directory.
    

    But here it works:

    ffmpeg -video_size 1280x720 -framerate 30 -f dshow -i video="GENERAL WEBCAM":audio="Microphone (3- GENERAL WEBCAM)" -c:v libx264 -crf 30 -preset ultrafast ffmpegvideo.mp4
    

    Why doesn't avformat_open_input work with video device name?

  • How to stream from camera to browser using ffmpeg [closed]

    7 juin, par Gabriel Furstenheim

    FFMpeg just merged support for WebRTC.

    If I understand correctly, this should allow to stream directly from ffmpeg to a website without the use of a server.

    How does this work?

    ffmpeg -f dshow -i video=MyCamera ???
    

    I guess something similar to

    I'm guessing something like

    ffmpeg -f dshow -i video=MyCamera -f webrtc udp://localhost:6666
    

    Also, how would the website look like?

    For simplicity, assume that everything happens in localhost

  • FFmpeg/DASH : duration or timestamp out of range for mov/mp4 format [closed]

    7 juin, par mike

    I'm trying to convert a aac stream to dash. The issue is that I get a lot of errors as below(though it seems to segment it into multiple files but I get errors on the player too). The question is why do I get these errors and how can I fix it? If I simply convert "copy" it into to a single mp4 file it works without error.

        ffmpeg -i  "a.mkv" -y -map  0:1 -c:0 copy -min_seg_duration 1000000 
    -use_timeline 1 -use_template 1 -init_seg_name init.mp4s 
    -media_seg_name  "\$Number\$.mp4s" -adaptation_sets "id=1,streams=0"
    -remove_at_exit 0  -f dash -dash 1 
    "out/stream.mpd" -loglevel error 
    

    Output

    [mp4 @ 0x7fbb70819600] Application provided duration: -32 / timestamp: 40475608 is out of range for mov/mp4 format
    [mp4 @ 0x7fbb70819600] Application provided duration: -32 / timestamp: 40764376 is out of range for mov/mp4 format
    [mp4 @ 0x7fbb70819600] Application provided duration: -32 / timestamp: 40860664 is out of range for mov/mp4 format
    [mp4 @ 0x7fbb70819600] Application provided duration: -32 / timestamp: 41149432 is out of range for mov/mp4 format
    [mp4 @ 0x7fbb70819600] Application provided duration: -32 / timestamp: 41390056 is out of range for mov/mp4 format
    [mp4 @ 0x7fbb70819600] Application provided duration: -32 / timestamp: 41823208 is out of range for mov/mp4 format
    

    Copy to a single MP4 works just fine ffmpeg -i "a.mkv" -y -map 0:1 -c:0 copy -f mp4 -dash 1 "out/out.mp4" -loglevel error

    Probe

    ffprobe a.mkv
    ffprobe version 3.4 Copyright (c) 2007-2017 the FFmpeg developers
      built with Apple LLVM version 9.0.0 (clang-900.0.37)
      configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
      libavutil      55. 78.100 / 55. 78.100
      libavcodec     57.107.100 / 57.107.100
      libavformat    57. 83.100 / 57. 83.100
      libavdevice    57. 10.100 / 57. 10.100
      libavfilter     6.107.100 /  6.107.100
      libavresample   3.  7.  0 /  3.  7.  0
      libswscale      4.  8.100 /  4.  8.100
      libswresample   2.  9.100 /  2.  9.100
      libpostproc    54.  7.100 / 54.  7.100
    Input #0, matroska,webm, from 'a.mkv':
      Metadata:
        encoder         : libebml v1.3.1 + libmatroska v1.4.2
        creation_time   : 2017-03-11T02:56:50.000000Z
      Duration: 02:12:52.39, start: 0.000000, bitrate: 740 kb/s
        Chapter #0:0: start 0.000000, end 520.270000
        Metadata:
          title           : 00:00:00.000
        Chapter #0:1: start 520.270000, end 1135.718000
        Metadata:
          title           : 00:08:40.270
        Chapter #0:2: start 1135.718000, end 1703.660000
        Metadata:
          title           : 00:18:55.718
        Chapter #0:3: start 1703.660000, end 2314.187000
        Metadata:
          title           : 00:28:23.660
        Chapter #0:4: start 2314.187000, end 2888.594000
        Metadata:
          title           : 00:38:34.187
        Chapter #0:5: start 2888.594000, end 3499.246000
        Metadata:
          title           : 00:48:08.594
        Chapter #0:6: start 3499.246000, end 4154.692000
        Metadata:
          title           : 00:58:19.246
        Chapter #0:7: start 4154.692000, end 4646.392000
        Metadata:
          title           : 01:09:14.692
        Chapter #0:8: start 4646.392000, end 5373.660000
        Metadata:
          title           : 01:17:26.392
        Chapter #0:9: start 5373.660000, end 5882.085000
        Metadata:
          title           : 01:29:33.660
        Chapter #0:10: start 5882.085000, end 6627.871000
        Metadata:
          title           : 01:38:02.085
        Chapter #0:11: start 6627.871000, end 7144.471000
        Metadata:
          title           : 01:50:27.871
        Chapter #0:12: start 7144.471000, end 7451.944000
        Metadata:
          title           : 01:59:04.471
        Chapter #0:13: start 7451.944000, end 7972.394000
        Metadata:
          title           : 02:04:11.944
        Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709/unknown/unknown, progressive), 720x300 [SAR 1:1 DAR 12:5], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
        Metadata:
          title           : X264
          BPS             : 623765
          BPS-eng         : 623765
          DURATION        : 02:12:52.311000000
          DURATION-eng    : 02:12:52.311000000
          NUMBER_OF_FRAMES: 191144
          NUMBER_OF_FRAMES-eng: 191144
          NUMBER_OF_BYTES : 621606403
          NUMBER_OF_BYTES-eng: 621606403
          _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
          _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
          _STATISTICS_WRITING_DATE_UTC: 2017-03-11 02:56:50
          _STATISTICS_WRITING_DATE_UTC-eng: 2017-03-11 02:56:50
          _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
          _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
        Metadata:
          BPS             : 114797
          BPS-eng         : 114797
          DURATION        : 02:12:52.394000000
          DURATION-eng    : 02:12:52.394000000
          NUMBER_OF_FRAMES: 373706
          NUMBER_OF_FRAMES-eng: 373706
          NUMBER_OF_BYTES : 114401387
          NUMBER_OF_BYTES-eng: 114401387
          _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
          _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
          _STATISTICS_WRITING_DATE_UTC: 2017-03-11 02:56:50
          _STATISTICS_WRITING_DATE_UTC-eng: 2017-03-11 02:56:50
          _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
          _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    

    Shaka debug

    Assertion failed: This should be an update of the last segment in a period
    shaka.media.SegmentIndex.merge @ segment_index.js:153
    shaka.dash.SegmentTemplate.createStream @ segment_template.js:82
    shaka.dash.DashParser.parseRepresentation_ @ dash_parser.js:1080
    shaka.dash.DashParser.parseAdaptationSet_ @ dash_parser.js:978
    shaka.dash.DashParser.parsePeriod_ @ dash_parser.js:722
    shaka.dash.DashParser.parsePeriods_ @ dash_parser.js:626
    shaka.dash.DashParser.processManifest_ @ dash_parser.js:520
    (anonymous) @ dash_parser.js:431
    Promise resolved (async)
    shaka.dash.DashParser.parseManifest_ @ dash_parser.js:430
    (anonymous) @ dash_parser.js:397
    Promise resolved (async)
    shaka.dash.DashParser.requestManifest_ @ dash_parser.js:390
    shaka.dash.DashParser.onUpdate_ @ dash_parser.js:1161
    setTimeout (async)
    shaka.dash.DashParser.setUpdateTimer_ @ dash_parser.js:1209
    (anonymous) @ dash_parser.js:331
    Promise resolved (async)
    shaka.dash.DashParser.start @ dash_parser.js:329
    (anonymous) @ player.js:555
    Promise resolved (async)
    shaka.util.CancelableChain.then @ cancelable_chain.js:72
    shaka.Player.load @ player.js:499
    initPlayer @ ?x=149&y=88&q=http%3A%2F%2Flocalhost%3A8080%2Fmeta%2F%3FbucketID%3D%2FVolumes%2FTV%2FFa%26channelID%3D%2FVolumes%2FTV%26containerID%3D%2FUsers%2F%2Fbrev%%2FL1ZvbHVtZXMvVFYvRmFudGFzdGljLkJlYXN0cy5hbmQuV2hlcmUudG8uRmluZC5UaGVtLjIwMTYuQkRSaXAueDI2NC1TUEFSS1MvYS5ta3Y%2F97M4TS6IqnQ.mpd:392
    463segment_index.js:145 Refusing to rewrite original references on update!
    shaka.media.SegmentIndex.merge @ segment_index.js:145
    shaka.dash.SegmentTemplate.createStream @ segment_template.js:82
    shaka.dash.DashParser.parseRepresentation_ @ dash_parser.js:1080
    shaka.dash.DashParser.parseAdaptationSet_ @ dash_parser.js:978
    shaka.dash.DashParser.parsePeriod_ @ dash_parser.js:722
    shaka.dash.DashParser.parsePeriods_ @ dash_parser.js:626
    shaka.dash.DashParser.processManifest_ @ dash_parser.js:520
    (anonymous) @ dash_parser.js:431
    Promise resolved (async)
    shaka.dash.DashParser.parseManifest_ @ dash_parser.js:430
    (anonymous) @ dash_parser.js:397
    Promise resolved (async)
    shaka.dash.DashParser.requestManifest_ @ dash_parser.js:390
    shaka.dash.DashParser.onUpdate_ @ dash_parser.js:1161
    setTimeout (async)
    shaka.dash.DashParser.setUpdateTimer_ @ dash_parser.js:1209
    (anonymous) @ dash_parser.js:331
    Promise resolved (async)
    shaka.dash.DashParser.start @ dash_parser.js:329
    (anonymous) @ player.js:555
    Promise resolved (async)
    shaka.util.CancelableChain.then @ cancelable_chain.js:72
    shaka.Player.load @ player.js:499
    initPlayer @ ?x=149&y=88&q=http%3A%2F%2Flocalhost%3A8080%2Fmeta%2F%3FbucketID%3D%2FVolumes%2FTV%2FFa%26channelID%3D%2FVolumes%2FTV%26containerID%3D%2FUsers%2F%2Fbrev%%2FL1ZvbHVtZXMvVFYvRmFudGFzdGljLkJlYXN0cy5hbmQuV2hlcmUudG8uRmluZC5UaGVtLjIwMTYuQkRSaXAueDI2NC1TUEFSS1MvYS5ta3Y%2F97M4TS6IqnQ.mpd:392
    
  • How to install pytorch and opencv using a fixed conda channel order ?

    7 juin, par progquester

    Conda creates a pristine environment, configures a fixed channel order, and then starts installing pytorch torchvisioni pytorch-cuda and opencv, and it prompts for dependency conflicts. Do I have to install opencv via pip?

    The same thing happens with python 3.10

    $ conda create -n my_env3.9 python=3.9
    $ conda activate my_env3.9
    $ conda install pytorch torchvision pytorch-cuda=11.8 opencv
    Channels:
     - pytorch
     - nvidia
     - conda-forge
     - defaults
    Platform: linux-64
    Collecting package metadata (repodata.json): done
    Solving environment: failed
    
    LibMambaUnsatisfiableError: Encountered problems while solving:
      - nothing provides libopencv 4.2.0 py36_5 needed by opencv-4.2.0-py36_5
    
    Could not solve for environment specs
    The following packages are incompatible
    ├─ opencv =* * is installable with the potential options
    │  ├─ opencv [4.10.0|4.11.0] would require
    │  │  └─ libopencv [==4.10.0 headless_py310h05fcec3_10|==4.10.0 headless_py310h2251c23_11|...|==4.11.0 qt6_py39hd96f159_602], which requires
    │  │     └─ ffmpeg >=7.1.0,<8.0a0 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv [4.10.0|4.9.0] would require
    │  │  └─ libopencv [==4.10.0 headless_py310h3d4b477_1|==4.10.0 headless_py310hef7d0a5_0|...|==4.9.0 qt6_py39hed63795_614], which requires
    │  │     └─ ffmpeg >=6.1.1,<7.0a0 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv 4.10.0 would require
    │  │  └─ libopencv [==4.10.0 headless_py310h8d94708_2|==4.10.0 headless_py38h5642e36_2|...|==4.10.0 qt6_py39hfd9fb6d_602], which requires
    │  │     └─ ffmpeg >=7.0.1,<8.0a0 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv 4.10.0 would require
    │  │  └─ libopencv [==4.10.0 headless_py310h5bfabb9_4|==4.10.0 headless_py310h5bfabb9_5|...|==4.10.0 qt6_py39hdeb11db_605], which requires
    │  │     └─ ffmpeg >=6.1.2,<7.0a0 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv 4.10.0 would require
    │  │  └─ libopencv [==4.10.0 headless_py311h63eac36_5|==4.10.0 headless_py311h63eac36_6|...|==4.10.0 qt6_py39h5d2977a_603], which requires
    │  │     └─ ffmpeg >=7.0.2,<8.0a0 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv 4.11.0 would require
    │  │  └─ libopencv [==4.11.0 headless_py310h8ace835_4|==4.11.0 headless_py310h8ace835_5|...|==4.11.0 qt6_py39hbfaaa73_603], which requires
    │  │     └─ ffmpeg >=7.1.1,<8.0a0 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv [4.5.3|4.5.5|4.6.0] would require
    │  │  └─ libopencv [==4.5.3 py310hc72b5f5_8|==4.5.3 py38hc6b509d_8|...|==4.6.0 py39hf4bb9d8_2], which requires
    │  │     └─ ffmpeg >=4.4.2,<5.0a0 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv [4.6.0|4.7.0] would require
    │  │  └─ libopencv [==4.6.0 py310h5bd1119_9|==4.6.0 py310h6214075_5|...|==4.7.0 py39hf99ad11_5], which requires
    │  │     └─ ffmpeg >=5.1.2,<6.0a0 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv [4.7.0|4.8.0|4.8.1] would require
    │  │  └─ libopencv [==4.7.0 py310h245f934_4|==4.7.0 py310h3e876cf_5|...|==4.8.1 py39hf605482_5], which requires
    │  │     └─ ffmpeg >=6.0.0,<7.0a0 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv 4.9.0 would require
    │  │  └─ libopencv [==4.9.0 headless_py310hae237af_14|==4.9.0 headless_py38h0f7b093_14|...|==4.9.0 qt6_py39h067c833_615], which requires
    │  │     └─ ffmpeg >=7.0.0,<8.0a0 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv [2.4.12|2.4.13|3.1.0|3.2.0] would require
    │  │  └─ python =2.7 *, which can be installed;
    │  ├─ opencv [2.4.13.4|3.2.0|3.3.0|3.4.1] would require
    │  │  └─ ffmpeg >=3.2.3,<3.2.6 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv 3.1.0 would require
    │  │  └─ python =3.4 *, which can be installed;
    │  ├─ opencv [3.1.0|3.2.0] would require
    │  │  └─ python =3.5 *, which can be installed;
    │  ├─ opencv [3.1.0|3.2.0] would require
    │  │  └─ python =3.6 *, which can be installed;
    │  ├─ opencv [3.4.1|3.4.3|3.4.4|3.4.7] would require
    │  │  ├─ ffmpeg >=4.0.2,<4.1.0a0 *, which conflicts with any installable versions previously reported;
    │  │  └─ libopencv ==3.4.7 hc173e35_5, which requires
    │  │     └─ ffmpeg >=4.0.2,<4.1.0a0 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv 3.4.1 would require
    │  │  └─ ffmpeg >=4.0.1,<4.1.0a0 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv [3.4.4|3.4.7|...|4.1.1] would require
    │  │  ├─ ffmpeg =4.1 *, which conflicts with any installable versions previously reported;
    │  │  └─ libopencv [==3.4.7 h0cc45ee_4|==4.1.1 h0cc45ee_3], which requires
    │  │     └─ ffmpeg =4.1 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv [3.4.7|3.4.8|...|4.2.0] would require
    │  │  └─ libopencv [==3.4.7 h32d60f7_6|==3.4.7 py27_7|...|==4.2.0 py38_4], which requires
    │  │     └─ ffmpeg >=4.1.3,<4.2.0a0 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv 4.2.0 would require
    │  │  └─ libopencv ==4.2.0 py36_5, which does not exist (perhaps a missing channel);
    │  ├─ opencv [4.2.0|4.3.0|4.4.0] would require
    │  │  └─ py-opencv [==4.2.0 py36h0b673f9_6|==4.3.0 py36h0b673f9_2|==4.4.0 py36h0b673f9_2], which requires
    │  │     └─ python >=3.6,<3.7.0a0 *, which can be installed;
    │  ├─ opencv [4.2.0|4.3.0] would require
    │  │  └─ libopencv [==4.2.0 py36_7|==4.2.0 py37_7|...|==4.3.0 py38_1], which requires
    │  │     └─ ffmpeg >=4.2.3,<4.3.0a0 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv [4.2.0|4.3.0|4.4.0] would require
    │  │  └─ py-opencv [==4.2.0 py37h43977f1_5|==4.2.0 py37h43977f1_6|==4.3.0 py37h43977f1_2|==4.4.0 py37h43977f1_2], which requires
    │  │     └─ python >=3.7,<3.8.0a0 *, which can be installed;
    │  ├─ opencv [4.2.0|4.3.0|4.4.0] would require
    │  │  └─ py-opencv [==4.2.0 py38h23f93f0_5|==4.2.0 py38h23f93f0_6|==4.3.0 py38h23f93f0_2|==4.4.0 py38h23f93f0_2], which requires
    │  │     └─ python >=3.8,<3.9.0a0 *, which can be installed;
    │  ├─ opencv [4.4.0|4.5.0|4.5.1|4.5.2] would require
    │  │  └─ libopencv [==4.4.0 py36_3|==4.4.0 py37_3|...|==4.5.2 py39h70bf20d_1], which requires
    │  │     └─ ffmpeg >=4.3.1,<4.4.0a0 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv 4.5.0 would require
    │  │  └─ libopencv ==4.5.0 py36_5, which does not exist (perhaps a missing channel);
    │  ├─ opencv 4.5.0 would require
    │  │  └─ libopencv ==4.5.0 py36_6, which does not exist (perhaps a missing channel);
    │  ├─ opencv [4.5.3|4.5.5] would require
    │  │  └─ libopencv [==4.5.3 py31hbd5a65a_6|==4.5.3 py31he7a5e20_7|...|==4.5.5 py39hfb30bf4_6], which requires
    │  │     └─ ffmpeg >=4.3.2,<4.4.0a0 *, which conflicts with any installable versions previously reported;
    │  ├─ opencv 4.5.5 would require
    │  │  └─ libopencv [==4.5.5 py310h1897127_9|==4.5.5 py310hc83fb77_10|...|==4.5.5 py39he64e9e9_10], which requires
    │  │     └─ ffmpeg >=4.4.1,<5.0a0 *, which conflicts with any installable versions previously reported;
    │  └─ opencv [3.3.1|3.4.1|...|4.6.0] conflicts with any installable versions previously reported;
    └─ pin on python 3.9.* =* * is not installable because it requires
       └─ python =3.9 *, which conflicts with any installable versions previously reported.
    
    Pins seem to be involved in the conflict. Currently pinned specs:
     - python=3.9
    
  • How to solve javacv ExceptionInInitializerError [closed]

    6 juin, par shihui wei

    I want to combine multiple images into a gif. I chose ffmpeg. I learned that there are binary dependencies including ffmpeg in java, so I chose javacv

    First, I added the dependency of javacv to my pom file:

            
                org.bytedeco
                javacv-platform
                1.5.11
            
    

    Then I wrote a code to synthesize GIF from multiple images.

    public static byte[] encodeGif(List frames, int frameDelayMs, boolean loopForever) {
    
            if (frames == null || frames.isEmpty()) {
                throw new IllegalArgumentException("frames 不能为空");
            }
            int width = frames.get(0).getWidth();
            int height = frames.get(0).getHeight();
    
            // ByteArrayOutputStream + FFmpegFrameRecorder
            try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
                
                try (FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(baos, width, height)) {
                    recorder.setFormat("gif");
                    recorder.setFrameRate(1000.0 / frameDelayMs);
    
                    recorder.setOption("loop", loopForever ? "0" : "1");
    
                    recorder.start();
    
                    Java2DFrameConverter converter = new Java2DFrameConverter();
                    for (BufferedImage img : frames) {
                        // 把 BufferedImage 转成 Frame
                        Frame frame = converter.convert(img);
                        recorder.record(frame);
                    }
    
                    recorder.stop();
                }
                return baos.toByteArray();
            } catch (Exception e) {
                log.error("FastGifUtil.encodeGif 失败", e);
                throw new RuntimeException("生成 GIF 失败", e);
            }
    
        }
    

    Finally, I have prepared data to test, Below is my test code:

        public void testGenerateGif() {
            log.info(">>>>>>>>>>> start get bufferedImage <<<<<<<<<<<<");
            List bufferedImages = batchTaskUtils.batchIOTask(urls, url -> {
                byte[] byteData = imageClientUtils.byteData(url);
                return OpencvUtils.byteToBufferedImage(byteData);
            });
            log.info(">>>>>>>>>>> start generate gif <<<<<<<<<<<<");
            long time = System.currentTimeMillis();
            byte[] bytes = GifUtils.encodeGif(bufferedImages, 50, true);
            log.info("{}", System.currentTimeMillis() - time);
            log.info(">>>>>>>>>>> start upload gif <<<<<<<<<<<<");
            String upload = upload(bytes);
            log.info("{}", upload);
    
        }
    

    However, I encountered a difficult problem: I cannot load the FFmpegFrameRecorder class. The exception error is:

    java.lang.ExceptionInInitializerError
        at org.bytedeco.javacv.FFmpegFrameRecorder.(FFmpegFrameRecorder.java:356)
        at com.kuaishou.qa.utils.GifUtils.encodeGif(GifUtils.java:29)
        at com.kuaishou.qa.AnimationDiffTest.testGenerateGif(AnimationDiffTest.java:88)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)