PDA

View Full Version : [ubuntu] Convert wav or mp3 for upload on youtube


[rtmf]
August 28th, 2009, 11:02 AM
hi, i want to upload self-made music to youtube, but everytime i upload an mp3 (youtube says it supports this format), i get a format conversion error on youtube after uploading.

how can i convert a wav or mp3 so its uploadable to youtube?

greetz [rtmf]:guitar:

tgeer43
August 28th, 2009, 12:36 PM
No, YouTube doesn't accept straight mp3 uploads, only video files. What you might have seen is that they recommend that the audio portion of your video file be encoded with the mp3 codec. So you'll have to convert your mp3 into a video file format that YouTube does recognize, .flv for instance.

There's various ways to accomplish this. Here's one that's fairly easy and works quite well:

- You'll need to have the packages 'ffmpeg' and 'gstreamer0.10-plugins-bad' installed.
sudo apt-get install ffmpeg gstreamer0.10-plugins-bad- Then just run this command to convert from mp3 to flv:
ffmpeg -y -i /path_to_your/song.mp3 -f flv -ab 131072 -ac 1 /path_to_your/video.flvJust replace the path and input and output file names to yours. The '131072' is the bitrate of the resulting file (128Kbps in this case) and can be changed as you wish.

Hope this helps,

tgeer

[rtmf]
August 28th, 2009, 02:41 PM
Conversion on youtube failed again :(

sgx
August 28th, 2009, 10:54 PM
;7861598']Conversion on youtube failed again :(

Try making a video, add the soundtrack -your mp3, convert that complete production to flv. People often post video of just an album cover, with a song playing, but it is video with an audio track. Free stock video footage is plentiful to download, avidemux, or kino are easy to use for
making such a project ready for converting.
Cheers

FakeOutdoorsman
August 28th, 2009, 11:42 PM
No, YouTube doesn't accept straight mp3 uploads, only video files. What you might have seen is that they recommend that the audio portion of your video file be encoded with the mp3 codec. So you'll have to convert your mp3 into a video file format that YouTube does recognize, .flv for instance.

There's various ways to accomplish this. Here's one that's fairly easy and works quite well:

- You'll need to have the packages 'ffmpeg' and 'gstreamer0.10-plugins-bad' installed.
Why install gstreamer0.10-plugins-bad?
Then just run this command to convert from mp3 to flv:
ffmpeg -y -i /path_to_your/song.mp3 -f flv -ab 131072 -ac 1 /path_to_your/video.flvJust replace the path and input and output file names to yours. The '131072' is the bitrate of the resulting file (128Kbps in this case) and can be changed as you wish.
Instead of "-ab 131072" you could use "-ab 128k".

Try making a video, add the soundtrack -your mp3, convert that complete production to flv. People often post video of just an album cover, with a song playing, but it is video with an audio track. Free stock video footage is plentiful to download, avidemux, or kino are easy to use for
making such a project ready for converting.
Cheers

I provided some command-line examples in the following thread to create an image and combine it with the audio track to make a video. The audio is just being copied and not re-encoded so the quality is preserved:

Convert mp3 to avi (http://ubuntuforums.org/showthread.php?p=7822073)

[rtmf]
August 29th, 2009, 12:29 PM
I provided some command-line examples in the following thread to create an image and combine it with the audio track to make a video. The audio is just being copied and not re-encoded so the quality is preserved:

Convert mp3 to avi (http://ubuntuforums.org/showthread.php?p=7822073)

This one DID help. Thanks big time!

krishan404
February 25th, 2010, 05:34 PM
hi guys, i modified the script from the link above to create a simple music video with one image for youtube:


#!/bin/bash
#dependencies: ffmpeg
# Usage: ./mp32youtube.sh input.mp3 output.mpg

background=/home/blabla/picture.jpg
#change it to the picture you want for your clip on youtube


ffmpeg -loop_input -i "$background" -i "$1" -acodec copy -shortest -qscale 5 -s 640x480 "$2"
exit

u can change -s parameter to your desired resolution. hope this helps!

robhardwick
December 18th, 2010, 02:37 PM
You could try an online tool such as mp32flv (http://www.mp32flv.com) to do the job.
Rob

Geremia
June 23rd, 2011, 04:02 PM
You could try an online tool such as mp32flv (http://www.mp32flv.com) to do the job.
RobDoes it re-encode or just pass it through? Thanks

slooksterpsv
June 23rd, 2011, 04:04 PM
xcfa - it's in the Repos and it's GUI.

Geremia
June 23rd, 2011, 04:33 PM
hi guys, i modified the script from the link above to create a simple music video with one image for youtube:


#!/bin/bash
#dependencies: ffmpeg
# Usage: ./mp32youtube.sh input.mp3 output.mpg

background=/home/blabla/picture.jpg
#change it to the picture you want for your clip on youtube


ffmpeg -loop_input -i "$background" -i "$1" -acodec copy -shortest -qscale 5 -s 640x480 "$2"
exit
u can change -s parameter to your desired resolution. hope this helps!Thank you! I used eyeD3 to extract the image album_art.jpeg from the MP3:
eyeD3 -i . my_mp3.mp3and fed it into ffmpeg with the simple command:ffmpeg -loop_input -r 1 -shortest -i album_art.jpeg -i my_mp3.mp3 -acodec copy out.mp4The "-r 1" option limits the framerate to 1 frame per second so the video isn't as big.