Page 1 of 1

FFMPEG exits too fast!

Posted: Sun Feb 01, 2009 11:46 am
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...

Posted: Sun Feb 01, 2009 1:37 pm
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.

Posted: Sun Feb 01, 2009 2:54 pm
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