ionorg / ion-avp

Audio/Video Processing Service
MIT License
61 stars 18 forks source link

WebmSaver produces broken files. #220

Open aromancev opened 3 years ago

aromancev commented 3 years ago

Your environment.

Everything is running on a local machine, so network issues are unlikely to be the reason.

Config:

AudioMaxLate: 100
VideoMaxLate: 200
MaxLateTimeMs: 1000
PLICycle: 1000

What did you do?

  1. Set avp to process a track id.
  2. Start publishing the track.
  3. Leave the session (close browser tab, for example) within ~5s of joining.

What did you expect?

A readable file of the correct duration is produced.

What happened?

An invalid webm is produced. Can't be opened by browser or VLC. The binary size is always exactly 440 bytes.

I suspect this is because of some concurrency issue, but I can't put my finger on it. Isn't it supposed to work even if a peer has joined for a short duration? If this helps, ffmpeg conversion produces this error:

[matroska,webm @ 0x7ff34b815a00] Duplicate element
[matroska,webm @ 0x7ff34b815a00] Element at 0x41 ending at 0x34e01 exceeds containing master element ending at 0x13ed
[matroska,webm @ 0x7ff34b815a00] Duplicate element
[matroska,webm @ 0x7ff34b815a00] Element at 0x50 ending at 0x6f4e10 exceeds containing master element ending at 0x13fc
[matroska,webm @ 0x7ff34b815a00] Element at 0x5f ending at 0x4f0ecb3 exceeds containing master element ending at 0x140b
test.webm: End of file

Thanks for the help!

tarrencev commented 3 years ago

hi @aromancev, we are no longer maintaining the avp. A better approach is to use the go sdk and gstreamer to record the sfu feeds. You can see an example here: https://github.com/pion/ion-sdk-go/tree/master/example/ion-sfu-gstreamer-receive. Please join us in #ion in the gophers slack if you have questions

var-rain commented 3 years ago

The problem is that after webmsaver recording starts, webmsaver does not write EOF when the video stream has been disconnected, and the file is occupied when ion-avp is not stopped.

aromancev commented 3 years ago

hi @aromancev, we are no longer maintaining the avp. A better approach is to use the go sdk and gstreamer to record the sfu feeds. You can see an example here: https://github.com/pion/ion-sdk-go/tree/master/example/ion-sfu-gstreamer-receive. Please join us in #ion in the gophers slack if you have questions

Oh, that's a bummer. Thanks for the tip though!

Maybe we should slap "DEPRECATED, use ion-sdk" at the top of the readme?