FFMPEG is timing out and getting killed before completing process

已关闭

描述

I have a script that takes an mp4 file and splits it into another mp4 file. It basically takes a section like 00:22:38 to 00:23:16 and creates a new video from that time segment.

The problem is that for larger files the process stops and gets killed before finishing.

ffmpeg -i "/uploads/files/[url removed, login to view]" -ss 00:22:38 -t 00:23:16 -async 1 "/uploads/files/[url removed, login to view]"

problem is [url removed, login to view]() does not wait and the process is killed without any errors in the log file.

the process actually starts but killed before completion.

This is the script that is called.

@RequestMapping(value = "/videotrim", method = [url removed, login to view])

public void trimVideo(@RequestParam Long id, @RequestParam("start-time") Integer startTime, @RequestParam("end-time") Integer endTime) {

[url removed, login to view](getClass().getName()).log([url removed, login to view], "called");

Document one = [url removed, login to view](id);

[url removed, login to view](getClass().getName()).log([url removed, login to view], "called" + [url removed, login to view]);

String inputFile = [url removed, login to view]("%20"," ");

final String movieFile = "/uploads" + inputFile;

final String resultFile = "/uploads/files/" + id + "-" + startTime + "-" + endTime + ".mp4";

//ffmpeg -i [url removed, login to view] -ss 00:00:03 -t 00:00:08 -async 1 [url removed, login to view]

Time start = new Time(startTime * 1000);

Time end = new Time(endTime * 1000);

final String startTimeSec = [url removed, login to view]();

final String endTimeSec = [url removed, login to view]();

Runnable runnable = new Runnable() {

public void run() {

try {

File file = new File(resultFile);

if (![url removed, login to view]()) {

final String command = "ffmpeg -i \"" + movieFile + "\" -ss " + startTimeSec + " -t " + endTimeSec + " -async 1 \"" + resultFile + "\"";

[url removed, login to view](getClass().getName()).log([url removed, login to view], "running: " + command);

ProcessBuilder pb = new ProcessBuilder("ffmpeg", "-i", movieFile, "-ss", startTimeSec, "-t", endTimeSec, "-async", "1", resultFile);

pb = [url removed, login to view](true); // equivalent of 2>&1

Process p = [url removed, login to view]();

[url removed, login to view]();

file = new File(resultFile);

[url removed, login to view](true,false);

} else {

[url removed, login to view](true,false);

}

} catch (Throwable e) {

[url removed, login to view](getClass().getName()).log([url removed, login to view], "error while trim video", e);

[url removed, login to view]();

}

}

};

new Thread(runnable).start();

}

技能: Java, Linux, 软件构架, 系统管理

查看更多: mysqld_safe mysqld process hanging pid killed, ffmpeg unable parse option value brdo dct8x8 bpyramid, ffmpeg unable parse option value brdo, process ffmpeg read, php ffmpeg process bar, ffmpeg process, bash process video ffmpeg, ajax convert ffmpeg process, chances getting job completion simply accounting, protect process killed, redhat monitoring scp completion process, refresh system tray killed process, killed process icon tray, getting current process autoit, process getting preferred vendor list, start process completing setup project, vbnet getting process information task manager, getting current url firefox process, process getting gift voucher

Project ID: #12150283

11 freelancers are bidding on average $123 for this job

$55 USD in 1 day
(36条评论)
5.1
neosaransh

Hello, Greetings. Hope you are doing well. I am expertise in cloud solution of AWS, Openstack, Rackspace, Google Cloud, Azure etc. I work as cloud solution architect. I am experienced in server migration with Linux ser 更多

$61 USD 在0天内
(43条评论)
4.5
zkutch

Hello. More 20 years programming experience. I need more details to set real time and price. Regards. -------------------------------------------------------------------------------------------------------------- 更多

$111 USD 在5天内
(22条评论)
4.7
$15 USD in 1 day
(53条评论)
4.5
Shchipunov

Hello, I know how to solve the problem. I have great experience in performing tasks. I developed media-server, that handled both video and audio, uncluding convertation. I also developed a FFmpeg wrapper for Java.

$60 USD in 1 day
(21条评论)
4.3
$100 USD in 1 day
(4条评论)
3.7
ams53

I am java developer, I can fix it in next 12 hours and deliver you task. Thanks Amit

$100 USD in 1 day
(5条评论)
2.8
andranik1990

I can resolv your problem friend....................................................................................

$61 USD in 1 day
(1条评论)
2.5
lopezml

You do not mention which OS you are running on, but may I assume you're on Windows 7? I might be wrong, but I think I know where the problem could be and how to fix it. Thanks! Luis

$90 USD in 1 day
(0条评论)
0.0
$616 USD 在10天内
(0条评论)
0.0
FCEngineers

Hello, Before you select a part time developer from here, visit us for 5 minutes (Fugacode.com) And if you like what you see, contact us. That's all! "Why hire part time college students? when you can hire profe 更多

$61 USD in 1 day
(0条评论)
0.0
$83 USD in 1 day
(0条评论)
0.0