小编Yun*_*Hai的帖子

JavaCV:avformat_open_input() 挂起(不是网络,但带有自定义 AVIOContext)

我正在使用自定义 AVIOContext 将 FFMpeg 与 java IO 桥接。该函数avformat_open_input()永远不会返回。我在网上搜索过类似的问题,都是由网络故障或服务器配置错误引起的。但是,我根本没有使用网络,正如您在以下小程序中看到的那样:

package com.example;

import org.bytedeco.javacpp.*;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import static org.bytedeco.javacpp.avcodec.*;
import static org.bytedeco.javacpp.avformat.*;
import static org.bytedeco.javacpp.avutil.*;
import static org.bytedeco.javacpp.avdevice.*;
import static org.bytedeco.javacpp.avformat.AVFormatContext.*;

public class Test {

    public static void main(String[] args) throws Exception {
        File dir = new File(System.getProperty("user.home"), "Desktop");
        File file = new File(dir, "sample.3gp");
        final RandomAccessFile raf = new RandomAccessFile(file, "r");

        Loader.load(avcodec.class);
        Loader.load(avformat.class);
        Loader.load(avutil.class);
        Loader.load(avdevice.class);
        Loader.load(swscale.class);
        Loader.load(swresample.class);

        avcodec_register_all();
        av_register_all();
        avformat_network_init();
        avdevice_register_all();

        Read_packet_Pointer_BytePointer_int reader = new …
Run Code Online (Sandbox Code Playgroud)

ffmpeg javacv

0
推荐指数
1
解决办法
1392
查看次数

标签 统计

ffmpeg ×1

javacv ×1