Converting mimetype binary/octet-stream to video/mp4

Describe the problem/error/question

I’m running n8n locally using Docker, I download a file from a URL using HTTP Request, it was downloaded as mime type ‘binary/octet-stream’, I then applied a code node that converts it to video/mp4.
The Youtube node’s input is showing mime type ‘video/mp4’ but returns an error saying
‘Media type ‘binary/octet-stream’ is not supported.’

this is the image from the Youtube node(after the Code node):

What is the error message (if any)?

Youtube is returning ‘Media type ‘binary/octet-stream’ is not supported.’

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

this is the output from the Code node:

Why does the Youtube node not recognizing the file as video/mp4?

Information on your n8n setup

  • n8n version: 1.98.2
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Windows

You might need to use ffmpeg to convert the video file for you.

Could you elaborate on how to do that?

First you’ll need to install the cli command on the docker instance running n8n. The quick and dirty is to docker exec into the running container and then installing it.

Once that is done and you can access the command, you can simply store the file into a temp folder on the n8n instance container, run the below ffmpeg command to recreate the video container to the supported mime type, and then reading the file again for further processing.

So the workflow will do something like this

If you’re planning to use ffmpeg in future for changing video file mime types, then you can follow the instructions below for creating a custom dockerfile with ffmpeg pre-installed

https://www.perplexity.ai/search/how-to-install-ffmpeg-on-a-n8n-_2J19TZNRaWeNRO9Y3pPHw

2 Likes

It worked, thank you!

1 Like

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