javacv recording camera playback stream to mp4 file, at the end there was a pause of nearly two minutes
#1,904 opened on Oct 9, 2022
Repository metrics
- Stars
- (6,985 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
I now want to record the fixed time rtsp playback stream of the camera as an mp4 file. When I experimented (tcp and udp), I found that there was a pause at the end of the code execution for almost two minutes before the program ended, but the mp4 file was intact, I don't know why this happened. So I compared the javacv program execution with the vlc player playing the rtsp stream to capture packets. Here is the packet capture image:
The first diagram is javacv and the second diagram is vlc
In both cases, the server (camera) finally sends an ANNOUNCE rtsp command:
In the javacv scenario: the client (javacv) will recover the 501 status code, and then the server will send the "Unknown RTP version 0" message all the time, and after nearly two minutes, the final connection is actively closed by the server
In the VLC scenario: VLC will reply with a 405 status code, and the connection will be closed correctly later
Thank you so much