Hi there, in a workflow I need to send audio files to OpenAI Whisper to transcribe them. But sometimes, the files I receive are larger than the 25 mB limit. Do you know what would be the simplest way to split an audio file in smaller files in n8n?
So i think you have 2 way 1 is with ffmpeg library, but you need to install it on the server/container and activate and use via execute command or you can try with cloud convert api
OK so I found a solution with ffmpeg library thanks to you @mredodos!
If someone finds this topic here’s how I did it:
Add ffmpeg to n8n: I deploy it using Docker, so in the Dockerfile I added “RUN apk add --update ffmpeg”
In my workflow I write the binary file on the disk using the “Read/Write Files from Disk” node
Then I add an “Execute Command” node and execute the following command: ffmpeg -i my_input_file.mp3 -f segment -segment_time 2400 -c copy split_audio_file_%03d.mp3 (Here I cut the file in 40 minutes segments and name the outputs “split_audio_file_000.mp3”, “split_audio_file_001.mp3”, etc.)
Then I can get the binary files by reading the disk and looking for files named “split_audio_file_???.mp3”