Quantcast

java call ffmpeg

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

java call ffmpeg

Laurent Kappler
Hi,

Is there a way to call ffmpeg library, installed on the same server as
red5, using my own java application ?
The goal is to encode flv audio to wav

thanks
Laurent

_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

Daniel Rossi-2
Ive setup something before to call an externa. C# script which interfaces with the ffmpeg library to grab screenshots of recorded files when publishing is finished. Use 

 Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("ffmpeg");
 
or something like that

On 07/03/2008, at 10:28 AM, laurent wrote:

Hi,

Is there a way to call ffmpeg library, installed on the same server as
red5, using my own java application ?
The goal is to encode flv audio to wav

thanks
Laurent

_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org


_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

ptamilar
If its a dll or shared library you can load it into the Java app using System.loadLibrary and then use JNI to call into it's functions.

Dan Rossi wrote:
Ive setup something before to call an externa. C# script which interfaces with the ffmpeg library to grab screenshots of recorded files when publishing is finished. Use 

 Runtime rt = Runtime.getRuntime();
  
Process proc = rt.exec("ffmpeg");
 
or something like that

On 07/03/2008, at 10:28 AM, laurent wrote:

Hi,

Is there a way to call ffmpeg library, installed on the same server as
red5, using my own java application ?
The goal is to encode flv audio to wav

thanks
Laurent

_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org


_______________________________________________ Red5 mailing list [hidden email] http://osflash.org/mailman/listinfo/red5_osflash.org

--

 
next generation web conferencing
Prabhu Tamilarasan
Senior Software Engineer
675 Bering Drive, Suite 290
Houston, TX 77057 USA
www.omnovia.com
[hidden email] T +1.281.500.4065 x 731


_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

Daniel Rossi-2

On 07/03/2008, at 11:10 AM, Prabhu Tamilarasan (omNovia) wrote:

> If its a dll or shared library you can load it into the Java app  
> using System.loadLibrary and then use JNI to call into it's functions.

Thats also pretty interesting, never tried that though. Actually i  
think i gave up with the ffmpeg C# library because it required to  
build in vc++ and didnt compile properly actually, so i called ffmpeg  
via the script but needed to grab stills at random intervals.

>

_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

Laurent Kappler
In reply to this post by ptamilar

hm on linux gentoo I installed ffmpeg.... I don't know what is a shared
library (yet)

Process proc = rt.exec("ffmpeg");

this looks like exec call in php, I'm looking for the same solution in
java, like exec("ffmpeg -b blabla -blabl") //A command line for ffmpeg
and wait for results

Apparently it seems far more complicated than I though, thinking
everyone using red5 would need to call ffmpeg in a while.

@Prabhu, you mean I could call ffmpeg and send it parameters using
System.loadLibrary ?

L





Prabhu Tamilarasan (omNovia) a écrit :

> If its a dll or shared library you can load it into the Java app using
> System.loadLibrary and then use JNI to call into it's functions.
>
> Dan Rossi wrote:
>> Ive setup something before to call an externa. C# script which
>> interfaces with the ffmpeg library to grab screenshots of recorded
>> files when publishing is finished. Use
>>
>>
>>  Runtime rt = Runtime.getRuntime();
>>  
>>
>>
>> Process proc = rt.exec("ffmpeg");
>>  
>> or something like that
>>
>> On 07/03/2008, at 10:28 AM, laurent wrote:
>>
>>> Hi,
>>>
>>> Is there a way to call ffmpeg library, installed on the same server as
>>> red5, using my own java application ?
>>> The goal is to encode flv audio to wav
>>>
>>> thanks
>>> Laurent
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> [hidden email] <mailto:[hidden email]>
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Red5 mailing list
>> [hidden email]
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>  
>
> --
> ------------------------------------------------------------------------
>  
> next generation web conferencing
> Prabhu Tamilarasan
> Senior Software Engineer 675 Bering Drive, Suite 290
> Houston, TX 77057 USA
> www.omnovia.com
> [hidden email] T +1.281.500.4065 x 731
>
> ------------------------------------------------------------------------
> ------------------------------------------------------------------------
>
> _______________________________________________
> Red5 mailing list
> [hidden email]
> http://osflash.org/mailman/listinfo/red5_osflash.org
>  


_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

Dominick Accattato
In reply to this post by ptamilar
http://red5server.com/forum/posts/list/19.page

please see the example by Adam Proctor "FFMpeg with Red5"

Additionally, our group Infrared5 has built applications using FFMpeg so if you are in need of professional services, feel free to contact our group (www.infrared5.com)


On Mar 6, 2008, at 7:10 PM, Prabhu Tamilarasan (omNovia) wrote:

If its a dll or shared library you can load it into the Java app using System.loadLibrary and then use JNI to call into it's functions.

Dan Rossi wrote:
Ive setup something before to call an externa. C# script which interfaces with the ffmpeg library to grab screenshots of recorded files when publishing is finished. Use 

 Runtime rt = Runtime.getRuntime();  
Process proc = rt.exec("ffmpeg");
 
or something like that

On 07/03/2008, at 10:28 AM, laurent wrote:

Hi,

Is there a way to call ffmpeg library, installed on the same server as
red5, using my own java application ?
The goal is to encode flv audio to wav

thanks
Laurent

_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org


_______________________________________________ Red5 mailing list [hidden email] http://osflash.org/mailman/listinfo/red5_osflash.org

--

  <mailicon.gif>
next generation web conferencing
Prabhu Tamilarasan
Senior Software Engineer
675 Bering Drive, Suite 290
Houston, TX 77057 USA
www.omnovia.com
[hidden email] T +1.281.500.4065 x 731

_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org


_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

Daniel Rossi-2
In reply to this post by Laurent Kappler

On 07/03/2008, at 12:10 PM, laurent wrote:

>
> hm on linux gentoo I installed ffmpeg.... I don't know what is a  
> shared
> library (yet)

.dll is a windows thing, .so is a unix thing :)

>
>
> Process proc = rt.exec("ffmpeg");
>
> this looks like exec call in php, I'm looking for the same solution in
> java, like exec("ffmpeg -b blabla -blabl") //A command line for ffmpeg
> and wait for results

Thats exactly what it is, though i think you have to add arguments  
somewhere else.

I think its this

> Process proc = rt.exec(new String[] {"ffmpeg", "-b blabla","-blabl"});

_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

Laurent Kappler
In reply to this post by Dominick Accattato

That mean I will have to use a php solution to encode the flv to à mp3 file.

If by professional you mean involving money, I won't be able to contact
your super amazing team....it's quite some names you have there...I bet
you can build it! :)

...I'm looking for free information to make it work. I guess if php can
do it java should too.

But I'm interested by your applications using ffmpeg, I have not seen
anything about it on infrared5.com. Do you have online ... stuff about it ?

Thank you
Laurent

Dominick Accattato a écrit :

> http://red5server.com/forum/posts/list/19.page
>
> please see the example by Adam Proctor "FFMpeg with Red5"
>
> Additionally, our group Infrared5 has built applications using FFMpeg
> so if you are in need of professional services, feel free to contact
> our group (www.infrared5.com)
>
>
> On Mar 6, 2008, at 7:10 PM, Prabhu Tamilarasan (omNovia) wrote:
>
>> If its a dll or shared library you can load it into the Java app
>> using System.loadLibrary and then use JNI to call into it's functions.
>>
>> Dan Rossi wrote:
>>> Ive setup something before to call an externa. C# script which
>>> interfaces with the ffmpeg library to grab screenshots of recorded
>>> files when publishing is finished. Use
>>>
>>>  Runtime rt = Runtime.getRuntime();  
>>> Process proc = rt.exec("ffmpeg");
>>>  
>>> or something like that
>>>
>>> On 07/03/2008, at 10:28 AM, laurent wrote:
>>>
>>>> Hi,
>>>>
>>>> Is there a way to call ffmpeg library, installed on the same server as
>>>> red5, using my own java application ?
>>>> The goal is to encode flv audio to wav
>>>>
>>>> thanks
>>>> Laurent
>>>>
>>>> _______________________________________________
>>>> Red5 mailing list
>>>> [hidden email] <mailto:[hidden email]>
>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> [hidden email]
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>  
>>
>> --
>> ------------------------------------------------------------------------
>>   <mailicon.gif>
>> next generation web conferencing
>> Prabhu Tamilarasan
>> Senior Software Engineer 675 Bering Drive, Suite 290
>> Houston, TX 77057 USA
>> www.omnovia.com
>> [hidden email] T +1.281.500.4065 x 731
>>
>> ------------------------------------------------------------------------
>> _______________________________________________
>> Red5 mailing list
>> [hidden email]
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Red5 mailing list
> [hidden email]
> http://osflash.org/mailman/listinfo/red5_osflash.org
>  


_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

Laurent Kappler
In reply to this post by Daniel Rossi-2

yep, I won't forget that time where I had missing dlls.....so is more :)

I'm not sure if I understand....there's two solutions with java then:

Runtime rt = Runtime.getRuntime();
rt.exec("ffmpeg", "params", "params");

or

System.loadLibrary("what here ?")

They are very different, perhaps the first one is the most appropriate for my installed ffmpeg ? or not ?


L




Dan Rossi a écrit :

> On 07/03/2008, at 12:10 PM, laurent wrote:
>
>  
>> hm on linux gentoo I installed ffmpeg.... I don't know what is a  
>> shared
>> library (yet)
>>    
>
> .dll is a windows thing, .so is a unix thing :)
>  

>  
>> Process proc = rt.exec("ffmpeg");
>>
>> this looks like exec call in php, I'm looking for the same solution in
>> java, like exec("ffmpeg -b blabla -blabl") //A command line for ffmpeg
>> and wait for results
>>    
>
> Thats exactly what it is, though i think you have to add arguments  
> somewhere else.
>
> I think its this
>
>  
>> Process proc = rt.exec(new String[] {"ffmpeg", "-b blabla","-blabl"});
>>    
>
> _______________________________________________
> Red5 mailing list
> [hidden email]
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
>  


_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

Daniel Rossi-2
In reply to this post by Laurent Kappler
No it can be done directly in your webapp using the example code I just gave you. So you call that on the recordstop or publishstop stream events in the webapp. 

The php looks like a very basic raw function non OO method example of encoding uploaded mp3 files to flv or the other way round not sure. I think you need some other method also from decoding recorded flv which uses nellymoser back to another format, unless they were encoded with mp3 audio I guess. And I don't see much point transcoding back to wav seeing its a lossless format, unless you wanted the AAC soundtrack of an mpeg4 clip to wav of course. 

On 07/03/2008, at 1:05 PM, laurent wrote:


That mean I will have to use a php solution to encode the flv to à mp3 file.

If by professional you mean involving money, I won't be able to contact
your super amazing team....it's quite some names you have there...I bet
you can build it! :)

...I'm looking for free information to make it work. I guess if php can
do it java should too.

But I'm interested by your applications using ffmpeg, I have not seen
anything about it on infrared5.com. Do you have online ... stuff about it ?

Thank you
Laurent

Dominick Accattato a écrit :
http://red5server.com/forum/posts/list/19.page

please see the example by Adam Proctor "FFMpeg with Red5"

Additionally, our group Infrared5 has built applications using FFMpeg
so if you are in need of professional services, feel free to contact
our group (www.infrared5.com)


On Mar 6, 2008, at 7:10 PM, Prabhu Tamilarasan (omNovia) wrote:

If its a dll or shared library you can load it into the Java app
using System.loadLibrary and then use JNI to call into it's functions.

Dan Rossi wrote:
Ive setup something before to call an externa. C# script which
interfaces with the ffmpeg library to grab screenshots of recorded
files when publishing is finished. Use

Runtime rt = Runtime.getRuntime();  
Process proc = rt.exec("ffmpeg");

or something like that

On 07/03/2008, at 10:28 AM, laurent wrote:

Hi,

Is there a way to call ffmpeg library, installed on the same server as
red5, using my own java application ?
The goal is to encode flv audio to wav

thanks
Laurent

_______________________________________________
Red5 mailing list
[hidden email] <[hidden email]>
http://osflash.org/mailman/listinfo/red5_osflash.org

------------------------------------------------------------------------

_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org


--
------------------------------------------------------------------------
  <mailicon.gif>
next generation web conferencing
Prabhu Tamilarasan
Senior Software Engineer 675 Bering Drive, Suite 290
Houston, TX 77057 USA
www.omnovia.com
[hidden email] T +1.281.500.4065 x 731

------------------------------------------------------------------------
_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org

------------------------------------------------------------------------

_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org



_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org


_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

Laurent Kappler

I will try your solution asap.
I need to encode an audio recorded stream from webcam to wav because the
other part of the application need a wav input to do some analysis. They
use wav !




Dan Rossi a écrit :

> No it can be done directly in your webapp using the example code I
> just gave you. So you call that on the recordstop or publishstop
> stream events in the webapp.
>
> The php looks like a very basic raw function non OO method example of
> encoding uploaded mp3 files to flv or the other way round not sure. I
> think you need some other method also from decoding recorded flv which
> uses nellymoser back to another format, unless they were encoded with
> mp3 audio I guess. And I don't see much point transcoding back to wav
> seeing its a lossless format, unless you wanted the AAC soundtrack of
> an mpeg4 clip to wav of course.
>
> On 07/03/2008, at 1:05 PM, laurent wrote:
>
>>
>> That mean I will have to use a php solution to encode the flv to à
>> mp3 file.
>>
>> If by professional you mean involving money, I won't be able to contact
>> your super amazing team....it's quite some names you have there...I bet
>> you can build it! :)
>>
>> ...I'm looking for free information to make it work. I guess if php can
>> do it java should too.
>>
>> But I'm interested by your applications using ffmpeg, I have not seen
>> anything about it on infrared5.com. Do you have online ... stuff
>> about it ?
>>
>> Thank you
>> Laurent
>>
>> Dominick Accattato a écrit :
>>> http://red5server.com/forum/posts/list/19.page
>>>
>>> please see the example by Adam Proctor "FFMpeg with Red5"
>>>
>>> Additionally, our group Infrared5 has built applications using FFMpeg
>>> so if you are in need of professional services, feel free to contact
>>> our group (www.infrared5.com <http://www.infrared5.com>)
>>>
>>>
>>> On Mar 6, 2008, at 7:10 PM, Prabhu Tamilarasan (omNovia) wrote:
>>>
>>>> If its a dll or shared library you can load it into the Java app
>>>> using System.loadLibrary and then use JNI to call into it's functions.
>>>>
>>>> Dan Rossi wrote:
>>>>> Ive setup something before to call an externa. C# script which
>>>>> interfaces with the ffmpeg library to grab screenshots of recorded
>>>>> files when publishing is finished. Use
>>>>>
>>>>> Runtime rt = Runtime.getRuntime();  
>>>>> Process proc = rt.exec("ffmpeg");
>>>>>
>>>>> or something like that
>>>>>
>>>>> On 07/03/2008, at 10:28 AM, laurent wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Is there a way to call ffmpeg library, installed on the same
>>>>>> server as
>>>>>> red5, using my own java application ?
>>>>>> The goal is to encode flv audio to wav
>>>>>>
>>>>>> thanks
>>>>>> Laurent
>>>>>>
>>>>>> _______________________________________________
>>>>>> Red5 mailing list
>>>>>> [hidden email] <mailto:[hidden email]> <mailto:[hidden email]>
>>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>> _______________________________________________
>>>>> Red5 mailing list
>>>>> [hidden email] <mailto:[hidden email]>
>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>
>>>>
>>>> --
>>>> ------------------------------------------------------------------------
>>>>   <mailicon.gif>
>>>> next generation web conferencing
>>>> Prabhu Tamilarasan
>>>> Senior Software Engineer 675 Bering Drive, Suite 290
>>>> Houston, TX 77057 USA
>>>> www.omnovia.com <http://www.omnovia.com>
>>>> [hidden email] <mailto:[hidden email]> T
>>>> +1.281.500.4065 x 731
>>>>
>>>> ------------------------------------------------------------------------
>>>> _______________________________________________
>>>> Red5 mailing list
>>>> [hidden email] <mailto:[hidden email]>
>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> [hidden email] <mailto:[hidden email]>
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>
>>
>> _______________________________________________
>> Red5 mailing list
>> [hidden email] <mailto:[hidden email]>
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Red5 mailing list
> [hidden email]
> http://osflash.org/mailman/listinfo/red5_osflash.org
>  


_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

Daniel Rossi-2
Maybe you can pipe the output from ffmpeg to other program directly rather than output to a wav file. You might have better luck with mp3, please do a search about transcoding nellymoser I think. 

On 07/03/2008, at 1:47 PM, laurent wrote:


I will try your solution asap.
I need to encode an audio recorded stream from webcam to wav because the
other part of the application need a wav input to do some analysis. They
use wav !




Dan Rossi a écrit :
No it can be done directly in your webapp using the example code I
just gave you. So you call that on the recordstop or publishstop
stream events in the webapp.

The php looks like a very basic raw function non OO method example of
encoding uploaded mp3 files to flv or the other way round not sure. I
think you need some other method also from decoding recorded flv which
uses nellymoser back to another format, unless they were encoded with
mp3 audio I guess. And I don't see much point transcoding back to wav
seeing its a lossless format, unless you wanted the AAC soundtrack of
an mpeg4 clip to wav of course.

On 07/03/2008, at 1:05 PM, laurent wrote:


That mean I will have to use a php solution to encode the flv to à
mp3 file.

If by professional you mean involving money, I won't be able to contact
your super amazing team....it's quite some names you have there...I bet
you can build it! :)

...I'm looking for free information to make it work. I guess if php can
do it java should too.

But I'm interested by your applications using ffmpeg, I have not seen
anything about it on infrared5.com. Do you have online ... stuff
about it ?

Thank you
Laurent

Dominick Accattato a écrit :
http://red5server.com/forum/posts/list/19.page

please see the example by Adam Proctor "FFMpeg with Red5"

Additionally, our group Infrared5 has built applications using FFMpeg
so if you are in need of professional services, feel free to contact
our group (www.infrared5.com <http://www.infrared5.com>)


On Mar 6, 2008, at 7:10 PM, Prabhu Tamilarasan (omNovia) wrote:

If its a dll or shared library you can load it into the Java app
using System.loadLibrary and then use JNI to call into it's functions.

Dan Rossi wrote:
Ive setup something before to call an externa. C# script which
interfaces with the ffmpeg library to grab screenshots of recorded
files when publishing is finished. Use

Runtime rt = Runtime.getRuntime();  
Process proc = rt.exec("ffmpeg");

or something like that

On 07/03/2008, at 10:28 AM, laurent wrote:

Hi,

Is there a way to call ffmpeg library, installed on the same
server as
red5, using my own java application ?
The goal is to encode flv audio to wav

thanks
Laurent

_______________________________________________
Red5 mailing list
[hidden email] <[hidden email]> <[hidden email]>
http://osflash.org/mailman/listinfo/red5_osflash.org

------------------------------------------------------------------------

_______________________________________________
Red5 mailing list
[hidden email] <[hidden email]>
http://osflash.org/mailman/listinfo/red5_osflash.org


--
------------------------------------------------------------------------
 <mailicon.gif>
next generation web conferencing
Prabhu Tamilarasan
Senior Software Engineer 675 Bering Drive, Suite 290
Houston, TX 77057 USA
www.omnovia.com <http://www.omnovia.com>
[hidden email] <[hidden email]> T
+1.281.500.4065 x 731

------------------------------------------------------------------------
_______________________________________________
Red5 mailing list
[hidden email] <[hidden email]>
http://osflash.org/mailman/listinfo/red5_osflash.org

------------------------------------------------------------------------

_______________________________________________
Red5 mailing list
[hidden email] <[hidden email]>
http://osflash.org/mailman/listinfo/red5_osflash.org



_______________________________________________
Red5 mailing list
[hidden email] <[hidden email]>
http://osflash.org/mailman/listinfo/red5_osflash.org

------------------------------------------------------------------------

_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org



_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org


_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

Laurent Kappler

The thing is my project manager is using programming ressources all over
the globe, and I have no contact with the other part of the project.
They are building a c# library that will process a wav file. I ask for
mp3 but everything settled and they need wav. I don't know if they can
pipe ffmpeg and they need some other information than the sound file, so
we need a "pause" in between, get a wav and send it with the rest to
that library.

hm I found some ressources,
http://blog.andrewpaulsimmons.com/2007/05/recording-audio-with-flash-player-to.html#links
Interesting one, " When we looked for a program to decompress this
converter we found that Nellymoser
<http://en.wikipedia.org/wiki/Nellymoser>offered a converter for
$7,500." hahahahah ha hrm. as funny as FMS license price

and then
http://code.google.com/p/nelly2pcm/

and
"As of October 2007, FFmpeg supports decoding/transcoding NellyMoser
encoded FLVs.

Sample usage:
ffmpeg.exe -i sample-22kHz.flv out.wav"

Apparently since october ffmpeg can handle the audio only flv files.
I will try both solutions. And will ask about that piping. ;)

Dan Rossi a écrit :

> Maybe you can pipe the output from ffmpeg to other program directly
> rather than output to a wav file. You might have better luck with mp3,
> please do a search about transcoding nellymoser I think.
>
> On 07/03/2008, at 1:47 PM, laurent wrote:
>
>>
>> I will try your solution asap.
>> I need to encode an audio recorded stream from webcam to wav because the
>> other part of the application need a wav input to do some analysis. They
>> use wav !
>>
>>
>>
>>
>> Dan Rossi a écrit :
>>> No it can be done directly in your webapp using the example code I
>>> just gave you. So you call that on the recordstop or publishstop
>>> stream events in the webapp.
>>>
>>> The php looks like a very basic raw function non OO method example of
>>> encoding uploaded mp3 files to flv or the other way round not sure. I
>>> think you need some other method also from decoding recorded flv which
>>> uses nellymoser back to another format, unless they were encoded with
>>> mp3 audio I guess. And I don't see much point transcoding back to wav
>>> seeing its a lossless format, unless you wanted the AAC soundtrack of
>>> an mpeg4 clip to wav of course.
>>>
>>> On 07/03/2008, at 1:05 PM, laurent wrote:
>>>
>>>>
>>>> That mean I will have to use a php solution to encode the flv to à
>>>> mp3 file.
>>>>
>>>> If by professional you mean involving money, I won't be able to contact
>>>> your super amazing team....it's quite some names you have there...I bet
>>>> you can build it! :)
>>>>
>>>> ...I'm looking for free information to make it work. I guess if php can
>>>> do it java should too.
>>>>
>>>> But I'm interested by your applications using ffmpeg, I have not seen
>>>> anything about it on infrared5.com. Do you have online ... stuff
>>>> about it ?
>>>>
>>>> Thank you
>>>> Laurent
>>>>
>>>> Dominick Accattato a écrit :
>>>>> http://red5server.com/forum/posts/list/19.page
>>>>>
>>>>> please see the example by Adam Proctor "FFMpeg with Red5"
>>>>>
>>>>> Additionally, our group Infrared5 has built applications using FFMpeg
>>>>> so if you are in need of professional services, feel free to contact
>>>>> our group (www.infrared5.com <http://www.infrared5.com>
>>>>> <http://www.infrared5.com>)
>>>>>
>>>>>
>>>>> On Mar 6, 2008, at 7:10 PM, Prabhu Tamilarasan (omNovia) wrote:
>>>>>
>>>>>> If its a dll or shared library you can load it into the Java app
>>>>>> using System.loadLibrary and then use JNI to call into it's
>>>>>> functions.
>>>>>>
>>>>>> Dan Rossi wrote:
>>>>>>> Ive setup something before to call an externa. C# script which
>>>>>>> interfaces with the ffmpeg library to grab screenshots of recorded
>>>>>>> files when publishing is finished. Use
>>>>>>>
>>>>>>> Runtime rt = Runtime.getRuntime();  
>>>>>>> Process proc = rt.exec("ffmpeg");
>>>>>>>
>>>>>>> or something like that
>>>>>>>
>>>>>>> On 07/03/2008, at 10:28 AM, laurent wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Is there a way to call ffmpeg library, installed on the same
>>>>>>>> server as
>>>>>>>> red5, using my own java application ?
>>>>>>>> The goal is to encode flv audio to wav
>>>>>>>>
>>>>>>>> thanks
>>>>>>>> Laurent
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Red5 mailing list
>>>>>>>> [hidden email] <mailto:[hidden email]>
>>>>>>>> <mailto:[hidden email]> <mailto:[hidden email]>
>>>>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>>>
>>>>>>> ------------------------------------------------------------------------
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Red5 mailing list
>>>>>>> [hidden email] <mailto:[hidden email]> <mailto:[hidden email]>
>>>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> ------------------------------------------------------------------------
>>>>>>  <mailicon.gif>
>>>>>> next generation web conferencing
>>>>>> Prabhu Tamilarasan
>>>>>> Senior Software Engineer 675 Bering Drive, Suite 290
>>>>>> Houston, TX 77057 USA
>>>>>> www.omnovia.com <http://www.omnovia.com> <http://www.omnovia.com>
>>>>>> [hidden email] <mailto:[hidden email]>
>>>>>> <mailto:[hidden email]> T
>>>>>> +1.281.500.4065 x 731
>>>>>>
>>>>>> ------------------------------------------------------------------------
>>>>>> _______________________________________________
>>>>>> Red5 mailing list
>>>>>> [hidden email] <mailto:[hidden email]> <mailto:[hidden email]>
>>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>> _______________________________________________
>>>>> Red5 mailing list
>>>>> [hidden email] <mailto:[hidden email]> <mailto:[hidden email]>
>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Red5 mailing list
>>>> [hidden email] <mailto:[hidden email]> <mailto:[hidden email]>
>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> [hidden email] <mailto:[hidden email]>
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>
>>
>> _______________________________________________
>> Red5 mailing list
>> [hidden email] <mailto:[hidden email]>
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Red5 mailing list
> [hidden email]
> http://osflash.org/mailman/listinfo/red5_osflash.org
>  


_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

ptamilar
I'm not sure what your application is trying to do.  If you are just trying to execute the application with certain parameters to do whatever it does than Runtime.exec() would be your best bet.  If you want to access ffmpegs low level functions, then you will need to load the driver into the java app using loadLibrary(). 

I think in your case Runtime.exec() would be best.

Thanks,

laurent wrote:
The thing is my project manager is using programming ressources all over 
the globe, and I have no contact with the other part of the project. 
They are building a c# library that will process a wav file. I ask for 
mp3 but everything settled and they need wav. I don't know if they can 
pipe ffmpeg and they need some other information than the sound file, so 
we need a "pause" in between, get a wav and send it with the rest to 
that library.

hm I found some ressources,
http://blog.andrewpaulsimmons.com/2007/05/recording-audio-with-flash-player-to.html#links
Interesting one, " When we looked for a program to decompress this 
converter we found that Nellymoser 
<http://en.wikipedia.org/wiki/Nellymoser>offered a converter for 
$7,500." hahahahah ha hrm. as funny as FMS license price

and then
http://code.google.com/p/nelly2pcm/

and
"As of October 2007, FFmpeg supports decoding/transcoding NellyMoser 
encoded FLVs.

Sample usage:
ffmpeg.exe -i sample-22kHz.flv out.wav"

Apparently since october ffmpeg can handle the audio only flv files.
I will try both solutions. And will ask about that piping. ;)

Dan Rossi a écrit :
  
Maybe you can pipe the output from ffmpeg to other program directly 
rather than output to a wav file. You might have better luck with mp3, 
please do a search about transcoding nellymoser I think. 

On 07/03/2008, at 1:47 PM, laurent wrote:

    
I will try your solution asap.
I need to encode an audio recorded stream from webcam to wav because the
other part of the application need a wav input to do some analysis. They
use wav !




Dan Rossi a écrit :
      
No it can be done directly in your webapp using the example code I
just gave you. So you call that on the recordstop or publishstop
stream events in the webapp.

The php looks like a very basic raw function non OO method example of
encoding uploaded mp3 files to flv or the other way round not sure. I
think you need some other method also from decoding recorded flv which
uses nellymoser back to another format, unless they were encoded with
mp3 audio I guess. And I don't see much point transcoding back to wav
seeing its a lossless format, unless you wanted the AAC soundtrack of
an mpeg4 clip to wav of course.

On 07/03/2008, at 1:05 PM, laurent wrote:

        
That mean I will have to use a php solution to encode the flv to à
mp3 file.

If by professional you mean involving money, I won't be able to contact
your super amazing team....it's quite some names you have there...I bet
you can build it! :)

...I'm looking for free information to make it work. I guess if php can
do it java should too.

But I'm interested by your applications using ffmpeg, I have not seen
anything about it on infrared5.com. Do you have online ... stuff
about it ?

Thank you
Laurent

Dominick Accattato a écrit :
          
http://red5server.com/forum/posts/list/19.page

please see the example by Adam Proctor "FFMpeg with Red5"

Additionally, our group Infrared5 has built applications using FFMpeg
so if you are in need of professional services, feel free to contact
our group (www.infrared5.com <http://www.infrared5.com> 
<http://www.infrared5.com>)


On Mar 6, 2008, at 7:10 PM, Prabhu Tamilarasan (omNovia) wrote:

            
If its a dll or shared library you can load it into the Java app
using System.loadLibrary and then use JNI to call into it's 
functions.

Dan Rossi wrote:
              
Ive setup something before to call an externa. C# script which
interfaces with the ffmpeg library to grab screenshots of recorded
files when publishing is finished. Use

Runtime rt = Runtime.getRuntime();  
Process proc = rt.exec("ffmpeg");

or something like that

On 07/03/2008, at 10:28 AM, laurent wrote:

                
Hi,

Is there a way to call ffmpeg library, installed on the same
server as
red5, using my own java application ?
The goal is to encode flv audio to wav

thanks
Laurent

_______________________________________________
Red5 mailing list
[hidden email] [hidden email] 
[hidden email] [hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
                  
------------------------------------------------------------------------

_______________________________________________
Red5 mailing list
[hidden email] [hidden email] [hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org

                
-- 
------------------------------------------------------------------------
 <mailicon.gif>
next generation web conferencing
Prabhu Tamilarasan
Senior Software Engineer 675 Bering Drive, Suite 290
Houston, TX 77057 USA
www.omnovia.com <http://www.omnovia.com> <http://www.omnovia.com>
[hidden email] [hidden email] 
[hidden email] T
+1.281.500.4065 x 731

------------------------------------------------------------------------
_______________________________________________
Red5 mailing list
[hidden email] [hidden email] [hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
              
------------------------------------------------------------------------

_______________________________________________
Red5 mailing list
[hidden email] [hidden email] [hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org

            
_______________________________________________
Red5 mailing list
[hidden email] [hidden email] [hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
          
------------------------------------------------------------------------

_______________________________________________
Red5 mailing list
[hidden email] [hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org

        
_______________________________________________
Red5 mailing list
[hidden email] [hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
      
------------------------------------------------------------------------

_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
  
    


_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
  

--

 
next generation web conferencing
Prabhu Tamilarasan
Senior Software Engineer
675 Bering Drive, Suite 290
Houston, TX 77057 USA
www.omnovia.com
[hidden email] T +1.281.500.4065 x 731


_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

Laurent Kappler

The best way will be to call the ffmpeg through Runtime.exec() and
piping directly to the c library could be possible like this:

Runtime.exec("ffmpeg params params || c-library params")

 ?

And if this possible, is there a way to push an event listener to see
when the job is done ?

The other solution would be to set a timer to check if a file is there,
meaning the job is done, but that not really neat.

Thank you for your helps!

Prabhu Tamilarasan (omNovia) a écrit :

> I'm not sure what your application is trying to do.  If you are just
> trying to execute the application with certain parameters to do
> whatever it does than Runtime.exec() would be your best bet.  If you
> want to access ffmpegs low level functions, then you will need to load
> the driver into the java app using loadLibrary().
>
> I think in your case Runtime.exec() would be best.
>
> Thanks,
>
> laurent wrote:
>> The thing is my project manager is using programming ressources all over
>> the globe, and I have no contact with the other part of the project.
>> They are building a c# library that will process a wav file. I ask for
>> mp3 but everything settled and they need wav. I don't know if they can
>> pipe ffmpeg and they need some other information than the sound file, so
>> we need a "pause" in between, get a wav and send it with the rest to
>> that library.
>>
>> hm I found some ressources,
>> http://blog.andrewpaulsimmons.com/2007/05/recording-audio-with-flash-player-to.html#links
>> Interesting one, " When we looked for a program to decompress this
>> converter we found that Nellymoser
>> <http://en.wikipedia.org/wiki/Nellymoser>offered a converter for
>> $7,500." hahahahah ha hrm. as funny as FMS license price
>>
>> and then
>> http://code.google.com/p/nelly2pcm/
>>
>> and
>> "As of October 2007, FFmpeg supports decoding/transcoding NellyMoser
>> encoded FLVs.
>>
>> Sample usage:
>> ffmpeg.exe -i sample-22kHz.flv out.wav"
>>
>> Apparently since october ffmpeg can handle the audio only flv files.
>> I will try both solutions. And will ask about that piping. ;)
>>
>> Dan Rossi a écrit :
>>  
>>> Maybe you can pipe the output from ffmpeg to other program directly
>>> rather than output to a wav file. You might have better luck with mp3,
>>> please do a search about transcoding nellymoser I think.
>>>
>>> On 07/03/2008, at 1:47 PM, laurent wrote:
>>>
>>>    
>>>> I will try your solution asap.
>>>> I need to encode an audio recorded stream from webcam to wav because the
>>>> other part of the application need a wav input to do some analysis. They
>>>> use wav !
>>>>
>>>>
>>>>
>>>>
>>>> Dan Rossi a écrit :
>>>>      
>>>>> No it can be done directly in your webapp using the example code I
>>>>> just gave you. So you call that on the recordstop or publishstop
>>>>> stream events in the webapp.
>>>>>
>>>>> The php looks like a very basic raw function non OO method example of
>>>>> encoding uploaded mp3 files to flv or the other way round not sure. I
>>>>> think you need some other method also from decoding recorded flv which
>>>>> uses nellymoser back to another format, unless they were encoded with
>>>>> mp3 audio I guess. And I don't see much point transcoding back to wav
>>>>> seeing its a lossless format, unless you wanted the AAC soundtrack of
>>>>> an mpeg4 clip to wav of course.
>>>>>
>>>>> On 07/03/2008, at 1:05 PM, laurent wrote:
>>>>>
>>>>>        
>>>>>> That mean I will have to use a php solution to encode the flv to à
>>>>>> mp3 file.
>>>>>>
>>>>>> If by professional you mean involving money, I won't be able to contact
>>>>>> your super amazing team....it's quite some names you have there...I bet
>>>>>> you can build it! :)
>>>>>>
>>>>>> ...I'm looking for free information to make it work. I guess if php can
>>>>>> do it java should too.
>>>>>>
>>>>>> But I'm interested by your applications using ffmpeg, I have not seen
>>>>>> anything about it on infrared5.com. Do you have online ... stuff
>>>>>> about it ?
>>>>>>
>>>>>> Thank you
>>>>>> Laurent
>>>>>>
>>>>>> Dominick Accattato a écrit :
>>>>>>          
>>>>>>> http://red5server.com/forum/posts/list/19.page
>>>>>>>
>>>>>>> please see the example by Adam Proctor "FFMpeg with Red5"
>>>>>>>
>>>>>>> Additionally, our group Infrared5 has built applications using FFMpeg
>>>>>>> so if you are in need of professional services, feel free to contact
>>>>>>> our group (www.infrared5.com <http://www.infrared5.com>
>>>>>>> <http://www.infrared5.com>)
>>>>>>>
>>>>>>>
>>>>>>> On Mar 6, 2008, at 7:10 PM, Prabhu Tamilarasan (omNovia) wrote:
>>>>>>>
>>>>>>>            
>>>>>>>> If its a dll or shared library you can load it into the Java app
>>>>>>>> using System.loadLibrary and then use JNI to call into it's
>>>>>>>> functions.
>>>>>>>>
>>>>>>>> Dan Rossi wrote:
>>>>>>>>              
>>>>>>>>> Ive setup something before to call an externa. C# script which
>>>>>>>>> interfaces with the ffmpeg library to grab screenshots of recorded
>>>>>>>>> files when publishing is finished. Use
>>>>>>>>>
>>>>>>>>> Runtime rt = Runtime.getRuntime();  
>>>>>>>>> Process proc = rt.exec("ffmpeg");
>>>>>>>>>
>>>>>>>>> or something like that
>>>>>>>>>
>>>>>>>>> On 07/03/2008, at 10:28 AM, laurent wrote:
>>>>>>>>>
>>>>>>>>>                
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> Is there a way to call ffmpeg library, installed on the same
>>>>>>>>>> server as
>>>>>>>>>> red5, using my own java application ?
>>>>>>>>>> The goal is to encode flv audio to wav
>>>>>>>>>>
>>>>>>>>>> thanks
>>>>>>>>>> Laurent
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Red5 mailing list
>>>>>>>>>> [hidden email] <mailto:[hidden email]>
>>>>>>>>>> <mailto:[hidden email]> <mailto:[hidden email]>
>>>>>>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>>>>>>                  
>>>>>>>>> ------------------------------------------------------------------------
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> Red5 mailing list
>>>>>>>>> [hidden email] <mailto:[hidden email]> <mailto:[hidden email]>
>>>>>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>>>>>
>>>>>>>>>                
>>>>>>>> --
>>>>>>>> ------------------------------------------------------------------------
>>>>>>>>  <mailicon.gif>
>>>>>>>> next generation web conferencing
>>>>>>>> Prabhu Tamilarasan
>>>>>>>> Senior Software Engineer 675 Bering Drive, Suite 290
>>>>>>>> Houston, TX 77057 USA
>>>>>>>> www.omnovia.com <http://www.omnovia.com> <http://www.omnovia.com>
>>>>>>>> [hidden email] <mailto:[hidden email]>
>>>>>>>> <mailto:[hidden email]> T
>>>>>>>> +1.281.500.4065 x 731
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------
>>>>>>>> _______________________________________________
>>>>>>>> Red5 mailing list
>>>>>>>> [hidden email] <mailto:[hidden email]> <mailto:[hidden email]>
>>>>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>>>>              
>>>>>>> ------------------------------------------------------------------------
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Red5 mailing list
>>>>>>> [hidden email] <mailto:[hidden email]> <mailto:[hidden email]>
>>>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>>>
>>>>>>>            
>>>>>> _______________________________________________
>>>>>> Red5 mailing list
>>>>>> [hidden email] <mailto:[hidden email]> <mailto:[hidden email]>
>>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>>          
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>> _______________________________________________
>>>>> Red5 mailing list
>>>>> [hidden email] <mailto:[hidden email]>
>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>
>>>>>        
>>>> _______________________________________________
>>>> Red5 mailing list
>>>> [hidden email] <mailto:[hidden email]>
>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>      
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> [hidden email]
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>  
>>>    
>>
>>
>> _______________________________________________
>> Red5 mailing list
>> [hidden email]
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>  
>
> --
> ------------------------------------------------------------------------
>  
> next generation web conferencing
> Prabhu Tamilarasan
> Senior Software Engineer 675 Bering Drive, Suite 290
> Houston, TX 77057 USA
> www.omnovia.com
> [hidden email] T +1.281.500.4065 x 731
>
> ------------------------------------------------------------------------
> ------------------------------------------------------------------------
>
> _______________________________________________
> Red5 mailing list
> [hidden email]
> http://osflash.org/mailman/listinfo/red5_osflash.org
>  


_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

ptamilar
Using Runtime.exec(...) to execute your ffmpeg program returns a reference to a Process object.  Then use Process.waitFor() to cause the current thread to block until the process is over.  Might want to create a new java thread that executes ffmpeg if the process takes a while or your main app will block.

laurent wrote:
The best way will be to call the ffmpeg through Runtime.exec() and 
piping directly to the c library could be possible like this:

Runtime.exec("ffmpeg params params || c-library params")

 ?

And if this possible, is there a way to push an event listener to see 
when the job is done ?

The other solution would be to set a timer to check if a file is there, 
meaning the job is done, but that not really neat.

Thank you for your helps!

Prabhu Tamilarasan (omNovia) a écrit :
  
I'm not sure what your application is trying to do.  If you are just 
trying to execute the application with certain parameters to do 
whatever it does than Runtime.exec() would be your best bet.  If you 
want to access ffmpegs low level functions, then you will need to load 
the driver into the java app using loadLibrary(). 

I think in your case Runtime.exec() would be best.

Thanks,

laurent wrote:
    
The thing is my project manager is using programming ressources all over 
the globe, and I have no contact with the other part of the project. 
They are building a c# library that will process a wav file. I ask for 
mp3 but everything settled and they need wav. I don't know if they can 
pipe ffmpeg and they need some other information than the sound file, so 
we need a "pause" in between, get a wav and send it with the rest to 
that library.

hm I found some ressources,
http://blog.andrewpaulsimmons.com/2007/05/recording-audio-with-flash-player-to.html#links
Interesting one, " When we looked for a program to decompress this 
converter we found that Nellymoser 
<http://en.wikipedia.org/wiki/Nellymoser>offered a converter for 
$7,500." hahahahah ha hrm. as funny as FMS license price

and then
http://code.google.com/p/nelly2pcm/

and
"As of October 2007, FFmpeg supports decoding/transcoding NellyMoser 
encoded FLVs.

Sample usage:
ffmpeg.exe -i sample-22kHz.flv out.wav"

Apparently since october ffmpeg can handle the audio only flv files.
I will try both solutions. And will ask about that piping. ;)

Dan Rossi a écrit :
  
      
Maybe you can pipe the output from ffmpeg to other program directly 
rather than output to a wav file. You might have better luck with mp3, 
please do a search about transcoding nellymoser I think. 

On 07/03/2008, at 1:47 PM, laurent wrote:

    
        
I will try your solution asap.
I need to encode an audio recorded stream from webcam to wav because the
other part of the application need a wav input to do some analysis. They
use wav !




Dan Rossi a écrit :
      
          
No it can be done directly in your webapp using the example code I
just gave you. So you call that on the recordstop or publishstop
stream events in the webapp.

The php looks like a very basic raw function non OO method example of
encoding uploaded mp3 files to flv or the other way round not sure. I
think you need some other method also from decoding recorded flv which
uses nellymoser back to another format, unless they were encoded with
mp3 audio I guess. And I don't see much point transcoding back to wav
seeing its a lossless format, unless you wanted the AAC soundtrack of
an mpeg4 clip to wav of course.

On 07/03/2008, at 1:05 PM, laurent wrote:

        
            
That mean I will have to use a php solution to encode the flv to à
mp3 file.

If by professional you mean involving money, I won't be able to contact
your super amazing team....it's quite some names you have there...I bet
you can build it! :)

...I'm looking for free information to make it work. I guess if php can
do it java should too.

But I'm interested by your applications using ffmpeg, I have not seen
anything about it on infrared5.com. Do you have online ... stuff
about it ?

Thank you
Laurent

Dominick Accattato a écrit :
          
              
http://red5server.com/forum/posts/list/19.page

please see the example by Adam Proctor "FFMpeg with Red5"

Additionally, our group Infrared5 has built applications using FFMpeg
so if you are in need of professional services, feel free to contact
our group (www.infrared5.com <http://www.infrared5.com> 
<http://www.infrared5.com>)


On Mar 6, 2008, at 7:10 PM, Prabhu Tamilarasan (omNovia) wrote:

            
                
If its a dll or shared library you can load it into the Java app
using System.loadLibrary and then use JNI to call into it's 
functions.

Dan Rossi wrote:
              
                  
Ive setup something before to call an externa. C# script which
interfaces with the ffmpeg library to grab screenshots of recorded
files when publishing is finished. Use

Runtime rt = Runtime.getRuntime();  
Process proc = rt.exec("ffmpeg");

or something like that

On 07/03/2008, at 10:28 AM, laurent wrote:

                
                    
Hi,

Is there a way to call ffmpeg library, installed on the same
server as
red5, using my own java application ?
The goal is to encode flv audio to wav

thanks
Laurent

_______________________________________________
Red5 mailing list
[hidden email] [hidden email] 
[hidden email] [hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
                  
                      
------------------------------------------------------------------------

_______________________________________________
Red5 mailing list
[hidden email] [hidden email] [hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org

                
                    
-- 
------------------------------------------------------------------------
 <mailicon.gif>
next generation web conferencing
Prabhu Tamilarasan
Senior Software Engineer 675 Bering Drive, Suite 290
Houston, TX 77057 USA
www.omnovia.com <http://www.omnovia.com> <http://www.omnovia.com>
[hidden email] [hidden email] 
[hidden email] T
+1.281.500.4065 x 731

------------------------------------------------------------------------
_______________________________________________
Red5 mailing list
[hidden email] [hidden email] [hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
              
                  
------------------------------------------------------------------------

_______________________________________________
Red5 mailing list
[hidden email] [hidden email] [hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org

            
                
_______________________________________________
Red5 mailing list
[hidden email] [hidden email] [hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
          
              
------------------------------------------------------------------------

_______________________________________________
Red5 mailing list
[hidden email] [hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org

        
            
_______________________________________________
Red5 mailing list
[hidden email] [hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
      
          
------------------------------------------------------------------------

_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
  
    
        
_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
  
      
-- 
------------------------------------------------------------------------
  	
next generation web conferencing
Prabhu Tamilarasan
Senior Software Engineer 	675 Bering Drive, Suite 290
Houston, TX 77057 USA
www.omnovia.com
[hidden email] 	T +1.281.500.4065 x 731

------------------------------------------------------------------------
------------------------------------------------------------------------

_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
  
    


_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
  

--

 
next generation web conferencing
Prabhu Tamilarasan
Senior Software Engineer
675 Bering Drive, Suite 290
Houston, TX 77057 USA
www.omnovia.com
[hidden email] T +1.281.500.4065 x 731


_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

vicnov
One more thing with Runtime.exec is that you should read data from
stdout and stderr streams - ffmpeg writes many things into
stderr/stdout; I/O buffers have limited size, so the process may become
blocked until you read all data from stdout/stderr. See javadoc for detials:
http://java.sun.com/javase/6/docs/api/java/lang/Process.html
http://java.sun.com/javase/6/docs/api/java/lang/ProcessBuilder.html

Below is an extract based on one of our projects where we used ffmpeg:


public class FFMPEGConverter {
...
public boolean convert(String fileName) {
                File fOriginal = new File(incomingDir + "/" + fileName);
                File fTemp = new File(tempDir + "/" + fileName + ".wav");
                File fResult = new File(resultDir + "/" + fileName + ".wav");
               
                String[] cmdLine=new
String[]{"ffmpeg","-i",fOriginal.getPath(),"-ar","8000","-ac","1","-acodec","pcm_mulaw","-y","-v","-1",fTemp.getPath()};
               
                ProcessBuilder pb = new ProcessBuilder(cmdLine);
                pb.redirectErrorStream(true);
                Process p = null;
               
                        try {
                                p = pb.start();
                                logProcessOutputAndErrors(p);
                        } catch (Exception ex) {
                                        logger.warn("Can't create process to convert '" + fileName
                                                        + "'.", ex);
                                p.destroy();
                                return false;
                        }

                        // wait until the process is finished
                        try {
                                p.waitFor();
                        } catch (InterruptedException e) {
                                p.destroy();
                        }

                if (p.exitValue() != 0) {
                        logger.warn("Error while converting '" + fileName + "'.");
                        return false;
                }

                if (fTemp.length() == 0) {
                        logger.warn("Error while converting '" + fileName
                                        + "'. File size is zero.");
                        return false;
                }

                boolean renameResult = fTemp.renameTo(fResult);
                if (!renameResult) {
                        logger.warn("Can't move '" + fileName
                                        + "' from temporary directory to result directory.");
                        return false;
                }

                logger.info("'" + fileName + "' converted successfully.");
                fOriginal.delete();
                return true;
        }

private void logProcessOutputAndErrors(Process p) {
                BufferedReader processOutputReader = null;
                BufferedReader processErrorReader = null;
                try {
                        int character;
                        StringBuilder processLog = new StringBuilder();

                        processOutputReader = new BufferedReader(new InputStreamReader(p
                                        .getInputStream()));
                        while ((character = processOutputReader.read()) != -1) {
                                processLog.append((char) character);
                        }
                        processLog.append('\n');

                        processErrorReader = new BufferedReader(new InputStreamReader(p
                                        .getErrorStream()));
                        while ((character = processErrorReader.read()) != -1) {
                                processLog.append((char) character);
                        }

                        logger.info(processLog);
                } catch (Exception ex) {
                                logger.warn("Can't read process output.", ex);
                // this is not fatal, continue
                } finally {
                        if (processOutputReader != null) {
                                try {
                                        processOutputReader.close();
                                } catch (Exception ex) {
                                        // ignore
                                }
                        }
                        if (processErrorReader != null) {
                                try {
                                        processErrorReader.close();
                                } catch (Exception ex) {
                                        // ignore
                                }
                        }
                }
        }
}

Victor


Prabhu Tamilarasan (omNovia) wrote:

> Using Runtime.exec(...) to execute your ffmpeg program returns a
> reference to a Process object.  Then use Process.waitFor() to cause the
> current thread to block until the process is over.  Might want to create
> a new java thread that executes ffmpeg if the process takes a while or
> your main app will block.
>
> laurent wrote:
>> The best way will be to call the ffmpeg through Runtime.exec() and
>> piping directly to the c library could be possible like this:
>>
>> Runtime.exec("ffmpeg params params || c-library params")

_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

Laurent Kappler
Thank you very much for those great ressources!

Here is a sweet website:
http://roxik.com/pictaps/

cheers
L


Victor a écrit :

> One more thing with Runtime.exec is that you should read data from
> stdout and stderr streams - ffmpeg writes many things into
> stderr/stdout; I/O buffers have limited size, so the process may become
> blocked until you read all data from stdout/stderr. See javadoc for detials:
> http://java.sun.com/javase/6/docs/api/java/lang/Process.html
> http://java.sun.com/javase/6/docs/api/java/lang/ProcessBuilder.html
>
> Below is an extract based on one of our projects where we used ffmpeg:
>
>
> public class FFMPEGConverter {
> ...
> public boolean convert(String fileName) {
> File fOriginal = new File(incomingDir + "/" + fileName);
> File fTemp = new File(tempDir + "/" + fileName + ".wav");
> File fResult = new File(resultDir + "/" + fileName + ".wav");
>
> String[] cmdLine=new
> String[]{"ffmpeg","-i",fOriginal.getPath(),"-ar","8000","-ac","1","-acodec","pcm_mulaw","-y","-v","-1",fTemp.getPath()};
>
> ProcessBuilder pb = new ProcessBuilder(cmdLine);
> pb.redirectErrorStream(true);
> Process p = null;
>
> try {
> p = pb.start();
> logProcessOutputAndErrors(p);
> } catch (Exception ex) {
> logger.warn("Can't create process to convert '" + fileName
> + "'.", ex);
> p.destroy();
> return false;
> }
>
> // wait until the process is finished
> try {
> p.waitFor();
> } catch (InterruptedException e) {
> p.destroy();
> }
>
> if (p.exitValue() != 0) {
> logger.warn("Error while converting '" + fileName + "'.");
> return false;
> }
>
> if (fTemp.length() == 0) {
> logger.warn("Error while converting '" + fileName
> + "'. File size is zero.");
> return false;
> }
>
> boolean renameResult = fTemp.renameTo(fResult);
> if (!renameResult) {
> logger.warn("Can't move '" + fileName
> + "' from temporary directory to result directory.");
> return false;
> }
>
> logger.info("'" + fileName + "' converted successfully.");
> fOriginal.delete();
> return true;
> }
>
> private void logProcessOutputAndErrors(Process p) {
> BufferedReader processOutputReader = null;
> BufferedReader processErrorReader = null;
> try {
> int character;
> StringBuilder processLog = new StringBuilder();
>
> processOutputReader = new BufferedReader(new InputStreamReader(p
> .getInputStream()));
> while ((character = processOutputReader.read()) != -1) {
> processLog.append((char) character);
> }
> processLog.append('\n');
>
> processErrorReader = new BufferedReader(new InputStreamReader(p
> .getErrorStream()));
> while ((character = processErrorReader.read()) != -1) {
> processLog.append((char) character);
> }
>
> logger.info(processLog);
> } catch (Exception ex) {
> logger.warn("Can't read process output.", ex);
> // this is not fatal, continue
> } finally {
> if (processOutputReader != null) {
> try {
> processOutputReader.close();
> } catch (Exception ex) {
> // ignore
> }
> }
> if (processErrorReader != null) {
> try {
> processErrorReader.close();
> } catch (Exception ex) {
> // ignore
> }
> }
> }
> }
> }
>
> Victor
>
>
> Prabhu Tamilarasan (omNovia) wrote:
>  
>> Using Runtime.exec(...) to execute your ffmpeg program returns a
>> reference to a Process object.  Then use Process.waitFor() to cause the
>> current thread to block until the process is over.  Might want to create
>> a new java thread that executes ffmpeg if the process takes a while or
>> your main app will block.
>>
>> laurent wrote:
>>    
>>> The best way will be to call the ffmpeg through Runtime.exec() and
>>> piping directly to the c library could be possible like this:
>>>
>>> Runtime.exec("ffmpeg params params || c-library params")
>>>      
>
> _______________________________________________
> Red5 mailing list
> [hidden email]
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
>  


_______________________________________________
Red5 mailing list
[hidden email]
http://osflash.org/mailman/listinfo/red5_osflash.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java call ffmpeg

rob_roy
In reply to this post by vicnov
Hi vicnov,

do you have any idea how to do the same thing in real-time. I want to use Ffmpeg to transcode an encoded flash audio stream on the fly to initiate a sip-all. Unforunately my java skills are very poor so every  tip would be great.

rob_roy


vicnov wrote
One more thing with Runtime.exec is that you should read data from
stdout and stderr streams - ffmpeg writes many things into
stderr/stdout; I/O buffers have limited size, so the process may become
blocked until you read all data from stdout/stderr. See javadoc for detials:
http://java.sun.com/javase/6/docs/api/java/lang/Process.html
http://java.sun.com/javase/6/docs/api/java/lang/ProcessBuilder.html

Below is an extract based on one of our projects where we used ffmpeg:


public class FFMPEGConverter {
...
public boolean convert(String fileName) {
                File fOriginal = new File(incomingDir + "/" + fileName);
                File fTemp = new File(tempDir + "/" + fileName + ".wav");
                File fResult = new File(resultDir + "/" + fileName + ".wav");
               
                String[] cmdLine=new
String[]{"ffmpeg","-i",fOriginal.getPath(),"-ar","8000","-ac","1","-acodec","pcm_mulaw","-y","-v","-1",fTemp.getPath()};
               
                ProcessBuilder pb = new ProcessBuilder(cmdLine);
                pb.redirectErrorStream(true);
                Process p = null;
               
                        try {
                                p = pb.start();
                                logProcessOutputAndErrors(p);
                        } catch (Exception ex) {
                                        logger.warn("Can't create process to convert '" + fileName
                                                        + "'.", ex);
                                p.destroy();
                                return false;
                        }

                        // wait until the process is finished
                        try {
                                p.waitFor();
                        } catch (InterruptedException e) {
                                p.destroy();
                        }

                if (p.exitValue() != 0) {
                        logger.warn("Error while converting '" + fileName + "'.");
                        return false;
                }

                if (fTemp.length() == 0) {
                        logger.warn("Error while converting '" + fileName
                                        + "'. File size is zero.");
                        return false;
                }

                boolean renameResult = fTemp.renameTo(fResult);
                if (!renameResult) {
                        logger.warn("Can't move '" + fileName
                                        + "' from temporary directory to result directory.");
                        return false;
                }

                logger.info("'" + fileName + "' converted successfully.");
                fOriginal.delete();
                return true;
        }

private void logProcessOutputAndErrors(Process p) {
                BufferedReader processOutputReader = null;
                BufferedReader processErrorReader = null;
                try {
                        int character;
                        StringBuilder processLog = new StringBuilder();

                        processOutputReader = new BufferedReader(new InputStreamReader(p
                                        .getInputStream()));
                        while ((character = processOutputReader.read()) != -1) {
                                processLog.append((char) character);
                        }
                        processLog.append('\n');

                        processErrorReader = new BufferedReader(new InputStreamReader(p
                                        .getErrorStream()));
                        while ((character = processErrorReader.read()) != -1) {
                                processLog.append((char) character);
                        }

                        logger.info(processLog);
                } catch (Exception ex) {
                                logger.warn("Can't read process output.", ex);
                // this is not fatal, continue
                } finally {
                        if (processOutputReader != null) {
                                try {
                                        processOutputReader.close();
                                } catch (Exception ex) {
                                        // ignore
                                }
                        }
                        if (processErrorReader != null) {
                                try {
                                        processErrorReader.close();
                                } catch (Exception ex) {
                                        // ignore
                                }
                        }
                }
        }
}

Victor


Prabhu Tamilarasan (omNovia) wrote:
> Using Runtime.exec(...) to execute your ffmpeg program returns a
> reference to a Process object.  Then use Process.waitFor() to cause the
> current thread to block until the process is over.  Might want to create
> a new java thread that executes ffmpeg if the process takes a while or
> your main app will block.
>
> laurent wrote:
>> The best way will be to call the ffmpeg through Runtime.exec() and
>> piping directly to the c library could be possible like this:
>>
>> Runtime.exec("ffmpeg params params || c-library params")

_______________________________________________
Red5 mailing list
Red5@osflash.org
http://osflash.org/mailman/listinfo/red5_osflash.org
Loading...