mirror of
https://github.com/flavioribeiro/donut.git
synced 2025-10-20 05:35:16 +08:00
57 lines
3.2 KiB
Markdown
57 lines
3.2 KiB
Markdown
# Adding audio
|
|
|
|
## Date: 2/4/24
|
|
### Summary: Adding audio track
|
|
|
|
refs:
|
|
* webrtc discussion https://github.com/pion/webrtc/discussions/1955
|
|
* go webrtc example https://github.com/pion/webrtc/blob/master/examples/play-from-disk-renegotiation/main.go
|
|
* webrtc discussion https://stackoverflow.com/questions/66243915/how-to-get-multiple-streams-from-webrtc-peerconnection
|
|
* golang libav https://github.com/giorgisio/goav/blob/master/example/tutorial01.go#L69
|
|
* libav transcoding example gshttps://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/transcode.c#L158
|
|
* libav network example https://github.com/FFmpeg/FFmpgseg/blob/master/doc/examples/avio_http_serve_files.c#L116
|
|
* libav avio example https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/avio_read_callback.c#L95
|
|
* example https://blog.mi.hdm-stuttgart.de/index.php/2018/03/21/livestreaming-with-libav-tutorial-part-2/
|
|
* libav doc https://ffmpeg.org/doxygen/trunk/index.html
|
|
* generic av format https://github.com/rvs/ffmpeg/blob/master/libavformat/output-example.c
|
|
|
|
# Moving player to static
|
|
|
|
## Date: 2/3/24
|
|
### Hypothesis: It's easy to do experimentation with local player
|
|
### Summary
|
|
|
|
Copy and adapt code from https://github.com/flavioribeiro/donut-video into static/demo/
|
|
|
|
# Investigating a potential memory leak
|
|
|
|
## Date: 2/2/24
|
|
### Hypothesis: There's a memory leak happening
|
|
### Signs: pprof/allocs
|
|

|
|
### Summary
|
|
|
|
* Start the donut `make run`,
|
|
* Check the general profiling http://localhost:6060/debug/pprof/?debug=1
|
|
* Keep refreshing the page, notice that the counters: heap, goroutine, threadcreate are stable
|
|
* Access the the demo http://localhost:8080/
|
|
* Go back to the profiling page http://localhost:6060/debug/pprof/?debug=1
|
|
* Notice that the prof counters are stable, regardless if you refresh multiple times
|
|
* Now click on `[Connect]`
|
|
* Observe how the perf counters go up http://localhost:6060/debug/pprof/?debug=1
|
|
* Keep refreshing the http://localhost:6060/debug/pprof/? and you'll see that the counters `goroutine` and `threacreate` **are stable** but `heap` and `allocs` **counters are growing**.
|
|
* You can check the specific heap page as well http://localhost:6060/debug/pprof/heap?debug=1
|
|
* You can run the command `go tool pprof http://localhost:6060/debug/pprof/heap` and type `web`, it'll generate a svg tree map of heap.
|
|
* Snapshot 1 at time `Start + 4 m`
|
|
* 
|
|
* Snapshot 2 at time `Start + 15 m`
|
|
* 
|
|
* Snapshot 2 at time `Start + 8 h`
|
|
* 
|
|
* Docker stats `docker stats` at `Start`
|
|
* 
|
|
* Docker stats `docker stats` at `Start + 10m`
|
|
* 
|
|
|
|
> ref: https://go101.org/article/memory-leaking.html
|
|
### Conclusion: there's not leak, I confused allocs growing nature. |