Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

RTSP not closing files #28

Open
tetherit opened this issue Apr 8, 2016 · 2 comments
Open

RTSP not closing files #28

tetherit opened this issue Apr 8, 2016 · 2 comments

Comments

@tetherit
Copy link

tetherit commented Apr 8, 2016

When I do:

rtsp = RTSP::Client.new('rtsp://192.168.88.13/media/video2')
rtsp = nil

When I look at open files, the file is never closed. This causes the system to show too many open files error after a while when reading from many sources:

$ lsof -n | grep -i rtp
ruby      99606 Hackeron   18u     REG                1,2          0 47716079 /private/var/folders/jz/tbfhr91s2p53sx93zbbxb9jw0000gn/T/rtp_capture.raw20160408-99606-1c2kusy

Any ideas how to make sure the file is closed?

@turboladen
Copy link
Owner

It's been a while since I've looked at this code, but you might be able to tell RTSP to use a Tempfile as a capture file. In this example, you can see how to specify a specific file for the rtp_file--you might be able to use a Tempfile in that case, and that'd get cleaned up after use.

@tetherit
Copy link
Author

tetherit commented May 4, 2016

I ended up doing this:

        rtsp = RTSP::Client.new(url)
        ... more code here ...
        rtsp.capturer.capture_file.close

@tetherit tetherit closed this as completed May 4, 2016
@tetherit tetherit reopened this May 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant