It is currently Mon Nov 12, 2018 7:12 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Converting C Language Pipes
PostPosted: Fri Nov 09, 2018 7:27 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Oct 24, 2005 1:05 pm
Posts: 682
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:

Code:

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);



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:
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)



Top
 Profile  
Reply with quote  
 Post subject: Re: Converting C Language Pipes
PostPosted: Fri Nov 09, 2018 7:53 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 1437
Location: Germany
The last parameter is the mode of "popen"...

Link: http://pubs.opengroup.org/onlinepubs/00 ... popen.html

You can remove it.

_________________
My Projects OOP-BaseClass / OOP-BaseClassDispatch / Event-Designer /
PB v3.30 / v5.60 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: Converting C Language Pipes
PostPosted: Sat Nov 10, 2018 3:00 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Oct 24, 2005 1:05 pm
Posts: 682
I think the "w" is equivalent to the #PB_Program_Write flag in PB's RunProgram().


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye