[FFmpeg-user] Runtime conversion from byte array

Jeff jeff.mihalik at gmail.com
Wed Mar 14 19:45:11 CET 2012


Mike Scheutzow-3 wrote
> 
> Jeff Mihalik wrote:
>> Hello,
>> 
>> I am creating a java project where the goal is to receive byte arrays of
>> mpeg-2 videos from the database and convert them at runtime to mpeg-4
>> videos (also as byte arrays, to pass to another application for display).
>> ffmpeg seems like the right tool for the conversion, but every command
>> line
>> example I have seen takes a file as an input and saves off the output as
>> a
>> file.  I do not have the option of storing the videos on the file
>> structure, hence I have an input of a byte array mpeg-2, and an output of
>> a
>> byte array mpeg-4.  Is it possible to convert from a byte array of an
>> MPEG-2 to a byte array of an MPEG-4 (using java) through ffmpeg, or are
>> real files necessary?  I would try this out for myself, but my company
>> takes weeks to approve new software so I want to determine if it is
>> possible before requesting the software.  Thank you.
>> 
>> -Jeff
> 
> FFmpeg is a big, complex library written in the C language. It includes 
> an application, also called ffmpeg, which makes use of this library.
> 
> Your question is not very clear about whether you would execute the 
> ffmpeg app using java's Runtime.exec(), or access the FFmpeg library at 
> a lower level using the C api.
> 
> What you ask for can be done through the API, but I wouldn't consider it 
> a simple project. It is going to be much more work than simply calling a 
> function from a java class.
> 
> You do not say how much experience you have with the C language, or with 
> the Java Native Interface.
> 
> Also, if you use the API for an application that you distribute/sell, 
> you'll need to obey the licensing requirements (some parts of FFmpeg are 
> LGPL, some are GPL).
> 
> 
> Mike Scheutzow
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user@
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 

I have two years experience with C, and I have experience with JNI as well
so that is a viable option (as well as java's Runtime.exec()).  Whichever
option has the simplest implementation works for me.  I will look through
the C API - are there certain files you could point me to to work with byte
arrays?  Otherwise, if java's Runtime.exec() is simpler, how would it work
with byte arrays?

--
View this message in context: http://ffmpeg-users.933282.n4.nabble.com/Runtime-conversion-from-byte-array-tp4472216p4472791.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.


More information about the ffmpeg-user mailing list