I am now engaged in ffmpeg / node.js 8.9.4. I am to write a js script which converts a video stream into a raw image file and keeps on overwriting it. At the same time I'd like to get the sequential number of the frame from the begining of the convert process.
This program keeps on overwriting an image file, and other process is called to get this image file and its sequential number.
The ffmpeg option I wrote is below.
const ffmpeg = child_process.spawn('ffmpeg',[
"-i", stream_url,
"-rtsp_transport", "http",
"-pxm_fmt", 'rgb24',
"foobar.bmp"
]);
I know output file name option like "%05d" but I don't want to produce many image files.
Is it possible to get the sequential number of this outputted "foobar.bmp" by ffmpeg?
additional
I also found "drawtext=text=%{n}" option. This seems what I would like to get but I don't want to draw in the picture. How can I get the value into a variable?