I
I
Ivan2021-01-28 19:20:45
PHP
Ivan, 2021-01-28 19:20:45

How to make an mp4 to mp3/m4a converter?

Good afternoon.
Attention: I am ready to thank financially for the help, the main thing is to help.

You need to be able to download a video from YouTube to mp4 via php / js (this can be obtained without problems through a regular request to YouTube), as well as to mp3 and m4a (this is no longer possible).

I don’t know how to download videos from YouTube to mp3 and m4a, I didn’t find a way. That's why I decided to use the ffmpeg function. With it, everything is converted, but for too long. Are there other ways to convert?

Why am I asking. Look at the x2convert.com service, it allows you to download in the formats that I need. mp3, it converts exactly what and lets me download the file from its hosting, but if you try to download m4a, it will send us to an address similar to the following:

spoiler
https://redirector.googlevideo.com/videoplayback?e...


When you go through it, you can click the ellipsis below and download, it suits me. Only I don't understand how to get this link.

I get a very similar link when I request YouTube to receive an mp4 video, only how to get such a link to mp3.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Sanes, 2021-01-28
@Sanes

ffmpeg -i filename.mp4 filename.mp3
https://habr.com/ru/post/171213/

L
Leonid, 2021-01-28
@caballero

for fmpeg to work fast, you need a powerful
server

D
Dmitry Bay, 2021-01-28
@kawabanga

I will piss you off like the rest of the people who answer here) Use ffmpeg.
Judging by the speed at which the audio was given to me, there was just enough time to download the video in the weakest quality, and then convert it using ffmpeg.
Then I checked the speed of my laptop, (macbook m1)
And he gave me the following for such a command (the first one from Google):

ffmpeg -i __1080p_vgqjodeu.mp4 -b:a 192K -vn music.mp3

for 1080p and 576p file, the speed is the same and was 90X.
To transcode a 10 minute video, we spent just over 10 seconds.
size=   14594kB time=00:10:22.63 bitrate= 192.0kbits/s speed=  90x

And if the server is more powerful there, then the results can be more grandiose.

V
Vitaliy K, 2021-01-29
@revenger

Suddenly help
Bulk convert video files to mp3 in Linux

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question