Closed pomadchin closed 1 year ago
Ouf, I guess this is an mp4 limitation, hm, is it still possible to transcode into mp4 via ffmpeg4j?
To preface this, I have just read up on some of the comments in this SO post:
https://stackoverflow.com/questions/34123272/ffmpeg-transmux-mpegts-to-mp4-gives-error-muxer-does-not-support-non-seekable
Looking at the muxer output error message, I am inclined to believe that there is a compatibility issue between the nature of how ffmpeg4j streams I/O using InputStream/OutputStream, and not extending any seek support into ffmpeg itself. Somewhere in the code-base, I either set or allow seek support to 0
to indicate this to ffmpeg. It probably would be possible to add another sister layer that leverages SeekableByteChannel, etc. Though, one of the main objectives of ffmpeg4j for me was to build a framework that didn't necessarily require seeking, as this project is what I use in https://github.com/Manebot/audio to do a lot of in-memory piping of audio data to listeners on Discord, TS3, etc.
But, for now, I do think that's correct -- given the limitations of MP4 and ffmpeg4j, I don't think this is possible right now.
@Manevolent perfect, thanks for a very quick answer.
Seekable output is now supported and lightly tested for MP4. Refer to new method introduced by commit a6712074388323f02764797b32356c26cd00e5a7:
FFmpegIO.openChannel(SeekableByteChannel, int)
Hello,
I'm trying to read a video file, convert it into another format and keep the output as the
OutputStream
.I've tried to follow README, and the read of the input file part works great.
However, I'm trying to use
Transcoder
and I could not figure out the right way to specify theTargetStream
.And it causes
Transcoder
failure:I've tried to set manually output sub streams:
But it leads to another issue:
Could you guide me into a proper direction? I guess I'm just using the API wrong.