LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-12-2018, 11:03 AM   #1
ordealbyfire83
Member
 
Registered: Oct 2006
Location: Leiden, Netherlands
Distribution: LFS, Ubuntu Hardy
Posts: 279

Rep: Reputation: 69
ffmpeg with x264 using wrong cpu instructions


I am wondering whether it is possible to decode / encode x264 videos with ffmpeg without using automagically-detected cpu extensions. I am seeing a couple of issues which happen regardless of which versions of ffmpeg and libx264 that I use.

First example: I suspect that some of these instruction sets might only be accessible through microcode updates. When using the Libreboot BIOS replacement, I sometimes get MCE errors and the CPU apparently halts; no kernel panic, this is a fault well below the kernel. (Much the same also happens on an Acer laptop with closed bios and an AMD CPU.)

Second example: I built ffmpeg and numerous dependencies for an ARMv5 machine natively (as in built on ARMv5, not cross-compiled). Everything compiled without incident; however, when compiling x264 I noticed seeing some -mcpu flag set as cortex-a8 (!) So when I try running ffmpeg and doing anything with x264 I of course get "Illegal instruction."

Is there any way to use the x264 library in a cpu-agnostic way?
 
Old 11-12-2018, 08:18 PM   #2
ordealbyfire83
Member
 
Registered: Oct 2006
Location: Leiden, Netherlands
Distribution: LFS, Ubuntu Hardy
Posts: 279

Original Poster
Rep: Reputation: 69
Ok, well rebuilding x264 with "--disable-asm" supposedly turns off detection of cpu capabilities. This makes it work on armv5, however it is wicked slow. I say it 'supposedly' disables this because the outputted files are not reproducible; they differ by a few hundred bytes at least. (Using the same version of ffmpeg and x264, the identical source file, and identical ffmpeg args, I get different file sizes on armv5, i686, and x86_64 all with "--disable-asm".) Likewise, without "--disable-asm" outputted files are reproducible on the same machine, but that's it.

I'd rather there be some way of specifying what cpu extensions to use rather than turning them off completely. Even on an x86_64 dual-core cpu with several gigabytes of RAM I'm not getting much more than 3 seconds per frame (yes, that's inverse frames per second).
 
Old 11-13-2018, 01:39 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 15,798
Blog Entries: 9

Rep: Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637Reputation: 4637
this is all very specialised; have you considered opening a bug report for ffmpeg upstream?
https://trac.ffmpeg.org/wiki
 
Old 12-04-2018, 08:08 PM   #4
ordealbyfire83
Member
 
Registered: Oct 2006
Location: Leiden, Netherlands
Distribution: LFS, Ubuntu Hardy
Posts: 279

Original Poster
Rep: Reputation: 69
Yeah filing a bug would make the most sense, though in this case it is almost impossible to document anything. Crashes happen with no warning, and very often there is no crash at all. So debugging just means converting videos and waiting for my main production laptop to crash, which isn't something I've been very willing to do.

This too typically happens whenever I try to read from videos recorded with a particular Sony camera, which seems to use a non-standard x264 implementation (AVCHD, whatever that exactly means), so who knows.

I guess I was looking for a more short-term approach like passing a particular argument to ffmpeg's x264 functions but it appears there aren't any. It looks like libx264 takes the approach that it knows best, except that it doesn't.
 
Old 12-08-2018, 05:32 PM   #5
seasons
Member
 
Registered: Dec 2014
Distribution: siduction
Posts: 262

Rep: Reputation: 57
Maybe you could pass extra flags when you ./configure x264 using --extra-cflags= parameter. Exactly what CPU do you have? This might be helpful: https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sbopkg - how to install svn versions of x264, ffmpeg, mplayer and why? pokipoki08 Slackware 5 02-01-2010 11:14 PM
HowTo: Custom ffmpeg with x264 support for AMD64 on Debian Squeeze propofol Linux - Software 0 10-09-2009 01:34 AM
LXer: Upgrade To The Latest FFmpeg and x264 in Ubuntu Intrepid and Jaunty LXer Syndicated Linux News 0 08-30-2009 08:20 PM
Green screen after video conversion, AVI to MP4 using Mencoder,Mplayer,FFmpeg,x264, manuken Linux - Newbie 4 10-29-2008 07:40 PM
AMD64:x264 ffmpeg problems chronosoft Ubuntu 1 06-10-2007 10:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration