syphon piped to ffmpeg?

Home Forums Syphon Syphon Implementations – User syphon piped to ffmpeg?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #59027
    stanelie
    Participant

    Hello.

    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!

    #59028
    vade
    Keymaster

    Hi – not that I am aware of currently, but thats actually an interesting idea.

    #59029
    stanelie
    Participant

    All 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?

    #59030
    vade
    Keymaster

    Nope, 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.

    #59031
    vade
    Keymaster

    At 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!

    #59032
    stanelie
    Participant

    Sorry,

    I am not a coder, only a user…

    🙂

    #59033
    stanelie
    Participant

    So,

    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}

    #59034
    stanelie
    Participant

    I 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!

    #59036
    stanelie
    Participant

    Looks 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…

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.