Giuseppe De Marco, demarcog83 at gmail.com
forked from
https://pypi.python.org/pypi/live555/1.0
Mike McCandless, mikemccand at gmail.com
This contains a small Python3 wrapper around the Live555 Streaming Media APIs, so that you can load video frames. It only wraps a tiny, tiny subset of all of Live555's APIs, specifically the APIs necessary to pull frames via RTSP/RTP from an IP camera.
Mike McCandless tested on Linux with the surprisingly
excellent Lorex LNB2151/LNB2153 cameras, with H264 video.
I only tested with ipcam Maygion h264, not so surprising as camera but works.
INSTRUCTIONS:
-
First install the Live555 library from Debian repository
aptitude install livemedia-utils liblivemedia-dev python3 python3-dev python3-pip -
Download/clone this repo
-
then
python3 setup.py build python3 setup.py install -
Run the example (some costants should be configured in example.py)
python3 example.py 10.17.4.118 1 10 out.264That will record 10 seconds of H264 video from the camera at
10.17.4.118, channel 1, saving it to the file out.264.
This forge two files: video-H264-1 and audio-PCMU-2
openRTSP rtsp://admin:passwd@10.87.7.10:80
Then convert it in a viewable format
...only video
ffmpeg -i video-H264-1 -acodec copy -vcodec copy -map 0:0 merged.mp4
... or video and audio
ffmpeg -i video-H264-1 -i audio-PCMU-2 -acodec copy -vcodec copy -map 0:0 -map 1:0 merged.mp4
vlc -I dummy rtsp://admin:passwdk@10.87.7.10:80 --sout=file/ts:mystream.mpg