Illegal instruction: 4 in ffmpeg - macos

I tried brew installed ffmpeg, i am also tried to compile ffmpeg but in all cases i have the error
Illegal instruction: 4
I run something like this:
./ffmpeg -i /Users/ruslan/Torrents/Weird\ smiling\ dog.3gp -codec:v libx264 -b:v 360k -maxrate 360k -bufsize 720k -movflags +faststart -vprofile high -preset slow -vf 'scale=trunc(iw/2)*2:360' -threads 0 -codec:a libfdk_aac -b:a 96k -ac 2 -f mp4 -threads 0 -y /dev/null >> /Users/ruslan/erosite/log/ffmpeg_convertation.log 2>&1
Illegal instruction: 4
Or only ffmpeg with options when used homebrews installed version
Additional info:
OS X Yosemite 10.10.2
MacBook Pro (15-inch, Mid 2009)

This may happen when you restore OS X from Time Machine backup to another computer with different architecture (eg. Haswell to Ivy Bridge). ffmpeg might have been compiled with optimization for a particular architecture. Reinstalling ffmpeg worked for me.
$ brew uninstall ffmpeg && brew install ffmpeg
If you have multiple version of ffmpeg present, run the uninstall command multiple times.
On reinstalling ffmpeg was not compiled on my machine but poured from a precompiled bottle.

A problem was resolved when I fully reinstall brew.

Related

how to use FFMPEG to transcode h264 to h265 on Ubuntu 12.04?

I am ching.
I use the following command to transcode h264 to h265.
ffmpeg -i input.mp4 -c:v libx265 -crf 26 -preset fast -c:a aac -b:a 128k output.mp4
But the result is
Unknown encoder 'libx265'
But I have compiled h265 by the following command before using the above command.
sudo apt-get install cmake mercurial
cd ~/ffmpeg_sources
hg clone https://bitbucket.org/multicoreware/x265
cd ~/ffmpeg_sources/x265/build/linux
PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
make
make install
Then, I use ffmpeg -codecs to check if it supports to encode h265.
The result is
D.V.L. hevc H.265 / HEVC (High Efficiency Video Coding)
It seems that ffmpeg does not support h265.
How can I solve this problem?
To call the ffmpeg binary in the current folder do
./ffmpeg -i input.mp4 -c:v libx265 -crf 26 -preset fast -c:a aac -b:a 128k output.mp4
Without ./ it will call the binary in /usr/bin which is probably installed through apt without x265 in it.
Hint: The jump in efficiency between preset medium and fast is really high, medium is way better than fast. The same goes for slow and medium (all other presets make no big difference), so consider using slow if you have a little bit more time.

End of file on 19 min from start

I want to make like a youtube radio. It's infinity looping video(2 second) and one audio stream(radio). Always after 19 minutes, I getting an error. Does anyone know resolve for that?
UPD:
command: ffmpeg -re -stream_loop -1 -i video.mp4 -i http://127.0.0.1:3000/stream -c:v libx264 -preset ultrafast -map 0:v:0 -map 1:a:0 -filter_complex [0:v]fps=25,format=yuv420p -b:v 4500k -q:v 3 -f flv rtmp://a.rtmp.youtube.com/live2/KEY
Looks like bug #7547 ffmpeg quits with av_interleaved_write_frame message.
Comments indicate it may be an issue with librtmp. Your ffmpeg has been compiled with --enable-librtmp, so it may be affected. Using the built-in FFmpeg RTMP support may avoid this issue.
Recompile without --enable-librtmp (omit --with-rtmpdump if using Homebrew), or download an already compiled build from Evermeet and try that.

ffmpeg x264 encoding cpu usage

I want to convert a mkv formatted video to mp4, using the ffmpeg application.
and for that I ran below command in terminal:
ffmpeg -y -i c38a4990774b3c23.mkv -c:v libx264 -c:a aac -r 25 -strict -2 -map_metadata -1 -movflags faststart -vf "crop=1920:800:0:4, scale=iw*min(426/iw\,240/ih):ih*min(426/iw\,240/ih), pad=426:240:(426-iw*min(426/iw\,240/ih))/2:(240-ih*min(426/iw\,240/ih))/2, setsar=sar=1" output.mp4
I have compiled ffmpeg with --enable-pthread configuration
when I run this command on my personal PC with a 3.2GHz quad core cpu, it uses 60% of overall cpu process and encode video with 150fps; but when I run this command on a production server with 8 2.4GHz dual core cpu (16 core) it only uses up to 20% of overall cpu process and encode video with 97fps.
I have also tried ramdisk but I got no performance improvement.

ffmpeg to combine two mov files from iPhone

I'm trying to combine two videos recorded on an iPhone into one file with ffmpeg.
I've tried everything I could find and I can't get anything to work right.
My current line is
ffmpeg -i 'concat:output.mov|capturedvideo.MOV' -vcodec copy -acodec copy output2.mov
This currently won't work. The end result needs to be played on an iPhone.
Since you are not transcoding, you cannot concatenate two mp4 containers just like that. See this page.
In essence, you have to convert the files (without transcoding) to MPEG transport streams:
ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4
You'll need a recent version of ffmpeg. Try sudo apt-get update; sudo apt-get install ffmpeg (on Ubuntu Linux) or brew update; brew install ffmpeg (on Mac OS X)

I only have two presets for ffmpeg x264 in ubuntu 11.04

I'me trying to install (compile) ffmpeg for ubuntu 11.04 by following this guide:
https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide
Overall it works. Except for some errors with checkinstall due to numbering, which i resolved with this:
http://judsonsnotes.com/notes/index.php?option=com_content&view=section&layout=blog&id=3&Itemid=54&limitstart=40
I'd say it was installed ok.
But when trying to encode some video with -vpre lossless_slow i get this error:
File for preset lossless_slow not found.
And in fact it doesn't exists. All i have is this:
/usr/local/share/ffmpeg:
libvpx-1080p50_60.ffpreset
libvpx-1080p.ffpreset
libvpx-360p.ffpreset
libvpx-720p50_60.ffpreset
libvpx-720p.ffpreset
libx264-ipod320.ffpreset
libx264-ipod640.ffpreset
Where are all the other presets ? in google usually people have many more presets than i do. What did i do wrong ?
From this post i'd say that they shopuld be there: http://git.videolan.org/?p=ffmpeg.git;a=commit;h=4b82e3cedcfc9871671bb613cd979de6995dcb4e
Thanks a lot !
FFmpeg now accesses the x264 internal presets instead of using text files to emulate them. This is easier to maintain and use. Now you must use the -preset option instead of -vpre. Current presets are: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo. Ignore placebo as it is a joke and a waste of time.
CRF Example:
ffmpeg -i input -c:v libx264 -preset slow -crf 22 -c:a copy output.mkv
Two-Pass Example:
ffmpeg -i input -c:v libx264 -preset fast -b:v 555k -pass 1 -an -f mp4 - && \
ffmpeg -i input -c:v libx264 -preset fast -b:v 555k -pass 2 -c:a libfaac -b:a 128k output.mp4
These examples come from the x264 Encoding Guide community wiki page at ffmpeg.org.

Resources