jsmpeg icon indicating copy to clipboard operation
jsmpeg copied to clipboard

implement python lib for decode and display the video

Open eaphone opened this issue 4 months ago • 2 comments

hi, this project is awesome with its low latency. i am wondering if it is possible to use python to decode and display the video stream locally instead of using js(web)

do you have any idea or suggestion?

eaphone avatar Mar 01 '24 09:03 eaphone

i am using the whole project for showing the stream at web. additionally, i also want to display the streaming with python to integrate with my exist python automation script. my python script is able to communicate to the websocket-relay server and got raw stream data. however, i got trouble at decoding the stream.

eaphone avatar Mar 01 '24 09:03 eaphone

I don't write much python, but I believe you could use pl_mpeg via FFI in python to decode the video and audio packets.

pl_mpeg doesn't come with an MPEG-TS demuxer (only MPEG-PS), so you'd have to write this part yourself. The MPEG-TS demuxer here is only 200 lines; TS shitty format, but not too complicated.

phoboslab avatar Mar 02 '24 10:03 phoboslab