Home › Forums › Syphon › Syphon Implementations – User › syphon piped to ffmpeg?
Tagged: syphon ffmpeg pipe streaming
- This topic has 8 replies, 2 voices, and was last updated 5 years, 8 months ago by
stanelie.
-
AuthorPosts
-
July 1, 2015 at 8:33 am #59027
stanelie
ParticipantHello.
Is there a way to get a syphon feed piped into ffmpeg? Something command-line like : syphon-client input 1 | ffmpeg -i i potato ?
This way, I could use ffmpeg to do streaming or transcoding of a syphon input…
Thanks!
July 1, 2015 at 9:37 am #59028vade
KeymasterHi – not that I am aware of currently, but thats actually an interesting idea.
July 1, 2015 at 9:42 am #59029stanelie
ParticipantAll I found so far is this :http://forum.processing.org/one/topic/sketch-video-catpure-with-ffmpeg-and-xuggle.html
Isn’t there something simpler? Is there a command line syphon client?
July 1, 2015 at 10:03 am #59030vade
KeymasterNope, no command line client, only because Syphon is optimized to run on the GPU, not CPU, which most UNIX style input pipes expect images in some sort of main memory format, so its a bit of a performance issue.
That said, I posted about it on twitter – maybe someone will make one?
You could give it a shot, if so inclined.
July 1, 2015 at 10:04 am #59031vade
KeymasterAt least, no client we have written or that I am aware of. Lots of folks make Syphon projects and we never know about it, sadly!
July 1, 2015 at 11:32 am #59032stanelie
ParticipantSorry,
I am not a coder, only a user…
🙂
July 1, 2015 at 2:29 pm #59033stanelie
ParticipantSo,
I ended up doing it myself using Processing. I know it’s a very ugly hack, but it works.
Here is the sketch : http://pastebin.com/znLrCBcL
It’s a blend of the ReceiveFrames example sketch that was included with the Syphon library for Processing, and this sketch from Jeffrey Thompson : http://www.jeffreythompson.org/blog/2012/01/26/creating-video-with-processing-and-ffmpeg/
Also, since I am using a temporary file to pass the frames from Processing to FFMPEG on each frame and I didn’t want to wear out my SSD drive, I first created a ramdisk onto which I commit and overwrite this file.
To create this ramdisk, in Terminal, do this :
DISK_ID=$(hdid -nomount ram://121440) && newfs_hfs -v tempdisk ${DISK_ID} && diskutil mount ${DISK_ID}July 1, 2015 at 2:33 pm #59034stanelie
ParticipantI forgot to say that the output of ffmpeg is a multicast network stream to be used with http://www.piwall.co.uk/ , if anyone cares.
So, in my case, Millumin to Syphon to Processing to FFmpeg to Big-Video-Wall-Made-Of-Lots-Of-TVs-Running-On-Raspberry-Pi
Latency is about 0.4 secs on my rig… Could be worse…
Yay!
July 3, 2015 at 4:28 pm #59036stanelie
ParticipantLooks like I spoke too fast : I only get 6-10 fps on my display machine after running through ffmpeg.
Guess I still need that command line syphon client… Oh well…
-
AuthorPosts
- You must be logged in to reply to this topic.