<p>I am using ffmpeg to convert videos to mp4 format in my application I have used JAVE and Xuggler for the same. My issue is that, video conversions are taking way too much of time. For example, a 50MB video takes almost 2 hrs to complete the video conversion and upload the same. Also, when i play a video, it takes a longer time to play on safari on mac OS than chrome/firefox.</p>

<p>What are the possible solutions for this? How to optimize the conversion time/video buffering for playing the video faster</p>

<p>I am using the it.sauronsoftware.jave.VideoAttributes and EncodingAttributes classes to do this</p>

<pre><code>VideoAttributes video = new VideoAttributes();
video.setCodec("libx264");
EncodingAttributes attributes = new EncodingAttributes();
attributes.setFormat("mp4");
attributes.setVideoAttributes(video);
Encoder encoder = new Encoder(new FFMPEGLocator() {
                @Override
                protected String getFFMPEGExecutablePath() {
        String ffmpegPath = PropertiesUtil
            .getProperty("location.ffmpeg");
        return ffmpegPath;
     }
});
encoder.encode(sourceFile, destFile, attributes);
</code></pre>

<p>sourceFile and destFile are the source and destination files respectively</p>

CC BY-SA 3.0
2015-11-19T07:01:52.073Z
Please paste the ffmpeg command as well as the console output.
Gyan
CC BY-SA 3.0
2015-11-20T05:34:29.087Z
@Mulvya, I have included the java code used to do the conversion
Deepak
CC BY-SA 3.0
2015-11-20T05:43:15.490Z
Unfortunately, that doesn't help much. Need to know the actual syntax that ffmpeg is being invoked with.
Gyan
CC BY-SA 3.0
2015-11-23T06:35:38.250Z
@Mulvya, In my case the java code invokes the FFMPEG instance installed in the system for the conversion process. How will i get to know the exact command that ffmpeg invokes?
Deepak
CC BY-SA 3.0
2015-11-23T06:53:52.523Z
Not familiar with JAVE. Perhaps you can ask the developer Carlo Pelliccia at cpelliccia@sauronsoftware.it
Gyan
<video><ffmpeg><conversion><transcoding><performance>
ffmpeg based JAVE video conversion taking a long time
Deepak
# ffmpeg based JAVE video conversion taking a long time

(Asked by: username_0 on 2015-11-19)

I am using ffmpeg to convert videos to mp4 format in my application I have used JAVE and Xuggler for the same. My issue is that, video conversions are taking way too much of time. For example, a 50MB video takes almost 2 hrs to complete the video conversion and upload the same. Also, when i play a video, it takes a longer time to play on safari on mac OS than chrome/firefox.
What are the possible solutions for this? How to optimize the conversion time/video buffering for playing the video faster
I am using the it.sauronsoftware.jave.VideoAttributes and EncodingAttributes classes to do this
VideoAttributes video = new VideoAttributes();
video.setCodec("libx264");
EncodingAttributes attributes = new EncodingAttributes();
attributes.setFormat("mp4");
attributes.setVideoAttributes(video);
Encoder encoder = new Encoder(new FFMPEGLocator() {
                @Override
                protected String getFFMPEGExecutablePath() {
        String ffmpegPath = PropertiesUtil
            .getProperty("location.ffmpeg");
        return ffmpegPath;
     }
});
encoder.encode(sourceFile, destFile, attributes);

sourceFile and destFile are the source and destination files respectively

**Tags:** video, ffmpeg, conversion, transcoding, performance

> **Comments:**
> **username_1**: Please paste the ffmpeg command as well as the console output.  
> **username_0**: @Mulvya, I have included the java code used to do the conversion  
> **username_1**: Unfortunately, that doesn't help much. Need to know the actual syntax that ffmpeg is being invoked with.  
> **username_0**: @Mulvya, In my case the java code invokes the FFMPEG instance installed in the system for the conversion process. How will i get to know the exact command that ffmpeg invokes?  
> **username_1**: Not familiar with JAVE. Perhaps you can ask the developer Carlo Pelliccia at cpelliccia@sauronsoftware.it  

---

## 0 answers

