FFMPEG exits too fast!

Everything else that doesn't fall into one of the other PB categories.
Seymour Clufley
Addict
Addict
Posts: 1264
Joined: Wed Feb 28, 2007 9:13 am
Location: London

FFMPEG exits too fast!

Post by Seymour Clufley »

I'm experimenting with FFMPEG but I'm having trouble for one simple reason: the console window opens and closes faster than I can read its titlebar, let alone the console text.

The reason I need to read the text is I'm running FFMPEG using the RunProgram command, and something is going wrong with the job I'm asking it to do. So I need to see its report if I'm to analyse the error.

The weird thing is other FFMPEG users are able to report the text the program puts it in its console window. I presume this may have something to do with how they run the program - from command line as opposed to an equivalent of RunProgram.

Thinking of a "solution" to this, is there any way to stop a program from terminating for a given length of time?

Failing that, is there any way you can think of to "get" the console window's text in the split second that said window is open?

Launching FFMPEG with #PB_Program_Read/Error and using ReadProgramString/Error doesn't return anything except a blank string, even when I use AvailableProgramOutput...
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Compile your program as a console application and run it from the console. That way ffmpeg's console output should end up in "your" console, which won't close itself.
buzzqw
Enthusiast
Enthusiast
Posts: 116
Joined: Sat Aug 27, 2005 10:13 pm
Location: Italy
Contact:

Post by buzzqw »

you can read ffmpeg output without big problem

Code: Select all

 wait=RunProgram("ffmpeg.exe"," -version ","",#PB_Program_Open|#PB_Program_Error|#PB_Program_Hide)

  While ProgramRunning(wait)

    line.s=ReadProgramError(wait)

    If FindString(line.s,"FFmpeg version",0)

     debug("Using "+StringField(line.s,1,","))

    EndIf

  Wend

  WaitProgram(wait)
BHH
Post Reply