Piping support

  • This would be absolutely lovely, I recall back in the early days of unix commandline codecs, we had the ultra-flexible option to piping data around through own custom scripts/executables, everything talked to everything by platform design, then Windows came along and began creating brickwalls.


    Let's say the ability to pipe out via stdout to a custom application of our choosing. So say in the encoders list we just select 'custom' and then type in a freetext commandline, independent for video and audio, this way advanced users can use their own custom workflow with the plugin.

    Kind of stems off the back of the other feature request which got rejected because it was outside the scope of Voukoder's purpose.

    I guess from a development perspective all it would require is instantiating a stdout to a shell running the commandline entered by user.

    This will make Voukoder very flexible going forward, I have a fair few dozen python scripts which already work off stdout from ffmpeg itself, so I could chain in this way for a very specific workflow straight out of the premiere export door all thanks to Voukoder giving techs backdoor access to the streams.

    Though I can imagine some in the future might request a raw multiplexed outgoing stream, so say FFMPEG just packages and shunts it out the door to stdout where whatever custom program or even say a script running its own ffmpeg process then does wierd and wonderful things for bespoke workflow requirements.

  • Pretty much indeed. FFMPEG is most popular because of its piping ability, incoming and outgoing. It would be only fitting to grant Voukoder the privilege of becoming the new frameserver as well as the gateway to much needed codecs.

    I believe the '-f nut' is a multiplexed format of audio and video which ffmpeg can serve to another ffmpeg instance nicely at breakneck speed via the pipe, then at that point one could do de-multiplex, split and dice and do whatever wonderful things they need, so we never restrict pipe format as such, we basically give the end-user to then do whatever process they want with a shell ffmpeg instance, and yes you got it, Avisynth can be part and parcel of any user workflow at their end.

  • I do not like AviSynth because it is serving the frames using the filesystem and that is really slow. Piping would do this in memory and should be faster.

    But maybe this could be a separate plugin.

    And the connected tools would all run in the AdobePremierePro.exe process.

  • AVIsynth is just one possibiliy of many later down the chain, no relation to Voukoder so totally up to whatever user wants to do.

    I think because you are using the FFMPEG C Api, and 'nut' format is part of FFMPEG, all we'd need is piping support so it can stay as part of Voukoder as it will rely on the FFMPEG C API so will always be integral.

    Its a flexibility option for those who want to do more and shouldn't really impact the existing functionality of the plugin. Keeping it all as one plugin is I think the wisest direction because it is then all one codebase and Voukoder becomes the defacto plugin for all things output, granting a great deal of flexibility which will gain serious recognition as then other developers can write a variety of applications to hook onto the pipe output of Voukoder.

    Let's call Voukoder the mother of exports for the Adobe universe.

    I was just reading up on c++ piping, and it does look rather trivial as a construct... you probably already seen this doc https://docs.microsoft.com/en-…me-library/reference/pipe

    Have a quick snap at piping from Voukoder out to a shell instance running ffmpeg instantiated by voukoder, the instance being :

    ffmpeg -i - -vcodec libx264 -acodec libfdk_aac -vb 1200k -ab 96k testout.mkv

    On the Voukoder side, set the config to match the commandline "-pix_fmt rgb32 -vcodec rawvideo -acodec pcm_s16le -f nut" as an example and analyse the proof of concept, if it works nicely, eureka! :)

    I look forward to seeing the state change to 'investigating'... this would be a very powerful feature with endless possibilities.

  • Vouk

    Added the Label Investigating
  • Prototyping done.

    I was able able to pipe the video to ffplay.exe and i saw the video playing. But once the export ended ffplay did not stop and had to be terminated with CTRL-C.

    So basically this is working. But if the output format does not match the ffplay input format (i.e. frame size) premiere does not respond anymore and waits until eternity.

    Edit: Something like ...

    c:\ffplay.exe -f rawvideo -pixel_format bgra -video_size 1920x1080 -autoexit -framerate 60 -

    ... works fine!

  • Vouk

    Set the Label from Investigating to Planned
  • Prototyping done.

    ... works fine!

    Excellent stuff!!!

    This will mean we will finally have a modern spec Frameserver, and pretty much every application Voukoder plugin supports too.

    I already have a basic GUI which I use for adhoc tasks, I'll start adding some incoming piping logic to it and get ready for the beta :D

    Yes the receiving stage needs its config to match the spec of the ffmpeg pipe in order for this to work. As long as Voukoder can provide a dropdown to select pixel format and audio sample format for the pipe, then that is all that's needed... on the receiver side I'll simply have the same dropdowns to match, and then the workflow logic takes over from that point onwards.

    Great news my friend!

  • Instead of adding new features and new bugs could you go fix old ones first?

    My opinion has always been that open source projects have to be motivational to keep devs working on them out of their free-time and of course any financial support goes a long way if one is using their work in any profit making process. If the bugs are on the list, I'm sure they will get fixed... it's like putting a house together, as long as the foundations are there, it's just a matter of time and priorities, but builders need motivation... especially those doing it without any quantifiable income covering their efforts. If there's a bug you need fixing yesterday, throw over a little incentive in the form of currency or maybe even a starbucks coupon... I did that once on a project years ago, just for a coffee I got a pile of bugs fixed and some features added too!

    ps it was a very good coffee!

  • Vouk

    Set the Label from Planned to Implementing
  • Ok, I can confirm it works!

    Did you add the drop-down lists for selecting pixel format and audio format for the output pipe? cannot see them in the export panel unless my eyes are playing silly monkeys.

    I'm currently just cleaning up my workflow gui, will throw up a link to the gui when I've simplified it for advanced end-users.

    WOW... it is like a whole new world of possibilities has opened up!!!!

  • Vouk

    Set the Label from Implementing to Done
  • Not a single bug, everything works as it should.

    Only just one little requirement...

    Would be really nice to have the ability to cancel the export from the external process, maybe a numbered pipe which the process can send something like "QUIT", to allow for a clean cancellation of encode, at the moment it locks up Adobe completely if the process is closed whilst pipe is active.

    Any thoughts?