![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Ubuntu 9.10 is out!!!
When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu. The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely. |
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 | |
|
May the Ubuntu Be With You!
![]() Join Date: Sep 2006
Location: Alaska
Beans: 1,585
|
HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoding in FFmpeg
A common question is "why doesn't the repository FFmpeg convert to mp3, aac, mpeg4, etc?". Ubuntu doesn't make it very clear to the general user as to why to repo FFmpeg is so limited or how to fix this issue. This is reflected in the number of forum questions relating to this topic.
Why is FFmpeg from the repository so limited? Legal reasons. Some software is limited due to geographical differences in software patents, legal restrictions on free speech, and restrictions on certain technologies. Ubuntu sidesteps these legal restrictions by not including some restricted packages by default. Users must install these packages on their own. See Restricted Formats Ubuntu Community Documentation and FFmpeg License and Legal Considerations for more details. How do I fix FFmpeg? There are several options: A. Compile FFmpeg yourself A. Compiling FFmpeg yourself (for all Ubuntu versions) The official FFmpeg answer is to compile it yourself, giving you the power to get what you want with the big-fixes, enhancements, and benefits of the most recent FFmpeg revision. This is an excellent solution and is explained here: HOWTO: Install and use the latest FFmpeg and x264 However, this isn't for everyone. Sometimes you want an official package that works right now. Off to the other options... B. Installing the unstripped or extra libraries from the repository This is the quickest option for most users. FFmpeg from the repository does not include many restricted encoders, formats, and codecs including: h261, h263, h263p, aac (libfaac), mp3 (libmp3lame), h264 (libx264), xvid (libxvid), mpeg2video, mpeg4, msmpeg4, msmpeg4v1, and msmpeg4v2. You can fix this by installing the unstripped or extra (Ubuntu Karmic renamed unstripped to extra) FFmpeg libraries that will enable these restricted encoders. Open up Terminal (Applications -> Accessories -> Terminal) and enter: Ubuntu Karmic Koala 9.10 Code:
sudo apt-get install ffmpeg libavcodec-extra-52 Note: Right now there is no way to encode AAC audio with FFmpeg from the Karmic Koala repository. You will have to compile FFmpeg yourself to do so. Refer to option A. Compile FFmpeg yourself if you would like to encode to AAC audio with FFmpeg. Another option is to use a separate encoder and then combine the video and audio. Quote:
Code:
sudo apt-get install ffmpeg libavcodec-unstripped-52 Code:
sudo apt-get install ffmpeg libavcodec-unstripped-51 C. Installing the ubuntu-restricted-extras package Another option for Jaunty and Ibex is to install the ubuntu-restricted-extras package (this is not an option for Karmic). This is a metapackage, which means that it will install multiple packages including the "unstripped" FFmpeg libraries. This is a sledgehammer approach, especially if you are bandwidth limited, and will install a large amount of other packages that you may not want. To install this package, open up Terminal (Applications -> Accessories -> Terminal) and enter: Code:
sudo apt-get install ffmpeg ubuntu-restricted-extras D. Installing FFmpeg from Medibuntu This option is only available for Ubuntu Hardy Heron 8.04. Medibuntu is a third-party repository that contains packages that are unable to be included in the official Ubuntu repositories. To install FFmpeg from Medibuntu open Terminal (Applications -> Accessories -> Terminal) and run the following: Code:
sudo wget http://www.medibuntu.org/sources.list.d/`lsb_release -cs`.list --output-document=/etc/apt/sources.list.d/medibuntu.list && sudo apt-get -q update && sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring && sudo apt-get -q update Code:
sudo apt-get install ffmpeg Undoing Changes Made By This Guide B. Uninstalling the unstripped or extra libraries Code:
sudo apt-get remove ffmpeg libavcodec-*-5* Code:
sudo apt-get remove ubuntu-restricted-extras Code:
sudo apt-get autoremove ffmpeg medibuntu-keyring && sudo rm /etc/apt/sources.list.d/medibuntu.list && sudo apt-get update Last edited by FakeOutdoorsman; 2 Weeks Ago at 04:03 PM.. Reason: made the titles an ugly baby-poop brown for easier to see topic separation |
|
|
|
|
|
|
#2 |
|
Ubuntu Extra Shot
![]() Join Date: Sep 2006
Beans: 385
|
Re: HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoding in FFmpeg
Well done. This clears up a lot of confusion.
__________________
System 1: Asus P5B-E | C2D E6420 | 2GB DDR2 | 900GB SATA II | Nvidia 9500GT (G96) | Hauppauge PVR-250 | Twinhan 1022A System 2: Asus A7N8X-E Dlx | Barton 2600+ | 1GB DDR | 280GB IDE | Nvidia 6200 | WinTV 401 |
|
|
|
|
|
#3 |
|
First Cup of Ubuntu
![]() Join Date: Apr 2007
Beans: 8
|
Re: HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoding in FFmpeg
Excellent guide! My only suggestion is to point people wanting to encode directly to your also most excellent article on compiling the sources: http://ubuntuforums.org/showthread.php?t=786095
This solved my problems perfectly and let me convert some files .mov to .avi and I wasn't able to find the solution anywhere else! Thanks! |
|
|
|
|
|
#4 |
|
First Cup of Ubuntu
![]() Join Date: Jan 2009
Beans: 1
|
Men!!! Great tutorial!! Thanks a lot, I was searching this for a long time!
|
|
|
|
|
|
#5 |
|
First Cup of Ubuntu
![]() Join Date: May 2009
Beans: 2
|
Re: HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoding in FFmpeg
Hey folks,
I've been having a very difficult time doing some very basic trimming with ffmpeg and was hoping someone might be able to provide a little input. The input video is mpeg2 and the audio is ac3, and the problem is related to the ac3 sound, which no longer plays after the trimming. I've installed ffmpeg based on the examples above, unstripped, and also tried compiling ffmpeg based on FakeOutdoorsman's other tutorial with the latest svn, but still no luck. I'm running this very simply command: Code:
ffmpeg -i test.mpg -vcodec copy -acodec copy -ss 00:00:00 -t 90 test_trimed.mpg Code:
FFmpeg version git-5d5fb67, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-nonfree --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid
libavutil 50. 3. 0 / 50. 3. 0
libavcodec 52.29. 0 / 52.29. 0
libavformat 52.33. 0 / 52.33. 0
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0. 7. 1 / 0. 7. 1
built on May 23 2009 12:47:43, gcc: 4.3.3
Seems stream 0 codec frame rate differs from container frame rate: 59.94 (60000/1001) -> 29.97 (30000/1001)
Input #0, mpeg, from 'test.mpg':
Duration: 00:04:31.23, start: 0.255589, bitrate: 9422 kb/s
Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 704x480 [PAR 10:11 DAR 4:3], 9510 kb/s, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s
Output #0, mpeg, to 'test_trimed.mpg':
Stream #0.0: Video: mpeg2video, yuv420p, 704x480 [PAR 10:11 DAR 4:3], q=2-31, 9510 kb/s, 90k tbn, 29.97 tbc
Stream #0.1: Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 2702 fps= 0 q=-1.0 Lsize= 100652kB time=90.02 bitrate=9159.9kbits/s
video:97418kB audio:2813kB global headers:0kB muxing overhead 0.419587%
Do you think this is related to my configuration? |
|
|
|
|
|
#6 |
|
Ubuntu addict and loving it
![]() Join Date: Jun 2007
Beans: 4,168
|
Re: HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoding in FFmpeg
While ffplay may playback with sound for other players you probably should add a -target dvd (specify pal or ntsc (edit: in this case ntsc
Ex. doug@doug-desktop:~$ ffmpeg -i 2.mpg -acodec copy -vcodec copy -t 90 -target ntsc-dvd 2-1.mpg Last edited by mc4man; May 23rd, 2009 at 05:31 PM.. |
|
|
|
|
|
#7 |
|
First Cup of Ubuntu
![]() Join Date: May 2009
Beans: 2
|
Re: HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoding in FFmpeg
|
|
|
|
|
|
#8 |
|
Still having fun...
![]() Join Date: Dec 2006
Beans: 3,006
Ubuntu 9.10 Karmic Koala
|
Re: HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoding in FFmpeg
Hi,
Just a quick note to thank FakeOutdoorsman for putting this page together which promises to be of great assistance to the many who struggle with the necessary shortcomings of Ubuntu's stock FFmpeg package. Andrew
__________________
Do you think that's air you're breathing? |
|
|
|
|
|
#9 |
|
Still having fun...
![]() Join Date: Dec 2006
Beans: 3,006
Ubuntu 9.10 Karmic Koala
|
Re: HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoding in FFmpeg
Hi Fakeoutdoorsman,
Congratulations on Tutorial of the Week for this guide!! A well deserved award. All the very best, Andrew
__________________
Do you think that's air you're breathing? |
|
|
|
|
|
#10 | ||
|
First Cup of Ubuntu
![]() Join Date: Apr 2008
Location: UK
Beans: 5
Ubuntu 7.10 Gutsy Gibbon
|
Re: HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoding in FFmpeg
Quote:
Quote:
|
||
|
|
|
| Bookmarks |
| Tags |
| codecs, ffmpeg, medibuntu, restricted, unstripped |
| Thread Tools | |
| Display Modes | |
|
|