jeffreydwalter / arlo

Python module for interacting with Netgear's Arlo camera system.
Apache License 2.0
520 stars 123 forks source link

Arlo GO - live streaming with rtsp/rtmps not working #119

Closed talshmo closed 5 years ago

talshmo commented 5 years ago

Please answer these questions before submitting your issue. Thanks!

What version of Python are you using (python -V)? Python 3.7.2

What operating system and processor architecture are you using (python -c 'import platform; print(platform.uname());')? name_result(system='Windows', node='Dell-Laptop', release='10', version='10.0.17763', machine='AMD64', processor='Intel64 Family 6 Model 78 Stepping 3, GenuineIntel')

Which Python packages do you have installed (run the pip freeze or pip3 freeze command and paste output)? arlo==1.2.18 beautifulsoup4==4.7.1 certifi==2018.1.18 cffi==1.12.1 chardet==3.0.4 ffmpeg==1.4 idna==2.6 monotonic==1.5 pipenv==2018.11.26 pycparser==2.19 PyJWT==1.7.1 PySocks==1.6.8 pytz==2018.9 requests==2.20.0 six==1.12.0 soupsieve==1.7.3 sseclient==0.0.22 twilio==6.24.1 urllib3==1.22 virtualenv==16.4.0 virtualenv-clone==0.5.1

Which Arlo hardware do you have (camera types - [Arlo, Pro, Q, etc.], basestation model, etc.)? Arlo Go VML4030

What did you do? If possible, provide the steps you took to reproduce the issue. A complete runnable program is good. (don't include your user/password or any sensitive info) Try Get Streaming Live, This Is MyCode (without the import and login):

###################################################################
try:

# Instantiating the Arlo object automatically calls Login(),
# which returns an oAuth token that gets cached.
# Subsequent successful calls to login will update the oAuth token.
arlo = Arlo(USERNAME, PASSWORD)
# At this point you're logged into Arlo.

# Get the list of devices and filter on device type to only get the cameras.
# This will return an array which includes all of the camera's associated metadata.
cameras = arlo.GetDevices('camera')

# Get the list of devices and filter on device type to only get the basestation.
# This will return an array which includes all of the basestation's associated metadata.
#basestations = arlo.GetDevices('basestation')

# Open the event stream to act as a keep-alive for our stream.
arlo.Subscribe(cameras[0])

# Send the command to start the stream and return the stream url.
url = arlo.StartStream(cameras[0], cameras[0])
#print(url)
# Record the stream to a file named 'test.mp4'.
# **Requires ffmpeg 3.4 or greater.**
# For this example, I'm going to open ffmpeg.
# Crucially important is the '-t' flag, which specifies a recording time. (See the ffmpeg documentation.)
# This is just a crude example, but hopefully it will give you some ideas.
# You can use any number of libraries to do the actual streaming. OpenCV or VLC are both good choices. 
# NOTE: This will print the output of ffmpeg to STDOUT/STDERR. If you don't want that, you will
# need to pass additional arguments to handle those streams.

call(['ffmpeg', '-re', '-i', url, '-t', '10', '-acodec', 'copy', '-vcodec', 'copy', 'test.mp4'])
except Exception as e:
print(e)

#############################################

What did you expect to see? rtsp or video

What did you see instead?

C:\arlo-master\examples>arlogo-streamingvideo.py
ffmpeg version N-74313-g9c0407e Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.3 (GCC)
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 30.100 / 54. 30.100
libavcodec 56. 57.100 / 56. 57.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 32.100 / 5. 32.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
rtsps://vzwow78-z1-prod.ar.arlo.com:443/vzmodulelive/51D2857DA0A77_1550490057135?egressToken=c08b5dbb_59fa_4955_934d_d9335038f364&userAgent=iOS&cameraId=51D2857DA0A77_1550490057135: Operation not permitted

Does this issue reproduce with the latest release? yes

jeffreydwalter commented 5 years ago

@talshmo get rid of the call to Subscribe().

I suspect the problem is with your version of ffmpeg. In your original comment, it appears you're using some weird version of ffmpeg:

C:\arlo-master\examples>arlogo-streamingvideo.py
ffmpeg version N-74313-g9c0407e Copyright (c) 2000-2015 the FFmpeg developers

I'm using ffmpeg 4.1.1 on macOS. It works fine for me.

$ ffmpeg -version
ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
libavutil      56. 22.100 / 56. 22.100
libavcodec     58. 35.100 / 58. 35.100
libavformat    58. 20.100 / 58. 20.100
libavdevice    58.  5.100 / 58.  5.100
libavfilter     7. 40.101 /  7. 40.101
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  3.100 /  5.  3.100
libswresample   3.  3.100 /  3.  3.100
libpostproc    55.  3.100 / 55.  3.100

Please try to install ffmpeg 4.1.1.

talshmo commented 5 years ago

@talshmo get rid of the call to Subscribe().

I suspect the problem is with your version of ffmpeg. In your original comment, it appears you're using some weird version of ffmpeg:

C:\arlo-master\examples>arlogo-streamingvideo.py
ffmpeg version N-74313-g9c0407e Copyright (c) 2000-2015 the FFmpeg developers

I'm using ffmpeg 4.1.1 on macOS. It works fine for me.

$ ffmpeg -version
ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
libavutil      56. 22.100 / 56. 22.100
libavcodec     58. 35.100 / 58. 35.100
libavformat    58. 20.100 / 58. 20.100
libavdevice    58.  5.100 / 58.  5.100
libavfilter     7. 40.101 /  7. 40.101
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  3.100 /  5.  3.100
libswresample   3.  3.100 /  3.  3.100
libpostproc    55.  3.100 / 55.  3.100

Please try to install ffmpeg 4.1.1.

Thanks very much jeffreydwalter. Live Streaming with ffmpeg 4.1.1 is working perfect!