【发布时间】:2014-03-03 01:08:49
【问题描述】:
我正在尝试创建一个基于 FFmpeg 的元数据检索器。由于原始 Android 应用程序资源通常只能使用文件描述符访问,因此我需要一种通过 JNI 将这些数据传输到 FFmpeg 的方法。我知道 FFmpeg 支持“管道”协议:
UNIX pipe access protocol.
Allow to read and write from UNIX pipes.
The accepted syntax is:
pipe:[number]
number is the number corresponding to the file descriptor of the pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If number is not specified, by default the stdout file descriptor will be used for writing, stdin for reading.
For example: cat test.wav | ffmpeg -i pipe:0
我的问题是,如何以编程方式模拟 cat test.wav | ffmpeg -i pipe:0 使用 JNI 和 avformat_open_input 使用 FileDescriptor?这可能吗?
【问题讨论】:
-
这个问题怎么样?
-
我不确定我明白你在问什么,你能改写一下这个问题吗?
-
想问如何在Java层创建命名管道,并传递JNI
标签: java android ffmpeg java-native-interface