I would like to download a few videos from youtube and convert them to 3gp so that I can play them on my phone. I would like to know how this can be done using ffmpeg.
I tried the various results on the net only to get the following errors.
I used:
ffmpeg -i dil.mp4 -sameq -ab 64k -ar 44100 dilenada.3gp
I got:
Unsupported codec for output stream #0.1
Seems stream 0 codec frame rate differs from container frame rate: 2000.00 (2000/1) -> 29.92 (359/12)
I used:
ffmpeg -y -i dil.mp4 -r 20 -s 352x288 -b 400k -acodec libfaac -ac 1 -ar 2000 -ab 24k dilenada.3gp
I got:
Seems stream 0 codec frame rate differs from container frame rate: 2000.00 (2000/1) -> 29.92 (359/12)
Unknown encoder 'libfaac'
What am I doing wrong?
Use the following command:
You probably just need to install the non free/restricted packages of ffmpeg like
libavcodec-extra-53 libavformat-extra-53 libavutil-extra-51
and the likes.Calling ffmpeg with
--list-encoders
will show the available encoders.You are doing everything right :). You will have to install for the conversion to work.
You may get it from the software center or use the following command
I ran into problems with ffmpeg too
Apparently, ubuntu is no longer using ffmpeg, but a fork called avconv. This makes some (many ?) commands found on sites unusable on ubuntu.
What I did was just get the original ffmpeg:
not sure how much this would help you, though
In order to get round this problem, the only option may be to
build from source
. That solved any issues for me. I uninstalled any of theffmpeg
packages currently on the system that I had tried to use, and used this excellent Ubuntu compilation guide. This was the only way I could encode to proprietary formats such as mp4 and mp3.In addition, the following script, which I have modified (credit to the original creator), can again be further altered and used to convert
mp4 to 3gp
ormp4 to mp3
(to extract the audio), or anything whatsoever. It also preserves the original name of the file in the newly converted file: It is however important to fill in the options correctly.You can use different options for 3gp; for example,you may want a different resolution than
qcif
(176x144), but I found these settings initially worked for me with mycompiled
version offfmpeg
. (The conversion may take a while, depending on how powerful your CPU is, as converting it to 3gp reduces the file size quite a lot: 314mb to 13 mb for one of my conversions!)Save this script below to a new document and make it executable (
chmod +x
), place it in the desired folder and execute it; or use the terminal to select the folder the script is in and the target folder containing the files; e.g.~/Scripts/script ~/Downloads