PySceneDetect icon indicating copy to clipboard operation
PySceneDetect copied to clipboard

Support of input type "std input"

Open theojk1 opened this issue 1 year ago • 2 comments

Problem/Use Case

PySceneDetect is designed to process one input file only. Most of the files I want to process are splited in 1GB chunks (vob files).

Solutions

Other programs can be called with an input type std-input. Which means the frames of the video input are read from the std input and this is filled by a pipe by another program (in my case it would be vaporSynth).

Proposed Implementation:

I use this for the finale encoding of the videos with x265. This encoder program has a command "--input -" which tells it, to read from std input pipe instead of an input file

Alternatives:

Alternative would be the direct support of AviSynth-API. So the inputfile would be a AviSynth-Script file.

Examples: https://www.videolan.org/developers/x265.html https://www.vapoursynth.com/

theojk1 avatar Oct 06 '24 11:10 theojk1

This is possible with the Python API if you use the PyAV backend. How do you specify the pixel format when working with videos like this?

I'm open to integrating this into the command-line but I'm not that familiar with processing videos this way. It should be possible to create a new backend with the AviSynth Python API.

Breakthrough avatar Oct 18 '24 00:10 Breakthrough

Quick update: the latest version of the opencv-python package seems to support input from a byte stream now, so theoretically tthis should be possible with more backends soon.

For the time being input via stdin is not supported by the command-line. However, it is possible using the Python API and the PyAV backend using the path_or_io argument.

Breakthrough avatar Feb 01 '25 21:02 Breakthrough