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
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Move a window between Wor...
by
Aruna
[
Today
at 03:46:12 am]
[SOLVED] Getting started ...
by
rushfan
[
Today
at 02:33:39 am]
Why renaming must be done...
by
Joanna
[
Today
at 01:30:00 am]
Game Music Emulator
by
Fred vS
[
Today
at 01:00:26 am]
Lazarus IDE defaults when...
by
Aruna
[
Today
at 12:39:54 am]
Str declaration
by
MarkMLl
[
Today
at 12:39:52 am]
Beeping sound when cursor...
by
carl_caulkett
[
Today
at 12:20:27 am]
DBGRID | Picklist on fiel...
by
TRon
[September 18, 2024, 10:25:50 pm]
Stack Overflow in RtlVirt...
by
af0815
[September 18, 2024, 09:32:09 pm]
Setting the fpc path
by
TRon
[September 18, 2024, 08:02:50 pm]
How to add float value s...
by
LBoxPO
[September 18, 2024, 07:25:39 pm]
Compiler error when check...
by
Thaddy
[September 18, 2024, 07:11:38 pm]
Loading text data from a ...
by
alpine
[September 18, 2024, 06:47:01 pm]
Simple multithreading cod...
by
MarkMLl
[September 18, 2024, 06:10:58 pm]
Recommended way to build ...
by
carl_caulkett
[September 18, 2024, 06:07:42 pm]
Incorrect FPC/Lazarus bui...
by
TRon
[September 18, 2024, 05:26:36 pm]
Vectors to find Center of...
by
Boleeman
[September 18, 2024, 03:48:26 pm]
7zip DLL is super broken
by
domasz
[September 18, 2024, 03:47:13 pm]
Gridprinter Newby
by
Zvoni
[September 18, 2024, 03:03:35 pm]
QuasiClever Fractal
by
Boleeman
[September 18, 2024, 02:23:56 pm]
Bitmap 16bit R5G6B5
by
wp
[September 18, 2024, 11:50:20 am]
"Show Compiler Dialog"
by
MarkMLl
[September 18, 2024, 10:21:49 am]
AI, NLP and CAI: Text Gen...
by
schuler
[September 18, 2024, 09:48:18 am]
Hashids that you need but...
by
Thaddy
[September 18, 2024, 06:10:34 am]
C++ conversion : what is ...
by
Thaddy
[September 18, 2024, 05:44:34 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: TProcess ffmpeg freezes (Read 942 times)
domasz
Hero Member
Posts: 528
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: 803
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: 528
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: 803
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: 528
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: 803
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: 27
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
domasz
Hero Member
Posts: 528
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