<div dir="ltr"><div><div><div><div><div>Hello,<br><br></div>I am using yocto to create image and cross-compile plugins for my board wandboard-dual. To use x264, I enabled x264 inside the configuration file and it cross-compiled for me. Now when I am trying to use x264enc with gstreamer, my usb camera attached with the board crashes with segmentation fault error. I have tested the camera before with other plugins to capture the video and they have worked properly. I wanted to know if the problem is already solved or would like help from you to be able to solve it.<br>
<br></div>Here is the segmentation fault error I got with the command I am running:<br>Everything in blue are the commands I ran on the board and red is the error.<br><br>root@wandboard-dual:~# <span style="color:rgb(0,0,255)">gst-launch v4l2src num-buffers=500 !
video/x-raw-yuv ! queue ! ffmpegcolorspace ! queue ! x264enc !
matroskamux ! filesink location=outputh264.mp4
sync=false</span> <br><br><span style="color:rgb(255,0,0)">Setting pipeline to PAUSED ... <br>Pipeline is live and does not need PREROLL ... <br>
Setting pipeline to PLAYING ... <br>New clock: GstSystemClock <br>Caught SIGSEGV accessing address 0x915 <br>
#0 0x40502bf4 in ?? () <br>#1 0x40502be4 in ?? () <br>#2 0x40502be4 in ?? () <br>
Spinning. Please run 'gdb gst-launch 2392' to continue debugging, Ctrl-C to qui<br>t, or Ctrl-\ to dump core.<br> <br><span style="color:rgb(0,0,0)">To see the reason I was getting the error, I cross-compiled image with developing tools. I have enabled developing tools in configuration file to be able to use as following:</span></span><br>
<br>EXTRA_IMAGE_FEATURES += "dbg-pkgs \ <br> dev-pkgs \ <br> tools-sdk \ <br> tools-debug \<br> tools-profile \ <br> "<br></div>After installing the developing tools, I ran the following:<br>
<br>root@wandboard-dual:/home#<span style="color:rgb(0,0,255)"> gdb</span><br><br>GNU gdb (GDB) 7.6<br>Copyright (C) 2013 Free Software Foundation, Inc.<br>License GPLv3+: GNU GPL version 3 or later <<a href="http://gnu.org/licenses/gpl.html">http://gnu.org/licenses/gpl.html</a>><br>
This is free software: you are free to change and redistribute it.<br>There is NO WARRANTY, to the extent permitted by law. Type "show copying"<br>and "show warranty" for details.<br>This GDB was configured as "arm-poky-linux-gnueabi".<br>
For bug reporting instructions, please see:<br><<a href="http://www.gnu.org/software/gdb/bugs/">http://www.gnu.org/software/gdb/bugs/</a>>.<br><br>(gdb) <span style="color:rgb(0,0,255)">file gst-launch</span><br>Reading symbols from /usr/bin/gst-launch...Reading symbols from /usr/bin/.debug/<br>
gst-launch...done.<br>done.<br><br>(gdb) <span style="color:rgb(0,0,255)">run v4l2src num-buffers=500 ! video/x-raw-yuv ! queue ! ffmpegcolorspace !<br>queue ! x264enc ! matroskamux ! filesink location=outputh264.mp4 sync=false</span><br>
<br>Starting program: /usr/bin/gst-launch v4l2src num-buffers=500 ! video/x-raw-yuv<br>! queue ! ffmpegcolorspace ! queue ! x264enc ! matroskamux ! filesink location=o<br>utputh264.mp4 sync=false<br><br>[Thread debugging using libthread_db enabled]<br>
Using host libthread_db library "/lib/libthread_db.so.1".<br>process 1641 is executing new program: /usr/bin/gst-launch-0.10<br>[Thread debugging using libthread_db enabled]<br>Using host libthread_db library "/lib/libthread_db.so.1". <br>
Setting pipeline to PAUSED ... <br>[New Thread 0x4133f460 (LWP 1644)] <br>[New Thread 0x41b3f460 (LWP 1645)] <br>
[New Thread 0x42695460 (LWP 1646)] <br>Pipeline is live and does not need PREROLL ... <br>Setting pipeline to PLAYING ... <br>
New clock: GstSystemClock <br>[New Thread 0x438c2460 (LWP 1647)] <br>[New Thread 0x440c2460 (LWP 1648)] <br>
[New Thread 0x448c2460 (LWP 1649)] <br>[New Thread 0x45dff460 (LWP 1650)] <br> <br>
Program received signal SIGSEGV, Segmentation fault. <br>[Switching to Thread 0x45dff460 (LWP 1650)] <br>0x40989e6c in x264_vbv_lookahead (keyframe=<optimized out>, <br>
num_frames=<optimized out>, frames=<optimized out>, a=<optimized out>, <br> h=<optimized out>) at encoder/slicetype.c:1297 <br>warning: Source file is more recent than executable. <br>
1297 frames[next_nonb]->i_planned_type[idx] = frames[cur_nonb]->i<br>_type;<br><br>(gdb)<span style="color:rgb(0,0,255)"> bt </span> <br>
<br>#0 0x40989e6c in x264_vbv_lookahead (keyframe=<optimized out>, <br> num_frames=<optimized out>, frames=<optimized out>, a=<optimized out>, <br> h=<optimized out>) at encoder/slicetype.c:1297 <br>
#1 x264_slicetype_analyse (h=h@entry=0x42edc7d0, <br> intra_minigop=intra_minigop@entry=1) at encoder/slicetype.c:1681 <br>#2 0x409bf7e8 in x264_lookahead_slicetype_decide (h=h@entry=0x42edc7d0) <br>
at encoder/lookahead.c:85 <br>#3 0x409bf8d0 in x264_lookahead_thread (h=0x42edc7d0) <br> at encoder/lookahead.c:113 <br>
#4 0x4027106c in start_thread (arg=0x45dff460) at pthread_create.c:314 <br>#5 0x4035a810 in ?? () at ../ports/sysdeps/unix/sysv/linux/arm/clone.S:97 <br> from /lib/libc.so.6 <br>
#6 0x4035a810 in ?? () at ../ports/sysdeps/unix/sysv/linux/arm/clone.S:97 <br> from /lib/libc.so.6 <br>Backtrace stopped: previous frame identical to this frame (corrupt stack?) <br>
<br></div>Basically it is the following line that is causing the problem for me:<br><a class="" href="http://git.videolan.org/?p=x264.git;a=blob;f=encoder/slicetype.c;h=22b2e914df77b8ec4c0ef91345d99fed4222bcd2;hb=HEAD#l1297">http://git.videolan.org/?p=x264.git;a=blob;f=encoder/slicetype.c;h=22b2e914df77b8ec4c0ef91345d99fed4222bcd2;hb=HEAD#l1297</a><br>
<br></div><div>Please let me know on how I can solve this error.<br><br></div><div>Thanks<br></div><div>--Tejas<br></div><div><div><div><div><p></p></div></div></div></div></div>