Uploading video to Facebook using graph API keeps failing

Describe the problem/error/question

I have a workflow that can upload image to Facebook using the Graph API. I just created a copy of the flow and use a video instead, updating the node parameter accordingly.

This is the associated input

What is the error message (if any)?

The error is
“The video file you selected is in a format that we don’t support.”

I used curl in CLI to upload the same video and it works fine, and it is appearing on my FB wall (I didn’t set the published=false parameter)

Please share your workflow

Share the output returned by the last node

I tried using file:video.mp4 and source:video.mp4 and simply video.mp4 but none is working. My FB API Token is valid and not expired. I can view/download the video from previous node and upload it to FB with curl command so the video file is good.
I suspect the node cannot take the video and upload it.
What setting is wrong in my node that it can’t find or process the file? Is it too big? It’s only 1MB

Information on your n8n setup

  • n8n version: 1.100.1
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: Linux Ubuntu

TL;DR;
Make sure the File Name field in your binary data has the extension matching the video format (i.e. mp4, mov…) or FaceBook will not recognize the video format.

Since I didn’t see anyone sharing this, I’ll reply to myself with the solution I found. It is so simple…

First, I repeat I am self-hosted on a k8s node running at home, addressable from the internet. I believe self-hosting has nothing to do with the issue.

So the file I was uploading was coming from a HTTP request which download the file from a custom application and the binary file looks like this (same as original post):

Now from the error that the file format wasn’t supported drove me to think: is FB so … ahem … stup… simple that it uses the filename to determine the file format?
The answer is yes. I did a quick test with using a video file from a wordpress URL

More details:
Notice the File Name field is video.mp4 instead of a generic UUID value.
And voila! video is uploaded to FB as expected.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.