I'm trying to create a metadata retriever based on FFmpeg. Since raw Android application resources are often only accessible using a file descriptor I need a way to pipe this data to FFmpeg via JNI. I know FFmpeg supports a "pipe" protocol:
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
My question is, how do I programmatically emulate cat test.wav | ffmpeg -i pipe:0
using JNI and avformat_open_input using a FileDescriptor? Is this possible?