Closed 671792320 closed 4 years ago
Hi,
This is a very isolated issue/environmental factor.
Every project that I have come across that offers homekit camera functionality, does not require the URI's to be quoted. The developer of homebridge-camera-ffmpeg, does not Evan have it quoted. https://github.com/KhaosT/homebridge-camera-ffmpeg/blob/master/ffmpeg.js
And that same developer, is who has developed the NodeJS Homekit lib that these nodes use.
I myself do not have it quoted.
In an effort to get this working for you. I have replaced the single quotes around the -vf attribute with double quotes. see if that helps.
LIVE555 Streaming Media v2013.04.06 Duration: N/A, start: -23435.054967, bitrate: N/A Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1280x720, 50 fps, 25 tbr, 90k tbn, 100 tbc Option hwaccel (use HW accelerated decoding) cannot be applied to output url -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to. Error parsing options for output file . Error opening output files: Invalid argument
Sorry, I have no idea what this is referring to, why is LIVE555 involved?
Are you pointing the Source Stream
to a LIVE555 stream?
hwaccel
should come before your -i argument
Source Stream
-hwaccel vaapi -vaapi_device /dev/dri/renderD128 -threads:v 2 -threads:a 4 -rtsp_transport tcp -i rtsp://STREAM_URL
Encoder
h264_vaapi
in the camera.js file change (exactly as shown)
"format=nv12|vaapi,hwupload,scale_vaapi='+width+':'+height+'"
to
format="nv12|vaapi,hwupload,scale_vaapi='+width+':'+height+'"
putting the double quote after the =
and not before
Really not? It's strange why that code can run normally under Bash and can't be opened on the mobile phone.
try taking the double quotes out completely
-vf format=nv12|vaapi,hwupload,scale_vaapi='+width+':'+height+'
Seems to be back to the beginning
Does it seem that the ffmpeg I installed does not support nv12 format?
potentially....
Try this last one. the various arguments are separated with a single quote, but if we actually need single quotes in a command - we need to escape them with \'
-vf \'format=nv12|vaapi,hwupload,scale_vaapi='+width+':'+height+'\'
It's really strange. After I manually copied the command and added 'quotes' to SRTP, I ran up after the terminal was executed, and real-time images were also displayed on the mobile phone, although carton was slow to respond
if for what ever reason your environment needs quotes around the output address do this
change
const ffmpegStreamArgs = ' -ssrc ' + videoSsrc + ' -f rtp' + ' -srtp_out_suite AES_CM_128_HMAC_SHA1_80' + ' -srtp_out_params ' + videoKey.toString('base64') + ' srtp://' + targetAddress + ':' + targetVideoPort + '?rtcpport=' + targetVideoPort + '&localrtcpport=' + targetVideoPort + '&pkt_size=' + packetsize
to
const ffmpegStreamArgs = ' -ssrc ' + videoSsrc + ' -f rtp' + ' -srtp_out_suite AES_CM_128_HMAC_SHA1_80' + ' -srtp_out_params ' + videoKey.toString('base64') + ' "srtp://' + targetAddress + ':' + targetVideoPort + '?rtcpport=' + targetVideoPort + '&localrtcpport=' + targetVideoPort + '&pkt_size=' + packetsize+'"'
Then I am out of ideas...
My only suggestion here is to download NodeJS on your own machine, install ffmpeg, install node-red, and my nodes, and see if you get the same problems.
I think we need to remove any barrier that could be affecting things.
OK, I'll try your suggestion later
Nodejs
Which version should I use?
it includes NPM (and doesn't need to be installed )
Thank you
Looking at VAAPI, it only runs on Linux, so this may not help in anyway, if you can work out the equivalent for windows, then you can at least check to ensure hardware encoding/rendering does not work.
if it does - then you know your DSM environment is playing havec.
What does that mean?
if it does - then you know your DSM environment is playing havec.
I can't understand machine translation,
You mean vaapi only works in Linux.
If these codes are not valid on Windows
Can it be proved that DSM can run?
What I mean is :
If you can get windows to run a hardware accelerated video stream, then your DSM or DOCKER environment is causing you the issues, rather then the node it’s self.
Havoc - misbehaving/causing trouble
I.e your DSM is causing Havoc
Yes, windows does not support VAAPI, so you may need to head over to the FFMPG website to find out how to do hardware encoding/decoding on windows.
OK, I will try to install nodejs directly on DSM and install noded for testing
After using nodejsv8 to install node red on DSM, the same problem occurs.
what error invalid filter?
No, what happened was
Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1280x720, 50 fps, 25 tbr, 90k tbn, 100 tbc
Option hwaccel (use HW accelerated decoding) cannot be applied to output url -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for output file .
Error opening output files: Invalid argument
No longer available for testing, I have deleted the nodejs suite and node red on DSM
Then I am not sure what the problem is. I use hardware encoding, and haven't had any problems.
I have exhausted any knowledge I have with ffmpeg (which is not a lot)
my nodes use child_process and commands that are used by most homekit camera implementations.
the only thing different is the use of VAAPI - which may be the problem entirely, but i don't have the knowledge to find out.
Once again - Sorry
No, you don't have to say sorry. Instead, I should say thank you. Thank you for your help
Thank you again
ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 \ ... -srtp_out_params ils+c7v2WkNjdFFgICwYAeDKZ5oVaUAs1moiaGFB \ "srtp://192.168.1.243:62485?rtcpport=62485&localrtcpport=62485&pkt_size=1316"
In the above. If SRTP: / / is not entered by '' or '' then the entire command will not take effect.
Here are the screenshots.
The command in the first figure has a band '', I tested that both '' and '' can open the process normally
The second graph doesn't have '' or '' will stick like this