Converting C Language Pipes
Posted: Fri Nov 09, 2018 7:27 pm
I'm having trouble getting this C code converted and running in PB. It uses ffmpeg to read and write video frames. I can get the "read" part to work but I'm having trouble with the "write" part:
I'm not sure how to handle the "w" at the end of the above line.
This is what I have so far in PB:
Code: Select all
FILE *pipeout = popen("ffmpeg -y -f rawvideo -vcodec rawvideo -pix_fmt rgb24 -s 1280x720 -r 25 -i - -f mp4 -q:v 5 -an -vcodec mpeg4 output.mp4", "w");
fwrite(frame, 1, H*W*3, pipeout);
This is what I have so far in PB:
Code: Select all
pipeout$ = " -y -f rawvideo -vcodec rawvideo -pix_fmt rgb24 -s 1280x720 -r 25 -i - -f mp4 -q:v 5 -an -vcodec mpeg4 output.mp4" + "w"
writeFrame = RunProgram("ffmpeg.exe", pipeOut$, "", #PB_Program_Open | #PB_Program_Write)