Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTSP video is distorted with FFmpegFrameGrabber #2222

Open
nickgitnick opened this issue Apr 23, 2024 · 0 comments
Open

RTSP video is distorted with FFmpegFrameGrabber #2222

nickgitnick opened this issue Apr 23, 2024 · 0 comments

Comments

@nickgitnick
Copy link

nickgitnick commented Apr 23, 2024

When using FFmpegFrameGrabber with a wifi camera, the images can have lots of artifacts. here's an example:
Screenshot_20240417_151528_TRUCE

this is the code I am using

FFmpegLogCallback.set()
log("attempting connection to $url")
val grabber = FFmpegFrameGrabber(url)
grabber.imageHeight = 480
grabber.imageWidth = 848
grabber.format = "rtsp"
grabber.videoCodecName = "h264_mediacodec"
grabber.frameRate = 30.0
grabber.sampleRate = 30
grabber.start()
while (alive) {
    val frame = grabber.grabImage()
    showPreview(frame)
}

I'm wondering if there are any tweaks that can clean the video up a bit / handle missed packets better? Specifying TCP with

grabber.options["rtsp_transport"] = "tcp"

makes the image cleaner but I am running into another issue where the video stops after 30 seconds: #2218

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants