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
[SOLVED] The "dockedforme...
by
jamie
[
Today
at 10:50:42 am]
Set horizontal scroll pos...
by
jamie
[
Today
at 10:40:58 am]
Amigo programming languag...
by
srvaldez
[
Today
at 10:29:37 am]
Lazarus Bugfix Release 4....
by
Ameta
[
Today
at 10:28:14 am]
Win 11, strange position ...
by
d7_2_laz
[
Today
at 10:24:29 am]
How many lines is too man...
by
440bx
[
Today
at 09:46:20 am]
Debian removes FPC/Lazaru...
by
MarkMLl
[
Today
at 08:45:47 am]
Qt6/Wayland clipboard: pa...
by
AlexTP
[
Today
at 08:15:04 am]
The Case For Pascal, 55 Y...
by
valdir.marcos
[
Today
at 08:02:58 am]
Text Fill (Memo)
by
paweld
[
Today
at 07:14:04 am]
Update a table with an Au...
by
Zvoni
[
Today
at 07:12:12 am]
Front-end framework
by
PierceNg
[
Today
at 05:46:34 am]
X11Libre, finally and for...
by
Fred vS
[
Today
at 03:37:59 am]
https://live.freepascal.o...
by
PierceNg
[
Today
at 03:04:22 am]
PasLLM - LLM Inference En...
by
valdir.marcos
[
Today
at 01:11:25 am]
Fast Canvas Library V1.05...
by
Gigatron
[
Today
at 01:09:53 am]
TDirectoryEdit with OnAft...
by
Bart
[
Today
at 01:04:32 am]
Problem wih reference to ...
by
PascalDragon
[
Today
at 12:09:44 am]
Benchmark test in nanosec...
by
PascalDragon
[March 07, 2026, 11:14:15 pm]
How to execute a procedur...
by
n7800
[March 07, 2026, 10:17:32 pm]
[SOLVED] Add Help to an A...
by
valdir.marcos
[March 07, 2026, 07:18:00 pm]
Variable initialization
by
valdir.marcos
[March 07, 2026, 05:58:47 pm]
Lazarus IDE built for LCL...
by
valdir.marcos
[March 07, 2026, 05:57:09 pm]
Status of LCL-fpGUI widge...
by
valdir.marcos
[March 07, 2026, 04:04:53 pm]
Status of LCL's CustomDra...
by
zeljko
[March 07, 2026, 03:59:56 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: TProcess ffmpeg freezes (Read 1505 times)
domasz
Hero Member
Posts: 617
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: 1097
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: 617
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: 1097
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: 617
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: 1097
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: 47
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: 617
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