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
I can write your README.m...
by
PeterBB
[
Today
at 03:43:56 pm]
Break program and debug
by
Martin_fr
[
Today
at 03:41:35 pm]
FPC 3.2.2 + NASM Windows ...
by
paule32
[
Today
at 03:29:55 pm]
Lazarus Release 4.0
by
rcamprodon
[
Today
at 03:18:20 pm]
TBCFluentProgressRing bug
by
lainz
[
Today
at 02:57:30 pm]
Range check, converting e...
by
tetrastes
[
Today
at 02:42:33 pm]
Mandel3D and OpenGL
by
Boleeman
[
Today
at 02:11:27 pm]
Animated Oscillating Line...
by
Boleeman
[
Today
at 01:34:10 pm]
Practical Ways to Help La...
by
440bx
[
Today
at 01:32:05 pm]
TSynCompletion failing wh...
by
Martin_fr
[
Today
at 12:43:42 pm]
Pdf file size is huge wit...
by
meeeeeeeeee
[
Today
at 10:35:12 am]
Why isn't Lazarus / Free ...
by
alpine
[
Today
at 10:20:45 am]
BGRAGtkBitmap
by
circular
[
Today
at 09:52:07 am]
Anyone into mDNS?
by
MaxM74
[
Today
at 08:27:51 am]
Animated toggle switch
by
hedgehog
[
Today
at 07:37:00 am]
3D Dot Ball
by
Gigatron
[
Today
at 12:37:46 am]
A little bug in fpsimages...
by
wp
[May 15, 2025, 11:21:50 pm]
Feature request/suggestio...
by
440bx
[May 15, 2025, 10:37:14 pm]
A problem with ptcmouse
by
TBMan
[May 15, 2025, 09:40:51 pm]
Why there is no build-in ...
by
Nimbus
[May 15, 2025, 08:50:15 pm]
Feature request/suggestio...
by
440bx
[May 15, 2025, 07:58:33 pm]
Build mode Help button do...
by
440bx
[May 15, 2025, 07:54:27 pm]
How to convert TStrings t...
by
Remy Lebeau
[May 15, 2025, 06:35:35 pm]
[SOLVED] Added components...
by
Rico54
[May 15, 2025, 03:27:20 pm]
[SOLVED] How to "Jump To"...
by
paweld
[May 15, 2025, 02:40:52 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: TProcess ffmpeg freezes (Read 1290 times)
domasz
Hero Member
Posts: 575
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: 905
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: 575
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: 905
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: 575
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: 905
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: 33
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: 575
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