While sharing videos to a WhatsApp group chat from my phone, a Google Pixel 4a, some participants could not view the video.. They only could hear the contents of the video.
After finding several threads with no resolution and someone contributing a video which did work for the iPhone users I started investigating. https://www.reddit.com/r/whatsapp/comments/1e4q38c/video_sent_from_android_unplayable_on_ios_and_web/ https://support.google.com/pixelphone/thread/290866570/google-4a-videos-on-whatsapp?hl=en https://support.google.com/pixelphone/thread/290626638/since-july-2024-video-sent-on-whatsapp-from-all-pixel-models-cannot-be-viewed-on-iphone?hl=en
I found that there were several differences, one of which was the colorspace encoding. Investigated a bit via ffmpeg and bothering a couple friends which use iPhones I found a workaround.
https://ffmpeg.org/ffmpeg-filters.html#scale-1 ffmpeg -i input.mp4 -vf scale=in_color_matrix=auto:in_range=auto:out_color_matrix=bt709:out_range=tv output.mp4 This creates an output of the format ; yuv420p(tv, bt709/unknown/unknown, progressive)
https://ffmpeg.org/ffmpeg-filters.html#setparams-1 ffmpeg -i input.mp4 -vf setparams=field_mode=auto:range=tv:color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mp4 This creates an output of the format ; yuv420p(tv, bt709, progressive)
This also appeared to be a way to do a color transform but it doesn't appear to exist on my ffmpeg build |11.221 scale_vt : Scale and convert the color parameters using VTPixelTransferSession.
My Reddit Reply is recorded here: https://www.reddit.com/r/whatsapp/comments/1e4q38c/comment/lqt9iid/
The final Working version I used was the following which allows a "clean" output format and scaling:
ffmpeg -i input.mp4 -vf scale=360x640:out_color_matrix=bt709:out_range=tv -color_primaries bt709 -color_trc bt709 -colorspace bt709 output.mp4