Closed hankman13 closed 5 years ago
@hankman13 I'll take a look at that. How big is your file? How long is it?
So the Input Filesize was about 45 MB. So I tested with another file, to see how big an video will be. Input filesize 15 MB, the output of the gif was even bigger. Maybe a GIF is not the best option for filesize optimization.
I am testing to convert the video with ffmpeg directly with scaling down and changing duration.
ffmpeg -loglevel panic -i video.mp4 -vf "scale=320:-1,setpts=PTS/2,fps=30" -af "atempo=2" -y smaller_video.mp4
with this option I can reduce my output filesize to 4.x MB.
I'm still on looking how to make the notification of the surveillance station better.
I believe the solution I used before may answer your needs..
Try moviepy
tag..
https://hub.docker.com/r/gabrielrf/video2telegram/tags
This was the repo by that time.. https://github.com/GabrielRF/Video2Telegram/tree/62d0cbe2074cb76152204ac57bd67eba2aa2b118
Hi @GabrielRF , Now I have your solution with moviepy running. I had to reduce the scale and now it runs very well. I also found this repo: synology-surveillance-api-motion-mqtt-gifs which is using ffmpeg directly and uses the synology api. Maybe I give it a try, but I really prefer to get a direct telegram message and just watching the folder is a simple and working solution. So maybe I just try to optimize the python or copy and pasting from other sources.
@hankman13 Great news! I'm glad you could make it work!
I didn't use synology api in order to make it work "everywhere", even on devices from other brands. But I'll definitely take a look at this repo. I liked the approach it took.
Well the ffmpy solution is working, but not optimized in filesize i guess. So may this tutorial is helpful: https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/ At the moment I get the gif and the mp4 file may its possible to define a switch-variable for activating the video upload.