File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes ffmpeg and Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "ffmpeg and Java" Watch "ffmpeg and Java" New topic

ffmpeg and Java

Andrea Sidoti

Joined: Mar 08, 2007
Posts: 2

I�m trying to use ffmpeg launching it from java. Though I�m able to use it from the command line, I receive the following error from Java

Executing c:\ffmpeg.exe -i c:\ -b 40k -r 10 -s qcif -target pal-vcd c:\test.3gp
ERROR>FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
ERROR> configuration: �enable-memalign-hack �extra-cflags=-I/local/include �extra-ldflags=-L/local/lib
ExitValue: 1
ERROR> libavutil version: 49.3.0
ERROR> libavcodec version: 51.38.0
ERROR> libavformat version: 51.10.0
ERROR> built on Mar 6 2007 12:40:35, gcc: 3.2.3 (mingw special 20030504-1)
ERROR>c:\ffmpeg.exe: unrecognized option �-i c:\�

Please help me!!
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15084

What happens if you open a command prompt and manually type this at the prompt:

c:\ffmpeg.exe -i c:\ -b 40k -r 10 -s qcif -target pal-vcd c:\test.3gp

Do you get the same error message? If yes, then '-i ...' is probably not a valid option for ffmpeg. Do you have documentation for ffmpeg? Does it say something about the '-i' option?

Can you show us the Java code that you use to execute ffmpeg?
[ March 08, 2007: Message edited by: Jesper Young ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Andrea Sidoti

Joined: Mar 08, 2007
Posts: 2
If I launch this string from the command line it works

cmd.exe start /c c:\\ffmpeg.exe -i c:\\Surf\\text.mp4 -b 40k -r 10 -s qcif -target pal-vcd c:\\Surf\\mov.3gp & exit

If I launch it from a simple java class it works.

But if I launch it from a javaBean called from a jsp it doesn't work. It never exits from the execution of the command...
I agree. Here's the link:
subject: ffmpeg and Java
It's not a secret anymore!