Maybe you have to wait until ffmpeg is returning the result. ReadProgramData() does not wait until the given buffer is full. You may have to read data until ProgramRunning() returns #False. Then you've got all the data you are looking for.
Maybe so:
Code:
pipeIn$ = "-i " + filename$ + " -f image2pipe -s 1280x720 -pix_fmt rgb24 -r 59.94 -vf zscale=in_range=limited:out_range=limited -vcodec rawvideo -"
;readFrame = RunProgram("/usr/bin/ffmpeg", pipeIn$,"/home/chris/PureBasic/source/",#PB_Program_Open | #PB_Program_Read)
readFrame = RunProgram("ffmpeg", pipeIn$,"",#PB_Program_Open | #PB_Program_Read)
If readFrame = 0
MessageRequester("Error", "unable to open pipe")
End
Else
MessageRequester("Success","Pipe opened")
EndIf
bytesReadSum.i = 0
bytesRead.i = 0
While ProgramRunning(readFrame)
bytesRead = ReadProgramData(readFrame, @frame(0), #H * #W * 3)
If bytesRead :
bytesReadSum + bytesRead
Debug bytesReadSum
EndIf
Next
But of course this will not work together with your frame array. You have to change more than I did.