Opened 12 years ago

Closed 5 years ago

#33343 closed defect (fixed)

encoding x264 with ffmpeg does not use CPU capabilities on 64bit 10.7.3

Reported by: sonniesedge@… Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: Cc: jeremyhu (Jeremy Huddleston Sequoia), cooljeanius (Eric Gallager)
Port: x264 ffmpeg

Description

I've tried compiling both ffmpeg and ffmpeg-devel on my Core 2 Duo. It seems to compile fine, but when attempting to transcode a video the following warning is shown: "using cpu capabilities: none!".

This makes ffmpeg practically unusable on my machine. Is there anything I can do to force in CPU capabilities?

I notice that ticket:20938 seems to address this, but it is reported as fixed there.

Attachments (1)

ffmpeg.install.log (806.7 KB) - added by sonniesedge@… 12 years ago.
ffmpeg install log

Download all attachments as: .zip

Change History (16)

comment:1 in reply to:  description Changed 12 years ago by sonniesedge@…

Additional data:

 built on Feb 24 2012 07:39:23 with gcc 4.2.1 (Apple Inc. build 5666) (dot 3)
 configuration: --prefix=/opt/local --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libxvid --enable-libx264 --enable-libvpx --enable-libspeex --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/gcc-4.2 --arch=x86_64 --enable-yasm --enable-nonfree --enable-libfaac

comment:2 Changed 12 years ago by sonniesedge@…

Some more: Using Xcode 4.1

Tried adding in --enable-mmx and --enable-mmx2 to the portfile. Ffmpeg builds successfully but still reports as using no CPU capabilities.

comment:3 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: ffmpeg removed
Owner: changed from macports-tickets@… to devans@…

Changed 12 years ago by sonniesedge@…

Attachment: ffmpeg.install.log added

ffmpeg install log

comment:4 Changed 12 years ago by merseyparadise@…

I think this may be an issue with libx264 rather than ffmpeg in general. I get the same issue with the x264 port, but managed to get capabilities working with a version I built from source. Also I've only seen the problem in conversions using libx264, e.g.:

[libx264 @ 0x7fb4b0844800] using cpu capabilities: none!

I've also used this version of ffmpeg as an output via yuv4mpegpipe and a fifo to my separately-built x264, and it uses all capabilities.

That said, the issue may be more general, or you may already be aware of the stuff I've mentioned. Hope it is of help, though.

comment:5 Changed 12 years ago by merseyparadise@…

So... I've done a little more research on this, and the same bug with x264 seems to present itself in the package from the ubuntu repositories:

https://bugs.launchpad.net/ubuntu/+source/x264/+bug/684198

Seems that it's --disable-asm in the x264 compilation that's causing the issue.

comment:6 Changed 12 years ago by merseyparadise@…

I've had a little more time to play with this, and the good news is that the asm variant of x264 fixes this issue. The bad news is that is segfaults as soon as you use ffmpeg with the -vcodec libx264 option. Yay.

comment:7 Changed 12 years ago by merseyparadise@…

*it* segfaults, even.

comment:8 Changed 12 years ago by merseyparadise@…

Still can't get this to work with +asm. While we're waiting for a fix, a workaround is to uninstall the ffmpeg port, uninstall the x264 port, compile x264 after editing configure to use CC=clang (I've since found out that CC should be llvm-gcc, but clang seems to work), and compile ffmpeg with:

./configure --enable-gpl --enable-postproc --enable-swscale --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libopenjpeg --enable-libxvid --enable-libx264 --enable-libvpx --enable-libspeex --enable-shared --enable-pthreads --cc=clang --extra-cflags=-I/usr/local/include --extra-cflags=-I/opt/local/include --extra-ldflags=-L/usr/local/lib --extra-ldflags=-L/opt/local/lib

...which are the same options that the port uses, apart from setting the compiler as clang and dragging in your x264 libraries from /usr/local/bin. Works a treat. Now all I need is a set of updated presets... :)

comment:9 Changed 12 years ago by jmroot (Joshua Root)

Port: x264 added
Summary: Ffmpeg does not include CPU capabilities on 64bit 10.7.3encoding x264 with ffmpeg does not use CPU capabilities on 64bit 10.7.3

comment:10 in reply to:  8 ; Changed 11 years ago by pavel.grabarnick@…

i ended up compiling both x264 +asm and ffmpeg +nonfree with llvm-gcc:
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

and i now i have x264 with cpu capabilities:
[libx264 @ 0x7fda4982f200] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
and x264 is not crashing with segfault.

compiling x264 with clang led to segfault regardless of which compiler was used to build ffmpeg.

Replying to merseyparadise@…:

Still can't get this to work with +asm. While we're waiting for a fix, a workaround is to uninstall the ffmpeg port, uninstall the x264 port, compile x264 after editing configure to use CC=clang (I've since found out that CC should be llvm-gcc, but clang seems to work), and compile ffmpeg with:

./configure --enable-gpl --enable-postproc --enable-swscale --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libopenjpeg --enable-libxvid --enable-libx264 --enable-libvpx --enable-libspeex --enable-shared --enable-pthreads --cc=clang --extra-cflags=-I/usr/local/include --extra-cflags=-I/opt/local/include --extra-ldflags=-L/usr/local/lib --extra-ldflags=-L/opt/local/lib

...which are the same options that the port uses, apart from setting the compiler as clang and dragging in your x264 libraries from /usr/local/bin. Works a treat. Now all I need is a set of updated presets... :)

comment:11 in reply to:  10 Changed 11 years ago by catimp99@…

Last edited 11 years ago by catimp99@… (previous) (diff)

comment:12 Changed 11 years ago by catimp99@…

I just upgraded x264 like this:
sudo port upgrade --enforce-variants x264 +asm

and now it's
using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX

took a lot of googling to find the correct syntax
(by the way, I apologize for creating a blank comment above--I'm new around here)

Last edited 11 years ago by catimp99@… (previous) (diff)

comment:13 Changed 11 years ago by neverpanic (Clemens Lang)

Cc: jeremyhu@… added

comment:14 Changed 10 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:15 Changed 5 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

It looks like this is long since fixed – asm is disabled only for 32-bit x86 builds of x264. Please reopen if you do still see the issue.

Note: See TracTickets for help on using tickets.