m1k1o / neko

A self hosted virtual browser that runs in docker and uses WebRTC.
https://neko.m1k1o.net/
Apache License 2.0
5.95k stars 449 forks source link

Save to file session recording #343

Open Falc0nreeper opened 8 months ago

Falc0nreeper commented 8 months ago

Hi I want to save session recording as mp4 or mkv via filesink. Is it possible to make via neko video pipeline ? My example was : ximagesrc display-name=%s show-pointer=true use-damage=false ! video/x-raw,framerate=30/1 ! videoconvert ! queue ! video/x-raw,format=NV12 ! x264enc threads=4 bitrate=3500 key-int-max=60 vbv-buf-capacity=4000 byte-stream=true tune=zerolatency speed-preset=veryfast ! video/x-h264,stream-format=byte-stream,profile=constrained-baseline ! mp4mux ! filesink location=output.mp4 May be this pipeline is wrong for google chrome gpu nvidia. Thanks)

m1k1o commented 8 months ago

Hi, yes it can be done using broadcast pipeline. You can try it locally in gstreamer and debug it, when it is working then you can put it to broadcast pipeline.

Falc0nreeper commented 8 months ago

I want to make session recorder without broadcast on server side.

Falc0nreeper commented 8 months ago

@m1k1o I have achieved session recording by video pipeline ximagesrc display-name=%s show-pointer=true use-damage=false ! video/x-raw,framerate=25/1 ! videoconvert ! queue ! video/x-raw,format=NV12 ! nvh264enc name=encoder preset=2 gop-size=25 spatial-aq=true temporal-aq=true bitrate=3072 vbv-buffer-size=3072 rc-mode=6 ! h264parse config-interval=-1 ! video/x-h264,stream-format=byte-stream,profile=constrained-baseline ! tee name=t t. ! queue ! filesink location=/tmp/output.h264 t. ! queue location can be changed by mounting and via nginx lua, we can create directory and pass location via lua This is only video without voice and it's enough for me :) If you want I can push some additional texts to docs about my test result

m1k1o commented 8 months ago

That would be great to have this documented. Thanks!