[Cin] You also can use fifo file and external encoder with cingg

Andrew Randrianasulu randrianasulu at gmail.com
Tue Jul 16 18:30:43 CEST 2024


вт, 16 июл. 2024 г., 19:12 Terje J. Hanssen <terjejhanssen at gmail.com>:

>
>
> Den 16.07.2024 12:54, skrev Andrew Randrianasulu:
>
> Like this:
>
>  mkfifo /dev/shm/renderfarm.y4m <-- random name from previous test
>
> cin /home/admin/huawei_matepad_t/sdcard1/video/20200101_000443A.mp4
>
> ............
>
> encoded 397 frames in 400.09s (0.99 fps), 4154.67 kb/s, Avg QP:32.22
>
> =====
>
> Initially i set cingg cache to low value like 16 Mb and  render
> aborted at around 8 sec, then I set cache to 256 Mb and it finished
> for complete 13 seconds/ 397 frames....
>
> So, you can use external ffmpeg (and its array of encoders), or x265
> directly this way. (if you use normal file it will be 4.7 Gb per 13
> seconds of 4k30 video ...)
>
>
> The principle sounds interestingly. Although I'm used with simple pipes, I
> have never used fifo file (name pipes).
> But a real case ("workshop") example could make it clearer for me.
>
> 1. Will it be applicable for pre-built CinGG installed from appimages, or
> from packages (einander) where "cin" can be started in a terminal ?
>

it should work in both, I tested this on system-wide installed ffmpeg-4.4 +
cingg compiled statically with ffmpeg 7.0 and installed in /usr



> 2. And let CinGG utilize my "system" ffmpeg (from Packman) for qsv gpu
> hwaccel encoding?
>
> ffmpeg -hide_banner -encoders | grep qsv
>  V..... av1_qsv              AV1 (Intel Quick Sync Video acceleration)
> (codec av1)
>  V..... h264_qsv             H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
> (Intel Quick Sync Video acceleration) (codec h264)
>  V..... hevc_qsv             HEVC (Intel Quick Sync Video acceleration)
> (codec hevc)
>  V..... mjpeg_qsv            MJPEG (Intel Quick Sync Video acceleration)
> (codec mjpeg)
>  V..... mpeg2_qsv            MPEG-2 video (Intel Quick Sync Video
> acceleration) (codec mpeg2video)
>  V..... vp9_qsv              VP9 video (Intel Quick Sync Video
> acceleration) (codec vp9)
>
>

well, just replace input file (after -i param)  for your system ffmpeg
encode command line with this named fifo .....


>
> 3. Suggestion to this pipe line setup and running av1_qsv encoding from
> CinGG Render .webm?
>
>
I do not think you can run it as webm, unless you want to encode both audio
and video into single "output" stream ? Not sure, may be vc2 video codec
(Dirac from BBC research) can be used for this? Encoding at cingg end and
decoding at ffmpeg's input probably will slow down whole process too much
....

General idea is to output video-only stream via y4m fifo, and then add
audio exported separately.

y4m is simple uncompressed video format, designed for interoperability
between mjpegtools and other programs initially. Basically simple header
telling programs frame size, pixel arrangement, fps ....

I suggest to open two tabs in something like Konsole and make fifo file
somewhere you easily can delete it ...

I used /dev/shm, that should be tmpfs in ram.

you create fifo, then run cin from same terminal, load your video, set
render to ffmpeg, y4m and select as output filename just created fifo file.
Then hit render. Everything here will wait until you connect ffmpeg from
another terminal tab to same fifo

You can just copy-paste your ffmpeg test command  and edit/replace filename
after "-i" with fifo filename.

With real fake  4k stream it was too slow for filming (screenrecording) at
6 min 40 sec, may he I'll try with 320*240 test file :)



>
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20240716/21716be2/attachment.htm>


More information about the Cin mailing list