Video Player is loading.

Up next


You want to Post an .mp3 file on a Media Site That Requires .mp4 files

JamesRoss
JamesRoss - 415 Views
442
415 Views
Published on 28 Dec 2023 / In How-to and Style

Make your computer dual boot with Linux from Distrowatch.com

Install ffmpeg onto your linux system.
open an app called terminal and use the following commands
sudo apt-get update
sudo apt-get install ffmpeg

Get your mp3 and find how much time it is in seconds.

Create a .mp4 file from an image.jpg file for the same length of seconds. (image ratio needs to be 1920x1080 it seems)
ffmpeg -loop 1 -i thornhill.jpg -t 4895 -r 1 -c:v libx264 -pix_fmt yuv420p thornhill.mp4

Create another .mp4 by adding the .mp3 file to your just created image.mp4
ffmpeg -i thornhill.mp4 -i thornhill.mp3 -c:v copy -c:a aac -strict experimental thornhillout.mp4

thornhillout is posted here: https://ugetube.com/watch/wall....ace-thornhill-2014-a

I made this video for myself so I can do it against some day.
Note: resolution can be increased from 640 to 720 on a 1920 screen.

Show more
1 Comments sort Sort by

JamesRoss
JamesRoss 4 months ago

What Bing AI tried to get me to do was just use a single command in this attempt making this video. so here is one command: ffmpeg -loop 1 -i thornhill.jpg -i thornhill.mp3 -r 1 -c:v libx264 -tune stillimage -c:a aac -b:a 40k -pix_fmt yuv420p -shortest thornout2.mp4
I did not need to input the time (-t) I also changed the audio to 40kb/s resulting in reducing the mp4 file size from 76 to 28 Mb.

Here is what Bing AI gave me:
To create an MP4 video from an MP3 file and a photo in Linux, you can use the ffmpeg command-line tool. Here are the steps:

Install ffmpeg if it is not already installed on your system. You can do this by running the following command in your terminal:

sudo apt-get install ffmpeg

Place the photo and MP3 file in the same directory.

Open your terminal and navigate to the directory where the files are located.

Run the following command to create the video:

ffmpeg -loop 1 -i photo.jpg -i audio.mp3 -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest output.mp4

Here’s what each option does:

-loop 1: Loops the photo so that it appears throughout the entire video.
-i photo.jpg: Specifies the input photo file.
-i audio.mp3: Specifies the input audio file.
-c:v libx264: Sets the video codec to H.264.
-tune stillimage: Optimizes the video for still images.
-c:a aac: Sets the audio codec to AAC.
-b:a 192k: Sets the audio bitrate to 192 kbps.
-pix_fmt yuv420p: Sets the pixel format to yuv420p.
-shortest: Makes the output video the same length as the shortest input file.

Wait for the command to finish running. The output file will be saved in the same directory as the input files.

I hope this helps! Let me know if you have any other questions.

Reply   thumb_up 0   thumb_down 0
Show more

Up next