Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 107589 - amr USE flags in ffmpeg or mplayer
Summary: amr USE flags in ffmpeg or mplayer
Status: RESOLVED LATER
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-29 05:14 UTC by Johny Quest
Modified: 2006-07-12 03:24 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ffmpeg-0.4.9_p20050906.ebuild with AMR support (ffmpeg-0.4.9_p20050906.ebuild,5.16 KB, text/plain)
2005-10-09 09:49 UTC, Philip Kovacs
Details
mplayer-1.0_pre7-r1.ebuild with AMR support (mplayer-1.0_pre7-r1.ebuild,16.15 KB, text/plain)
2005-10-09 10:36 UTC, Philip Kovacs
Details
mplayer-1.0.20060302.ebuild (mplayer-1.0.20060302.ebuild,16.81 KB, text/plain)
2006-03-04 18:56 UTC, Philip Kovacs
Details
mplayer-1.0.20060302.ebuild.diff (mplayer-1.0.20060302.ebuild.diff,2.03 KB, patch)
2006-03-04 18:57 UTC, Philip Kovacs
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Johny Quest 2005-09-29 05:14:37 UTC
Hello

	I'm trying to compile ffmpeg with "--enable-amr_nb --enable-amr_nb-fixed
--enable-amr_wb" in ./configure. I've downloaded additional sources, but i can't
do this so here is my question could someone add USE flag amr for example to ffmpeg?

greeting Tomek.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Philip Kovacs 2005-10-04 15:47:58 UTC
I believe the issue with the amr codecs is their licensing: Read more here:
http://www.voiceage.com/amrsite/tech_nb_faqs.php
Comment 2 Chris Bainbridge (RETIRED) gentoo-dev 2005-10-09 09:17:55 UTC
I too would like to see AMR support (amr_nb codec) in the ebuild. 

Licensing is not an issue for the ebuild as we don't actually distribute
anything, otherwise we would have had to remove all mp3 apps and libs from
Gentoo. RESTRICT=nomirror stops any problems if we have no license to
redistribute, which is a different matter that may be at play here.
Comment 3 Philip Kovacs 2005-10-09 09:39:09 UTC
I have several customized video ebuilds, including full amr_nb and amr_wb
support for both mplayer and ffmpeg, using local USE flags amr_nb and amr_wb,
which you would put in /etc/portage/package.use.   I'll post them as the long as
the devs promise not to scold me on the licensing issue.
Comment 4 Philip Kovacs 2005-10-09 09:49:34 UTC
Created attachment 70233 [details]
ffmpeg-0.4.9_p20050906.ebuild with AMR support

The ebuild introduces two new local USE flags: amr_nb and amr_wb, which you
would add to /etc/portage/package.use, next to whatever else you need, e.g.

media-video/ffmpeg	aac amr_nb amr_wb

The needed codec specifications are downloaded automatically based on these USE
flags.	The libavcodec subdirectories for the codecs are created and populated
and the econf is altered to enable amr narrow and/or wide band, as needed.

I have a similar one for mplayer too.
Comment 5 Luca Barbato gentoo-dev 2005-10-09 10:14:36 UTC
unpack ${A} does unpack everything that got fetched, you can just use mv or
don't use ${A}
Comment 6 Philip Kovacs 2005-10-09 10:32:29 UTC
Luca, 

The codec zips contain zips themselves, so you should unpack everything.   trust
me, i worked this out.

Phil
Comment 7 Philip Kovacs 2005-10-09 10:36:06 UTC
Created attachment 70241 [details]
mplayer-1.0_pre7-r1.ebuild with AMR support

Same idea.  I added local USE flags amr_nb and amr_wb, to be added to
/etc/portage/package.use, e.g.

media-video/mplayer   amr_nb amr_wb cdparanoia dts -gtk <etc>
Comment 8 Patrick 2005-12-08 00:28:33 UTC
Hello,

I've tried to compile the patched ebuilds to get the amr feature but the emerge
stop with the following messages

emerge =ffmpeg-0.4.9_p20050226-r2 brings me:
------------------------------------------------------------------------------ 
 * Cannot find $EPATCH_SOURCE!  Value for $EPATCH_SOURCE is:
 *
 *   /home/bloodofme/.ebuilds/media-video/ffmpeg/files/gentoo-ffmpeg001.patch
 *   ( gentoo-ffmpeg001.patch )


!!! ERROR: media-video/ffmpeg-0.4.9_p20050226-r2 failed.
!!! Function epatch, Line 207, Exitcode 0
!!! Cannot find $EPATCH_SOURCE!
!!! If you need support, post the topmost build error, NOT this status message.
--------------------------------------------------------------------------------

and emerge =mplayer-1.0_pre7-r1
--------------------------------------------------------------------------------
 * Cannot find $EPATCH_SOURCE!  Value for $EPATCH_SOURCE is:
 *
 *   /home/bloodofme/.ebuilds/media-video/mplayer/files/mplayer-1.0_pre6-ppc64.p
atch
 *   ( mplayer-1.0_pre6-ppc64.patch )


!!! ERROR: media-video/mplayer-1.0_pre7-r1 failed.
!!! Function epatch, Line 207, Exitcode 0
!!! Cannot find $EPATCH_SOURCE!
!!! If you need support, post the topmost build error, NOT this status message.
--------------------------------------------------------------------------------

Is there something wrong with the source-urls in the ebuilds or did i something
wrong? would be happy about some help.

greetz
bloodofme
Comment 9 Casey Allen Shobe 2005-12-11 07:55:47 UTC
I needed to extract audio from 3gp files with ffmpeg as part of a process of 
converting 3gp to mpg (though if there's an amr flag for mplayer coming soon 
maybe I won't need ffmpeg at all??).  In any case, I manually downloaded and 
applied the patches, and used the same configure line that the ebuild was, 
plus the amr options, everything works as expected now. 
Comment 10 Philip Kovacs 2005-12-11 11:58:14 UTC
each overlay area (in your case: $HOME/.ebuilds/media-video/<package name>) must
have a "files" subdirectory containing the patches that epatch wants to apply.  
You want to mimic the structure of /usr/portage/media-video/<package name>
exactly.   You drop in your ebuilds and patches, digest them and emerge.

It's unusual to see a private, hidden overlay like the way yours set yours up. 
 I just use /usr/local/portage.

As a footnote, the two packages require some time and effort to keep up with. 
They are both very dynamic.
Comment 11 Philip Kovacs 2005-12-11 12:03:39 UTC
in fact the ffmpeg I posted here a while back won't work anymore.....upstrem
they eliminated bidirectional settings of the ffmpeg configure options.  in
other words , for any option 'X' it is now no longet the case that both
--enable-X and --disable-X work.  Only one side will work.  You need to
determine which direction works for each item and code an option for that in the
ebuild.  It's a poor way to  write a configure.
Comment 12 James Le Cuirot gentoo-dev 2006-03-02 10:29:17 UTC
I made the adjustments to the latest ebuilds by hand and it all worked fine. I really think Gentoo should allow this as an option.
Comment 13 Luca Barbato gentoo-dev 2006-03-03 09:50:21 UTC
the next snapshot will provide it, sorry for the delay
Comment 14 Philip Kovacs 2006-03-04 18:56:47 UTC
Created attachment 81360 [details]
mplayer-1.0.20060302.ebuild

Luca, Here's the same amr implementation, for mplayer, as I did for ffmpeg in bug 124883.   This one is even simpler since mplayer detects the amr directories and configures them automatically.  New use flag is 'amr'.

ebuild and ebuild diff follows

Phil
Comment 15 Philip Kovacs 2006-03-04 18:57:26 UTC
Created attachment 81361 [details, diff]
mplayer-1.0.20060302.ebuild.diff
Comment 16 Non_E 2006-04-16 04:59:19 UTC
Hello,
I have add amr support to mplayer 20060415 ebuild and playing 3gp sound fails (is mute) with message "[amr_nb @ 0x878bf2c]amr frame too short (18, should be 32)" repeating all the playing time.

20060302 works without any problems.

Regards,
Radek
Comment 17 Stephane Pointu 2006-07-07 07:07:07 UTC
Can this be included in portage tree?
Comment 18 Luca Barbato gentoo-dev 2006-07-07 08:38:05 UTC
I'd rather wait for a native implementation that is due the next season 
Comment 19 Chris Bainbridge (RETIRED) gentoo-dev 2006-07-07 09:43:51 UTC
Is there a native implementation? The mplayer amr patch from April http://lists.mplayerhq.hu/pipermail/mplayer-docs/2006-April/007515.html seems to tell people to do exactly what this ebuild does... that is, download the reference implementation.
Comment 20 Philip Kovacs 2006-07-07 10:58:24 UTC
Luca,

You already added this amr stuff into ffmpeg.  The mplayer ebuild changes are essentially the same, in fact even simpler, since mplayer auto-detects and configures for amr when the codec directories are created, so there's nothing to do after src_unpack(), i.e. --enable-amr is automatic.

Interesting that the mplayer patch mentioned in comment 19 uses links that are dead.   They should mention the archive/26_series links, as in the ebuilds.  

Phil
Comment 21 Luca Barbato gentoo-dev 2006-07-10 23:36:54 UTC
there is a ffmpeg amr native implementation getting developed right now, if there is that need for amr I'll add an -r1
Comment 22 Luca Barbato gentoo-dev 2006-07-11 08:02:01 UTC
I took some time to put a -r1 with some new features, please tell me if it is working for you
Comment 23 Philip Kovacs 2006-07-11 11:29:38 UTC
Luca, 

Looks good here.

Phil

$ mplayer -novideo sample.3gp
MPlayer 1.0pre8-3.4.6 (C) 2000-2006 MPlayer Team
CPU:               Intel(R) Pentium(R) 4 CPU 2.40GHz (Family: 15, Model: 2, Stepping: 7)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2


93 audio & 211 video codecs

Playing sample.3gp.
ISO: File Type Major Brand: 3GPP Profile 5
Quicktime/MOV file format detected.
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 8000 Hz, 1 ch, s16le, 128.0 kbit/100.00% (ratio: 16000->16000)
Selected audio codec: [ffamrnb] afm: ffmpeg (AMR Narrowband)
==========================================================================
alsa-init: using device default
alsa: 8000 Hz/1 channels/2 bpf/32768 bytes buffer/Signed 16 bit Little Endian
AO: [alsa] 8000Hz 1ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:   3.1 (03.0) of 5.0 (05.0)  0.3%
alsa-uninit: pcm closed
Comment 24 Stephane Pointu 2006-07-12 03:20:41 UTC
Luca,

I've tested both amrnb and amrwb and both work. 

Thanks,
Stephane

mplayer mp4-amrnb_c01_176x144_064kbps_08khz_005kbps_mono.3gp
MPlayer 1.0pre8-3.4.6 (C) 2000-2006 MPlayer Team
CPU: AMD Athlon(tm) 64 Processor 3000+ (Family: 15, Model: 12, Stepping: 0)
MMX supported but disabled
MMX2 supported but disabled
SSE supported but disabled
SSE2 supported but disabled
3DNow supported but disabled
3DNowExt supported but disabled
CPUflags:  MMX: 0 MMX2: 0 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions:


93 audio & 211 video codecs

Playing mp4-amrnb_c01_176x144_064kbps_08khz_005kbps_mono.3gp.
ISO: File Type Major Brand: 3GPP Profile 4
Quicktime/MOV file format detected.
VIDEO:  [mp4v]  176x144  24bpp  15.000 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 8000 Hz, 1 ch, s16le, 128.0 kbit/100.00% (ratio: 16000->16000)
Selected audio codec: [ffamrnb] afm: ffmpeg (AMR Narrowband)
==========================================================================
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
AO: [oss] 8000Hz 1ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 176 x 144 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [xv] 176x144 => 192x144 Planar YV12
No bind found for key 'c'.                         %  2%  0.2% 0 0
A:   5.5 V:   5.5 A-V:  0.001 ct:  0.002  84/ 84  1%  1%  0.2% 0 0
Exiting... (Quit)


mplayer mp4-amrwb_d01_174x120_052kbps_16khz_012kbps_mono.3gp
MPlayer 1.0pre8-3.4.6 (C) 2000-2006 MPlayer Team
CPU: AMD Athlon(tm) 64 Processor 3000+ (Family: 15, Model: 12, Stepping: 0)
MMX supported but disabled
MMX2 supported but disabled
SSE supported but disabled
SSE2 supported but disabled
3DNow supported but disabled
3DNowExt supported but disabled
CPUflags:  MMX: 0 MMX2: 0 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions:


93 audio & 211 video codecs

Playing mp4-amrwb_d01_174x120_052kbps_16khz_012kbps_mono.3gp.
ISO: File Type Major Brand: 3GPP Profile 4
Quicktime/MOV file format detected.
VIDEO:  [mp4v]  174x120  4bpp  15.152 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 16000 Hz, 1 ch, s16le, 256.0 kbit/100.00% (ratio: 32000->32000)
Selected audio codec: [ffamrwb] afm: ffmpeg (AMR Wideband)
==========================================================================
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
AO: [oss] 16000Hz 1ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 174 x 120 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [xv] 174x120 => 174x130 Planar YV12
A:   6.0 V:   5.9 A-V:  0.018 ct: -0.010  30/ 30  2%  1%  1.1% 0 0
Exiting... (Quit)