LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   ffmpeg crash on libx264... (https://www.linuxquestions.org/questions/slackware-14/ffmpeg-crash-on-libx264-885843/)

astanton 06-12-2011 01:20 AM

ffmpeg crash on libx264...
 
I was trying to run record it now, and switched from recordmydesktop to ffmpeg and it kept crashing. I tried it with the command line

Code:

ffmpeg -r 30 -s 1680x1050 -f x11grab -i :0.0 -vcodec msmpg2v2 -qscale 2 filename.avi
I have the following installed, but it's wanting libx264 which I don't see at slackbuilds.org:

Code:

x264-20101023-x86_64-1_SBo
Slackware64 13.1

Where should I start looking for missing things or...?

I also looked for xvidcap and kazam at slackbuilds.org but didn't see them there. Are those available?

disturbed1 06-12-2011 02:17 AM

You already have libx264 installed. It comes with x264 ;)
Code:

grep -i libx264 /var/log/packages/x264-20110422-x86_64-1_SBo
usr/lib64/libx264.so.115

If ffmpeg is crashing with an output about libx264, it's because ffmpeg was built against a different version of x264 than what you have installed. Could be because you compiled your own x264, but installed a pre-compiled version of ffmpeg from elsewhere.

astanton 06-12-2011 03:08 AM

Thank you very much.

I'm not sure what I did, but in desperatoin I installed all of the alien packages from taper.alienbase.nl/mirrors/people/alien/restricted_slackbuilds/ and now when i run recorditnow and choose ffmpeg it works!

But there is no sound.

So I go back to using recordmydesktop from the choices in recorditnow. That has other problems which is the reason I tried the ffmpeg.

I wanted to convert my recordmydesktop recordings.

This still gives me an error though:

Code:

mencoder -idx vid1.ogv -ovc lavc -oac mp3lame -o vid1.avi
gives this error:

Code:

MEncoder 20100926-4.4.4 (C) 2000-2010 MPlayer Team
MPlayer was compiled without libmp3lame support.

I installed lame from the alien link above, and I now have the alien lame, and slackbuild twolame I compiled. I didn't see a twolame or a x264 at the alien link though, so I don't know how to compile those slackbuilds so it works?

Two things are happening. I want sound, and ffmpeg choice isn't giving it in recorditnow. The other thing, I cannot convert my ogv to something for youtube.

the ffmpeg choice doesn't have choppy video, but no sound. And the recordmydestkop choice has very jumpy video.

I just want to make a smooth video with sound and put on youtube.

I hope you understand my problem.

EDIT: I have this installed - libmp4v2-1.9.1-x86_64-3_SBo.tgz and I found libmp3splt at slackbuilds.

Thank you for your help.

astanton 06-12-2011 04:02 AM

I have tried these command lines too and I get failures on them:

Code:

$ ffmpeg -r 30 -s 1680x1050 -f x11grab -i :0.0 -vcodec msmpg2v2 -qscale 2 filename.avi
FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
  built on Feb  3 2011 00:17:04 with gcc 4.4.4
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/man --enable-libmp3lame --enable-libfaac --enable-nonfree --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-libdc1394 --enable-libfaad --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvpx --enable-libx264 --enable-runtime-cpudetect --enable-vaapi --disable-vdpau --enable-memalign-hack --enable-pthreads --enable-x11grab --enable-bzlib --enable-zlib --enable-shared --enable-static --disable-debug --arch=x86_64 --enable-pic --extra-cflags='-I/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/include -DRUNTIME_CPUDETECT' --extra-ldflags='-L/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/lib64 -lssl -lcrypto -lz -lusb'
  libavutil    50.15. 1 / 50.15. 1
  libavcodec    52.73. 2 / 52.73. 2
  libavformat  52.64. 2 / 52.64. 2
  libavdevice  52. 2. 0 / 52. 2. 0
  libavfilter    1.19. 0 /  1.19. 0
  libswscale    0.11. 0 /  0.11. 0
  libpostproc  51. 2. 0 / 51. 2. 0
[x11grab @ 0x63a4f0]device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1680 height: 1050
[x11grab @ 0x63a4f0]shared memory extension  found
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  138 (MIT-SHM)
  Minor opcode of failed request:  4 (X_ShmGetImage)
  Serial number of failed request:  11
  Current serial number in output stream:  11

And this

Code:

$ ffmpeg -f alsa -i pulse -f x11grab -r 25 -s 1440x900 -i :0.0 -acodec pcm_s16le -vcodec huffyuv -sameq Screencast.avi
FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
  built on Feb  3 2011 00:17:04 with gcc 4.4.4
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/man --enable-libmp3lame --enable-libfaac --enable-nonfree --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-libdc1394 --enable-libfaad --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvpx --enable-libx264 --enable-runtime-cpudetect --enable-vaapi --disable-vdpau --enable-memalign-hack --enable-pthreads --enable-x11grab --enable-bzlib --enable-zlib --enable-shared --enable-static --disable-debug --arch=x86_64 --enable-pic --extra-cflags='-I/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/include -DRUNTIME_CPUDETECT' --extra-ldflags='-L/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/lib64 -lssl -lcrypto -lz -lusb'
  libavutil    50.15. 1 / 50.15. 1
  libavcodec    52.73. 2 / 52.73. 2
  libavformat  52.64. 2 / 52.64. 2
  libavdevice  52. 2. 0 / 52. 2. 0
  libavfilter    1.19. 0 /  1.19. 0
  libswscale    0.11. 0 /  0.11. 0
  libpostproc  51. 2. 0 / 51. 2. 0
ALSA lib pcm.c:2211:(snd_pcm_open_noupdate) Unknown PCM pulse
[alsa @ 0x63a4f0]cannot open audio device pulse (No such file or directory)
pulse: Input/output error

I just want to record some videos with sound and put them on youtube. This is very hard and I don't understand a lot of the gibberish I'm getting back from the commandline

disturbed1 06-12-2011 04:37 AM

Unknown PCM pulse
Do you have pulse audio installed?

Your mencoder error is obvious, the mplayer package you are using was not compiled while lame was installed. Install lame, then compile mplayer. The sources for mplayer are available on your Slackware DVD/CD or from any mirror.

http://www.ffmpeg.org/ffmpeg-doc.html#SEC21 <-- Thats the section for capturing audio.

The format would be something similar to (you'll need to adjust to fit your hardware)
Code:

ffmpeg -f alsa -i plughw:0,0 -f x11grab -r 25 -s 1440x900 -i :0.0 -acodec pcm_s16le -vcodec huffyuv -sameq Screencast.avi
If you're trying to capture opengl footage (such as a game) look into glc instead. https://github.com/nullkey/glc/wiki

Alien Bob 06-12-2011 05:26 AM

If you want ffmpeg to record sound in mp3 or aac format, you need the package in my "restricted" resository. The one that I keep on slackware.com has the mp3 and aac encoding capability stripped off because I am not allowed to host these encoders on a US server due to patent infringement regulations.

My repository outside the US does have a version of my ffmpeg package which is able to record mp3 audio (aac as well but I guess you want mp3).
Get it either here: http://taper.alienbase.nl/mirrors/pe...builds/ffmpeg/ or here: http://slackware.org.uk/people/alien...builds/ffmpeg/

And by the way, my ffmpeg package has twolame and x264 built-in, along with lame, aac and everything else you can think of. It does not need any other package to work.

Eric

EDIT: ah, I saw you already used that version of my ffmpeg package... hm then I have no idea why it did not record sound.

astanton 06-12-2011 07:15 AM

Quote:

Originally Posted by disturbed1 (Post 4383220)
Do you have pulse audio installed?

No I don't think I do.

Quote:

Originally Posted by disturbed1 (Post 4383220)
Your mencoder error is obvious, the mplayer package you are using was not compiled while lame was installed. Install lame, then compile mplayer. The sources for mplayer are available on your Slackware DVD/CD or from any mirror.

Okay will do. Thank you.

Quote:

Originally Posted by disturbed1 (Post 4383220)
The format would be something similar to (you'll need to adjust to fit your hardware)
Code:

ffmpeg -f alsa -i plughw:0,0 -f x11grab -r 25 -s 1440x900 -i :0.0 -acodec pcm_s16le -vcodec huffyuv -sameq Screencast.avi

Okay I'm getting somewhere now. I'm not trying to capture any games. Actually, just an xterm right now, and other programs on my desktop. It is doing that now with recorditnow using either recordmydesktop (very sluggish, and the sound is out of sync too) or with ffmpeg using recorditnow front end or cli (no sound either way)

The command line you gave is working, and it also works with

Code:

ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -r 25 -s 1440x900 -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 output.mkv
No matter which one, no sound.

I have a hp dv9000 laptop, and the sound with recordmydesktop is using the builtin mic, if that helps.

disturbed1 06-12-2011 03:02 PM

Quote:

Originally Posted by astanton (Post 4383286)
I have a hp dv9000 laptop, and the sound with recordmydesktop is using the builtin mic, if that helps.

Then you'll want to change plughw:0,0 to plughw:0,1 or some other number. For a better description read this http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html . It also gives examples. If plughw:#,# is not working, you can also try hw:0,0.

astanton 06-12-2011 05:45 PM

Quote:

Originally Posted by disturbed1 (Post 4383569)
Then you'll want to change plughw:0,0 to plughw:0,1 or some other number.... If plughw:#,# is not working, you can also try hw:0,0.

I tried variations of the command lines above (with the mkv and avi containers), and it all seems to work well, except there still is no sound.

Adjusting

Code:

-f alsa -i plughw:0,0
Some of the variations included

-f alsa -i plughw:0,1 (All numbers after the comma gave errors - no device)

-f alsa -i hw:0 (worked fine w/o comma,num)

-f oss (errors - no device)

But on all variations I noticed I'm getting something like:

Code:

[alsa @ 0x63a4f0]ALSA buffer xrun.
frame=  12 fps=  1 q=0.0 Lsize=  18678kB time=0.01 bitrate=15301204.8kbits/s

I found this link: http://www.alsa-project.org/main/index.php/XRUN_Debug

But trying to get a debug with:

Code:

# echo 1 > /proc/asound/card0/pcm0p/xrun_debug
-bash: /proc/asound/card0/pcm0p/xrun_debug: No such file or directory

There is no xrun_debug

Code:

# ls /proc/asound
NVidia@  card0/  cards  devices  hwdep  modules  oss/  pcm  seq/  timers  version
# ls /proc/asound/card0
codec#0  id  oss_mixer  pcm0c/  pcm0p/  pcm1p/
# ls /proc/asound/card0/pcm0p
info  oss  sub0/
# ls /proc/asound/card0/pcm0p/info
/proc/asound/card0/pcm0p/info
# cat /proc/asound/card0/pcm0p/info
card: 0
device: 0
subdevice: 0
stream: PLAYBACK
id: CONEXANT Analog
name: CONEXANT Analog
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 0

NVidia@ is a symlink to card0.

Using the example at the link you gave me, I get an error when I use hw:0, but when I use this:

Code:

ffmpeg -f alsa i plughw:0 alsaout.wav
I get sound!!!!!

So it looks like I should use plughw:0 or plughw:0,0 from now on? Now I just need to make sound and video at the same time. mostly an xterm, but some of my desktop too. no games though.

So progress is beind made and AlienBob will be happy to know that his 'restricted' ffmpeg is really working for me! I didn't thank him yet for offering help with a post.

Any ideas on where I might go from here?

disturbed1 06-12-2011 07:53 PM

Quote:

Originally Posted by astanton (Post 4383642)
So progress is beind made and AlienBob will be happy to know that his 'restricted' ffmpeg is really working for me! I didn't thank him yet for offering help with a post.

Any ideas on where I might go from here?

We would all be lost without Pat, Robby, Eric, and the other less vocal members of Slackware.


Honestly, I personally don't have a clue where to go from here :(
I tried it here on my end, and came up with the same output as you - Video works, Audio works, Audio + Video results in no Audio. I'd cover the basics, and check alsamixer to make sure the correct device is flagged for recording, and reference the output of arecord -l which gives a listing of available recording devices.
If someone with more knowledge doesn't chime in, I'd take it to the ffmpeg/libav mailing list. And please post your results. For good of the community, and I'm personally perturbed about this now :)

astanton 06-12-2011 09:43 PM

Quote:

Originally Posted by disturbed1 (Post 4383699)
. And please post your results. For good of the community...

Oh I certainly will. I like to see those [SOLVED] thread headers - it usually means I can go there first and skip most of the anguish and kruft :)


All times are GMT -5. The time now is 09:57 PM.