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

range feature for httpd #1052

Open
darkfuncat opened this issue Oct 15, 2023 · 4 comments
Open

range feature for httpd #1052

darkfuncat opened this issue Oct 15, 2023 · 4 comments

Comments

@darkfuncat
Copy link

Hello,
I try to download video files from openipc camera, but only some part of file. (range feature for http download)
The purpose is to send video file of alarm few seconds before trigger.
The feature from HTTP1.1 seems not enabled by default in openipc.
Is it possible to activate it ?
Exemple, when doing :
curl -r -5000 http://user:pwd@IP:85/cgi-bin/dl.cgi?file=/mnt/mmcblk0p1/2023/10/14/XX.mp4
Curl should download only last 5000 bytes from file, but instead it download whole file (which is very long and useless)
Or perhaps there is another way to do this ?
Thanks

@themactep
Copy link
Collaborator

Enable this

# CONFIG_FEATURE_HTTPD_RANGES is not set
, recompile and update fw, check that is works, send a pr.

@darkfuncat
Copy link
Author

Thanks for your advice.
OK so I have followed instructions to recompile firmware.
I changed the file you mentioned with :
CONFIG_FEATURE_HTTPD_RANGES=y
(I guess this is the good syntax regarding other lines)
After compile I resintall rootfs.squashfs.t31 and uImage.t31, reboot and still not able to download range of file with above curl command.
Any tip or something I forgot ?
(I think that I am reaching my limits in term of development...)
Thanks

@themactep
Copy link
Collaborator

Did you try to download a piece of a real file to check if the range function works? The dl.cgi is a script that proxies content of the requested file from anyplace in the system to the http client. This might be a problem for determining the range. If direct dowload works with the enabled option, we'll start from there.

@darkfuncat
Copy link
Author

Hello @themactep
The purpose here is to trigger alarm and send a sample of video few seconds before and after trigger (basic thing from all other camera I own)
To be honest, I am facing many difficulties to achieve this with OpenIPC :

This is a lot of work and many problems and it takes time...

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

2 participants