jAckOdE
jAckOdE

Reputation: 2500

How to pause FFmpeg from C++ code?

I'm writing a VisualC++ program which have code invoke ffmpeg.exe to convert video file. I wonder is it possible to pause/resume ffmpeg converting thread from C++ code?

LR.

Upvotes: 6

Views: 3763

Answers (5)

denish
denish

Reputation: 21

This is an equivalent for Unix based command:

mike@krusty:~$ pidof ffmpeg
 22730
 mike@krusty:~$ sudo kill -STOP 22730
 [sudo] password for mike:
 mike@krusty:~$ sudo kill -CONT 22730

Upvotes: 2

sashoalm
sashoalm

Reputation: 79457

All you need to do is suspend and resume the ffmpeg child process itself.

The main problem is: there is no SuspendProcess API function. And there is no documented or safe way of doing this.

The only simple way of doing this is via SuspendThread/ResumeThread.

See this article on codeproject about how to do it.

Upvotes: 3

BЈовић
BЈовић

Reputation: 64213

There are no ways to controls the conversion using ffmpeg.

However, if you switch you mencoder, you will be able to do it.

Upvotes: 3

Alexey Malistov
Alexey Malistov

Reputation: 26975

Microsoft API ::SuspendThread function

Upvotes: 1

Björn Pollex
Björn Pollex

Reputation: 76778

No. This is a command-line tool, and once it is started, you cannot pause it.

Upvotes: 1

Related Questions