Closed Nidheeshv0312 closed 3 years ago
var options = {
wsURL: "ws://host:port/rtspoverwebsocket",
rtspURL: "rtsp://host:port/cam/realmonitor?channel=1&subtype=0",
username: "",
password: ""
}
Could u please tell me how to use the webpack to compile this code
@Nidheeshv0312 I have updated the code. Run
npm run build
to build the code and then serve the dist folder
i removed the webpack from my ububtu system and ran the above command, am getting the below ERROR in Error: The loader "dahua-stream-video/node_modules/html-webpack-plugin/lib/loader.js!/dahua-stre am-video/src/index.html" didn't return html.
index.js:336 HtmlWebpackPlugin.evaluateCompilationResult [dahua-stream-video]/[html-webpack-plugin]/index.js:336:24
index.js:243 [dahua-stream-video]/[html-webpack-plugin]/index.js:243:22
task_queues.js:95 processTicksAndRejections internal/process/task_queues.js:95:5
async Promise.all
async Promise.all
webpack 5.37.1 compiled with 1 error and 3 warnings in 19734 ms
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rtsp-over-ws@1.0.0 build: webpack
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the rtsp-over-ws@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Have you installed the dependencies? Don't remove webpack. The above said build command uses webpack for building the project.
Install dependencies
npm i
Run build command
npm run build
Also please confirm if your camera model supports rtsp over websocket
One thing what i found was, there is a space between the below highlightes session" js!/dahua-stre am-" ERROR in Error: The loader "dahua-stream-video/nodemodules/html-webpack-plugin/lib/loader.js!/dahua-stre am-_video/src/index.html" didn't return html.
I changd the location of the git clone to a smaller path and the above issue is resolved, now seeing this error
rtsp-over-ws@1.0.0 build /tmp/dahua-stream-video webpack
[webpack-cli] Failed to load '/tmp/dahua-stream-video/webpack.config.js' config [webpack-cli] Error: Cannot find module 'clean-webpack-plugin' Require stack:
i used npm i npm run build now am not having errors, i have got a a folder called "dist" with html files and js files
clean-webpack-plugin is not installed.
thanksm i installed it now, if i run a websocket server in my pc for providing video data from a file, can i use it instead of using the rtsp
Can you explain how you are providing video data in WebSocket so I could learn from that.
i used libwebsocket to make a sample application which will take data from mp4 and thenn pusshes it to a websocket
i had tried using a stream from a camera, H264 was working fine, H265 showing this .
Successfully compiled asm.js code (total compilation time 1869ms) jsFFMPEG.js Construct H265 Codec h265Decoder.js:1:58 H265 Decoder init h265Decoder.js:1:593 [hevc @ 0x53b020] Warning: not compiled with thread support, using thread emulation jsFFMPEG.js:1:2998 firstDiff: 0 h265Session.js:1:8427 Uncaught TypeError: S is null a http://127.0.0.1:8081/index.js:2 init http://127.0.0.1:8081/index.js:2 init http://127.0.0.1:8081/index.js:2 init http://127.0.0.1:8081/index.js:2
We haven't checked on H265 as we didn't have any requirement for that. Please help yourself.
any idea one the websocket server used by the backend
Nope. All I know is it converts rtsp packets to websocket packets and sent across websocket.
1.How can we test this player code? 2.Can we use it for live streaming. 3.Does it support h264 and h265