Closed ziserendexin closed 4 years ago
These are great suggestions, thank you! ✅ 🎉
I'm trying to find some time to actually refactor the whole codebase because right now it could use some decoupling (ok, a lot of decoupling... 😄 ). I think all of your suggestions have a great place in there.
However, I'm hesitant to add these changes right now because I feel like every change, even the little ones, makes the code quality considerable worse as I'm just hacking them into the code. I know that leaving these issues for now is also not the ideal solution, but I feel like it has to wait a little bit.
Ideally the refactor should happen sometime this month. End of December in worst case scenario.
These are great suggestions, thank you! ✅ 🎉
I'm trying to find some time to actually refactor the whole codebase because right now it could use some decoupling (ok, a lot of decoupling... 😄 ). I think all of your suggestions have a great place in there.
However, I'm hesitant to add these changes right now because I feel like every change, even the little ones, makes the code quality considerable worse as I'm just hacking them into the code. I know that leaving these issues for now is also not the ideal solution, but I feel like it has to wait a little bit.
Ideally the refactor should happen sometime this month. End of December in worst case scenario.
Building a good architecture is very important, waiting for your good news. 😘
Hey @ziserendexin I ended up fixing the issues I believe. With releasing v1.5.1 now restarting a stream should not cause any problems with non-existent paths. Same should be true with storing URLs for streams that failed to start.
Now with the restarting streams. Ideally when a user adds a new stream and it fails to start it should not be stored. This was definitely a bug. However if a stream once managed to start successfully, but either got an error or just got cleaned over time, I think it has a proper reason to stay stored. Now with invalidating this collection of stored streams over time is another question. Right now I don't see any problems with not doing any "decay" time.
Redirecting the cmd
output is possible currently, you just have to use the RTSP_PROCESS_LOGGING=true
env variable. This will create logs for all your steams under /var/log/rtsp-stream
(also configurable).
The last suggestion cannot be implemented in its form. Receiving back the original URI would mean that the service can start leaking authentication information. I could see this working in an environment where clients can set encryption tokens for their streams. This would be a secret stored next to the stream and it would be used to tokenise the original URI. Therefore clients that know the original secret for the stream can decrypt the original URI as well.
I found some bugs or improvements.
Restart
aftercleanUnused
and restart.ffmeg
create fail (time out).cmd.Stdout
andcmd.Stderr
to get more debug info. Instead ofexit status 1
This is detail info:
Should rebuild folder
Restart
aftercleanUnused
atrestart
.recurrent:
position:
createDirectoryForURI(p.storeDir)
infunc (p Processor) NewStream
:https://github.com/Roverr/rtsp-stream/blob/bda6df6d18d573b04ae29e778fdccf8882fa053c/core/streaming/processor.go#L98
strm.cleanDir()
infunc (strm *Stream) CleanProcess()
https://github.com/Roverr/rtsp-stream/blob/bda6df6d18d573b04ae29e778fdccf8882fa053c/core/streaming/stream.go#L32
But forget rebuild folder:
func (p Processor) Restart(strm *Stream, path string)
https://github.com/Roverr/rtsp-stream/blob/bda6df6d18d573b04ae29e778fdccf8882fa053c/core/streaming/processor.go#L138
Shouldn't save URL info in list when
ffmeg
create fail (time out).It's an unexist url.
After second send http:
Shouldn't save URL info in list when restart or get fail.
If get 404 or something else error, we should delete info in list.
Should redirect
cmd.Stdout
andcmd.Stderr
to get more debug info. Instead ofexit status 1
But I like this way:
I tried build this, and get error info in
rtsp-stream.err.log
.Add after here :
Maybe should save original url in list which http request.
At last, I love this post/get mode. It help me a lot.