Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Using the Lazarus IDE
»
General
»
TProcess ffmpeg freezes
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Olympic Rings (Interleave...
by
Boleeman
[
Today
at 05:16:12 am]
about lazarus and android
by
zzzzzzz7
[
Today
at 04:06:51 am]
Seven Kings (inc)
by
speter
[
Today
at 03:37:23 am]
Unit decfloat
by
speter
[
Today
at 02:46:47 am]
Remove region adjacent to...
by
n7800
[
Today
at 02:33:35 am]
Adjacent rectangles not a...
by
ron.dunn
[
Today
at 01:31:51 am]
Fast Canvas Library V1.05...
by
Gigatron
[
Today
at 12:44:57 am]
CudaText editor (written ...
by
szlbz
[
Today
at 12:01:23 am]
Tutorial on creating a co...
by
Roland57
[January 16, 2026, 08:29:55 pm]
Newly revised TlistBox in...
by
wp
[January 16, 2026, 06:23:04 pm]
How to forward a Class in...
by
Hartmut
[January 16, 2026, 05:21:35 pm]
How to low level manage S...
by
Tommi
[January 16, 2026, 04:05:54 pm]
Drag and Drop Files; onDr...
by
msintle
[January 16, 2026, 01:27:54 pm]
AI, NLP and CAI: Text Gen...
by
microxa
[January 16, 2026, 12:13:42 pm]
[Solved] Stacked bars not...
by
wp
[January 16, 2026, 10:57:01 am]
Theoretical question. Laz...
by
Petrus Vorster
[January 16, 2026, 09:49:47 am]
[solved] Printout in Prin...
by
wwerner
[January 16, 2026, 07:25:31 am]
The compiler fails to war...
by
dseligo
[January 16, 2026, 01:41:21 am]
Embedded qss stylesheets ...
by
big_M
[January 16, 2026, 12:52:34 am]
Mapping Images Like Odome...
by
SandyG
[January 15, 2026, 11:57:50 pm]
StrToDateTime problems
by
Aruna
[January 15, 2026, 11:56:02 pm]
unit init, finalize and i...
by
PascalDragon
[January 15, 2026, 09:46:49 pm]
Why does FPC behave this ...
by
PascalDragon
[January 15, 2026, 09:26:24 pm]
Pyramid solitaire, re-wri...
by
TBMan
[January 15, 2026, 09:21:07 pm]
Tzipper giving error on M...
by
Josh
[January 15, 2026, 08:46:02 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: TProcess ffmpeg freezes (Read 1491 times)
domasz
Hero Member
Posts: 615
TProcess ffmpeg freezes
«
on:
August 07, 2024, 05:49:45 pm »
I just want to save first frame from MP4 file as PNG. The same code works fine for other programs (like imagemagick) but for some reason ffmpeg freezes. When I run the command normally (from cmd) ffmpeg doesn't wait for enter or any other key, just exits.
Code: Pascal
[Select]
[+]
[-]
Proc
:
=
TProcess
.
Create
(
nil
)
;
Proc
.
CommandLine
:
=
'ffmpeg -i "input.mp4" -vframes 1 thumb.png'
;
Proc
.
Options
:
=
[
poWaitOnExit
]
;
// Proc.ShowWindow := swoHIDE;
Proc
.
Execute
;
Proc
.
Free
;
«
Last Edit: August 07, 2024, 06:03:30 pm by domasz
»
Logged
Hartmut
Hero Member
Posts: 1047
Re: TProcess ffmpeg freezes
«
Reply #1 on:
August 07, 2024, 06:00:26 pm »
try "ffmpeg" instead of "fmpeg" in line 2
Logged
domasz
Hero Member
Posts: 615
Re: TProcess ffmpeg freezes
«
Reply #2 on:
August 07, 2024, 06:03:22 pm »
Thanks, but that's not the problem.
Logged
Hartmut
Hero Member
Posts: 1047
Re: TProcess ffmpeg freezes
«
Reply #3 on:
August 07, 2024, 06:06:56 pm »
Did you set the correct working dir?
Maybe you must specify the path to ffmpeg.
Which OS do you use?
«
Last Edit: August 07, 2024, 06:08:29 pm by Hartmut
»
Logged
domasz
Hero Member
Posts: 615
Re: TProcess ffmpeg freezes
«
Reply #4 on:
August 07, 2024, 06:18:09 pm »
All dirs are fine. Ffmpeg does launch just fine, it loads the correct file. It just doesn't quit on it's own.
OS: Windows 10.
Logged
Hartmut
Hero Member
Posts: 1047
Re: TProcess ffmpeg freezes
«
Reply #5 on:
August 07, 2024, 06:27:05 pm »
That means, file "thumb.png" is correctly created and
after
that ffmpeg hangs?
If file "thumb.png" already exists, than it can be that ffmpeg asks if to overwrite it. This can be suppressed with parameter -y
Logged
BildatBoffin
New Member
Posts: 41
Re: TProcess ffmpeg freezes
«
Reply #6 on:
August 07, 2024, 06:30:56 pm »
In case you are piping you must consume stdout. Does not seem to be the case here tho.
Logged
-
https://gitlab.com/basile.b
-
https://gitlab.com/styx-lang/styx
domasz
Hero Member
Posts: 615
Re: TProcess ffmpeg freezes
«
Reply #7 on:
August 07, 2024, 06:50:32 pm »
Sorry guys. You are all right and the code does work. I had a problem somewhere (kinda) else.
Before I try to convert with ffmpeg I try with imagemagick. And imagemagick found ffmpeg.exe and tried to convert the file with ffmpeg and froze, for some reason. I renamed ffmpeg to ffmpeg2 and now it works nicely.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Using the Lazarus IDE
»
General
»
TProcess ffmpeg freezes
TinyPortal
© 2005-2018