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 stream #15

Open
dsarel10 opened this issue May 17, 2021 · 9 comments
Open

RTSP stream #15

dsarel10 opened this issue May 17, 2021 · 9 comments

Comments

@dsarel10
Copy link

Is it possible to get a straight RTSP stream directly from the camera?

I'm able to view the stream with VLC, but cannot consume it on my NVR.

@FiveLeavesLeft
Copy link
Owner

FiveLeavesLeft commented May 17, 2021

No, I looked at that and it seemed pretty complicated. Maybe if I had a very simple generic RTSP sever written in C but I looked around and couldn't find one.

@dsarel10
Copy link
Author

Fair enough :)

@nijhawank
Copy link

Don’t know if this helps but have you looked at https://github.com/aler9/rtsp-simple-server

@gtxaspec
Copy link

take a look at what's used natively on other xiaomi based cameras (DaFang, Wyze, etc)
https://github.com/EliasKotlyar/Xiaomi-Dafang-Software/tree/master/v4l2rtspserver-master

@FiveLeavesLeft
Copy link
Owner

@gtxaspec , does that code compile and run on the wyze cam out of the box? Or is somehow incompatable with the wyze firmware?

@gtxaspec
Copy link

gtxaspec commented May 23, 2021

@FiveLeavesLeft from what I looked at, it does compile and run, but no video or audio on stock on the wyze cams (v2), due to the fact that:

  1. on stock, /dev/video can not be used by multiple programs (the iCamera app takes over the interface)

  2. on the rtsp firmware (v2) you can kill the included rtsp server and use this one if I remember correctly. video and audio located in /tmp using unix sockets.

on the v3 cams, haven't tried yet, but will assume no. 1 is the issue again.
edit: v3 uses /dev/dsp, /dev/framechan[0,1,or 2]

@juched78
Copy link

Wyze also shares their RTSP server from V2 cameras as open source code bundle.

Which file or device does this hack use to get access to the camera feed? I cannot find the source which opens the camera in this repo.

@FiveLeavesLeft
Copy link
Owner

No device or file, there's a function that returns each h264 frame, IMP_Encoder_GetStream, which iCamera loads from libimp.so. The hack wraps this function. The code that wraps it is in src/common.c IMP_Encoder_GetStream().

@juched78
Copy link

Ahh, I see that now. What I didn't realize is that iCamera uses libimp.so.

So, the RTSP server which wyze shares via GPL (https://s3-us-west-2.amazonaws.com/download.wyzecam.com/firmware/gpl/live-ini.zip) seems to read from a /tmp/ file:

char const* streamName = "live";
char const* inputFileName = "/tmp/";
char const* descriptionString
= "Session streamed by "wyze"";

So, if libimp.so hack used could stream to that file, then the wyze package RTSP could be used as an option.

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

No branches or pull requests

5 participants