geekman / t20-rtspd

RTSP server + Ingenic T20 SDK
28 stars 16 forks source link

Some Minor Error Message #1

Closed aminhusni closed 4 years ago

aminhusni commented 4 years ago

Device: Xiaofang S1 2019 Running for an hour. Killed the original rtsp server. I loaded the binary.

MultiFramedRTPSink::afterGettingFrame1(): The input frame data was too large for our buffer size (601316). 2228944 bytes of trailing data was dropped! Correct this by increasing "OutPacketBuffer::maxSize" to at least 2828944, *before* creating this 'RTPSink'. (Current value is 600000.)

I might consider running this binary in the meantime because the original binary from https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks is not stable (always crashes and getting cuts and inconsistent stream).

Does this binary have an OSD function? I read the codes but can't tell what arguments it is accepting as options.

geekman commented 4 years ago

Does this binary have an OSD function? I read the codes but can't tell what arguments it is accepting as options.

No it does not have OSD. That takes quite a lot of work to add because it needs to render the actual letters onto the OSD layer. It also doesn't accept any parameters, because I hacked this up as a PoC and just left it running as is.

I think the real solution is to actually add the code into the main rtspserver from the Dafang Hacks and activate the code only when it detects it's on a low memory variant like the T20L. I haven't really had the time to do that yet, but I might do that eventually.

This existing RTSP server that I'm using here is not that great either. If I have time I might also replace that, but as I said, haven't had time to get around to that yet ☹️

aminhusni commented 4 years ago

This existing RTSP server that I'm using here is not that great either. If I have time I might also replace that, but as I said, haven't had time to get around to that yet ☹️

I was actually reading the sample codes inside imp-common.c and studied it a bit. I might want to probably just compile my own version with settings specific for me first then probably rewrite it for general use later on.

The original RTSP server that is supplied by the CFW is just unusable at all for me. Stream keeps dropping out and keeps crashing.

aminhusni commented 4 years ago

Managed to get OSD to just work. I'll probably file a pull request later when I properly set it up.

2019-10-14 13_25_06-Window

2019-10-14 13_42_58-rtsp___192 168 0 33_stream - VLC media player

tERB00 commented 4 years ago

According to T20's SOC description it have built-in 5-layer OSD feature as well as other fancy stuff like 3D image denoise, audio compression and so on. So we don't need to render anything by ourselves - it should be done by processor.

aminhusni commented 4 years ago

According to T20's SOC description it have built-in 5-layer OSD feature as well as other fancy stuff like 3D image denoise, audio compression and so on. So we don't need to render anything by ourselves - it should be done by processor. @tERB00

I just got the OSD to work. @geekman was right, you need to actually render the OSD yourself. You do this by providing a BGRA array to render each individual letters onto the OSD layer. Maybe you should give it a try to code it yourself and see how it really works.

I am currently fixing the night mode to work with the external script that is supplied by the original CFW by Elias Kotlyar. It is certainly limited and not a fully-featured RTSP server like the original one but it does the job in a pretty lightweight manner just as a proof of concept. I am going to eventually write a new set of codes to accept config files and such to adjust various stuff.

I increased the bitrate to 5000-7000kbps and did some tuning to get it acceptable. Truth is, 1080p is very resource-intensive so I had to settle on some balance. Dropped the FPS down from 15 to 10 FPS to get a stable output without straining the encoder that it is struggling to keep up with the bitrate.

2019-10-15 02_17_47-rtsp___192 168 0 33_stream - VLC media player

tERB00 commented 4 years ago

@aminhusni Yeah, the original firmware is doing 10fps on 1080p so you are pretty close. I'm browsing SDK right now trying to find some parameters to enable long exposure for the night mode. If I find something maybe I'll compile this too...