So did a quick search but didn’t find anything, perhaps not using the correct key words.
I’ve set up an automation that takes a short video using " Camera ‘Record’ on CameraName" and then sends it via whatsapp to a group.
It worked fine until about 6 to 8 months ago. Now we do get the videos via whatsapp, but on the whatsapp app on android we can’t see the videos, says something about file error. However if I access my whatsapp via web browser on computer I am able to see the video without any issues.
Any ideas of what I can tweak/change in order to get it working again?
Here is part of my automation, but I don’t think the automation itself is the issue, as it is doing what is expected to do. It is creating the video, then sending the video via whatsapp. The issue is that via whatsapp app on android (haven’t tested with iphone as we don’t have any) we can’t see the video, but via whatsapp web version we can see the video.
Without knowing any better, I would guess the codec that HA is using to create the video is not compatible with whatapp app, but I don’t know if it is possible to change the settings of “camera record”
But pretty sure the issue isn't on the whatsapp integration, as it is sending the messages well. On my automation, when someone walks up to the front door HA takes a picture, sends it via whatsapp then captures a 10 second video and sends it via whatsapp. All that works just fine. The pictures do show up, but on the whatsapp app on android phone it does get the video, but when we try to view the video it gives an error. But if I log in to my whatsapp via the whatsapp web page the video plays just fine.
I am thinking the video format being used can't be played on whatsapp app anymore, but the format works fine when using regular web browser to view it.
So I asked ChatGPT and got this answer:
This is a known issue that has started affecting some WhatsApp users on Android when videos are sent from automated systems like Home Assistant, security cameras, or scripts. Since your video plays fine on WhatsApp Web but not on Android, it’s very likely related to:
What’s Going Wrong
1. Missing or incompatible video metadata / headers
WhatsApp on Android is more strict than the web app when reading video container metadata (especially moov atom placement in MP4s).
If your video’s metadata is placed at the end of the file, Android may fail to buffer it correctly.
2. Unsupported encoding or resolution/bitrate issues
Android WhatsApp prefers:
MP4 container
H.264 video codec
AAC audio codec
Baseline or Main profile (not High profile)
~480p or 720p resolution max
Reasonable bitrates (under ~3–4 Mbps)
How to Fix It
OPTION 1: Modify how Home Assistant encodes the video
If you’re using ffmpeg (likely via frigate, camera.record, or automation), make sure to:
A) Move the MOOV atom to the beginning of the file
So I was able to fix it. One thing I did learn is that you can’t use the same file name. For example if original camera.record file is MyVideo.mp4 in the shell command you can’t use MyVideo.mp4 as the input file and MyVideo.mp4 as the output file.
Then on my automation, before I send the video I run action (call service) “shell_command: fix_video_faststart” . Finally on the part of the automation that sends the video via whatsapp I updated it so that it sends the fixed file.
Hope this helps others that might have same issue.
It has been a while since I configured the addon. It did take me a bit to figure out. I do very basic functions with it, only send out to one group. I did have to use developer tools to get the group ID I created for my household.
I am a bit tied up this week, if by next week you still haven’t figured it out send me a DM and will try to help you.