GabrielRF / Video2Telegram

Watches a folder. If new file, sends gif using Telegram Messenger.
https://hub.docker.com/r/gabrielrf/video2telegram/
GNU General Public License v3.0
30 stars 4 forks source link

Large gif-file #5

Closed hankman13 closed 5 years ago

hankman13 commented 5 years ago

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.

GabrielRF commented 5 years ago

@hankman13 I'll take a look at that. How big is your file? How long is it?

https://t.me/GabrielRF

hankman13 commented 5 years ago

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.

GabrielRF commented 5 years ago

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

hankman13 commented 5 years ago

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.

GabrielRF commented 5 years ago

@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.