![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Chocolate-Covered Ubuntu Beans
![]() Join Date: Sep 2006
Location: Alaska
Beans: 2,018
|
HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoders 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 bug-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 This is the option that I personally use, and although it is not too hard, compiling may not be for everyone for a variety of reasons. Off to the other options... B. Installing the unstripped or extra libraries This is the quickest option for most users. FFmpeg from the repository does not include many restricted encoders, formats, and codecs which may include: H.263, aac (libfaac), mp3 (libmp3lame), H.264 (libx264), xvid (libxvid), and mpeg4. 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 and enter: Ubuntu Lucid Lynx 10.04 & Ubuntu Karmic Koala 9.10 Code:
sudo apt-get install ffmpeg libavcodec-extra-52 Note: The libavcodec-extra-52 package for Lucid and Karmic do not support AAC or AMR formats. I recommend using libavcodec-extra-52 from the Medibuntu repository. See option C. Medibuntu.Ubuntu Jaunty Jackalope 9.04 Code:
sudo apt-get install ffmpeg libavcodec-unstripped-52 Code:
sudo apt-get install ffmpeg libavcodec-unstripped-51 C. Medibuntu This option is available for Ubuntu Lucid Lynx 10.04, Ubuntu Karmic Koala 9.10 and 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 Ubuntu Lucid Lynx 10.04 & Ubuntu Karmic Koala 9.10 Code:
sudo apt-get install ffmpeg libavcodec-extra-52 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 autoremove ffmpeg medibuntu-keyring && sudo rm /etc/apt/sources.list.d/medibuntu.list && sudo apt-get update Last edited by FakeOutdoorsman; 2 Days Ago at 12:38 PM.. Reason: trivial typo |
|
|
|
|
|
#2 |
|
Quad Shot of Ubuntu
![]() Join Date: Sep 2006
Beans: 481
|
Re: HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoding in FFmpeg
Well done. This clears up a lot of confusion.
__________________
Biostar TA790GXB A2+ | Phenom II X4 945 | 4GB DDR2-800 | 1TB SATA II | Nvidia 9500GT (G96) Asus P5B-E | C2D E6420 | 2GB DDR2-800 | 400GB SATA II | Nvidia 7600GS Asus A7N8X-E Dlx | Barton 2600+ | 1GB DDR | 280GB IDE | Nvidia 6200 |
|
|
|
|
|
#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: 9
Xubuntu 10.04 Lucid Lynx
|
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 |
|
Fresh Ground Ubuntu
![]() Join Date: Jun 2007
Beans: 5,568
|
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: 9
Xubuntu 10.04 Lucid Lynx
|
Re: HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoding in FFmpeg
|
|
|
|
|
|
#8 |
|
Still having fun...
![]() Join Date: Dec 2006
Beans: 3,814
|
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,814
|
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 | |
|
|