Page 1 of 1

SIGSEGV while using libVLC 1.1.4 in libx264_plugin.dll

Posted: 15 Sep 2010 18:50
by Titanic
Hi everybody,

I'm new to libVLC programming so please be patient with me.

I'm developing an application on Windows (Win 7 x64 with MinGW for GDB) which uses the invmem module to get pictures from a memory block into libVLC. If I only display the pictures imported it works and I see the pictures. Now libVLC should transcode the pictures and send them as a RTP stream over the network (:sout=#transcode{vcodec=h264,vb=0,scale=1,fps=15,acodec=mp4a,ab=64,channels=1,samplerate=44100}:rtp{dst=10.0.3.109,port=5544,mux=ts}).

When I start my application everything is going OK until the stream is started. Here's the log file:

-- logger module started --
main debug: using interface module "logger"
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main debug: looking for interface module: 1 candidate
main debug: using interface module "hotkeys"
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main debug: rebuilding array of current - root Playlist
main debug: rebuild done - 0 items, index -1
main debug: Activated
main debug: adding item `(null)' ( file:///C:/msys/1.0/home/hgaechter/debug/ )
main debug: Creating an input for '(null)'
main debug: no fetch required for (null) (art currently (null))
main debug: Creating an input for '(null)'
main debug: thread (input) created at priority 1 (input/input.c:214)
main debug: thread started
main debug: using sout chain=`transcode{vcodec=h264,vb=0,scale=1,fps=15,acodec=mp4a,ab=64,channels=1,samplerate=44100}:rtp{dst=10.0.3.109,port=5544,mux=ts}'
main debug: stream=`rtp'
main debug: looking for sout stream module: 1 candidate
main debug: set config option: sout-rtp-dst to 10.0.3.109
main debug: set config option: sout-rtp-port to 5544
main debug: set config option: sout-rtp-mux to ts
main debug: looking for sout mux module: 1 candidate
mux_ts debug: shaping=200000 pcr=70000 dts_delay=400000
main debug: using sout mux module "mux_ts"
main debug: TIMER module_need() : 80.000 ms - Total 80.000 ms / 1 intvls (Avg 80.000 ms)
main debug: muxer support adding stream at any time
main debug: muxer prefers to wait for all ES before starting to mux
stream_out_rtp debug: maximum RTP packet size: 1400 bytes
main debug: net: connecting to [10.0.3.109]:5544
main debug: net: connecting to [10.0.3.109]:5545 from [10.0.3.109]:61445
stream_out_rtp debug: sdp=
v=0
o=- 15004715952800009868 15004715952800009868 IN IP4 HG7
s=Unnamed
i=N/A
c=IN IP4 10.0.3.109
t=0 0
a=tool:vlc 1.1.4
a=recvonly
a=type:broadcast
a=charset:UTF-8
m=video 5544 RTP/AVP 33
b=RR:0
a=rtpmap:33 MP2T/90000
main debug: using sout stream module "stream_out_rtp"
main debug: TIMER module_need() : 775.000 ms - Total 775.000 ms / 1 intvls (Avg 775.000 ms)
main debug: stream=`transcode'
main debug: looking for sout stream module: 1 candidate
main debug: set config option: sout-transcode-vcodec to h264
main debug: set config option: sout-transcode-vb to 0
main debug: set config option: sout-transcode-scale to 1
main debug: set config option: sout-transcode-fps to 15
main debug: set config option: sout-transcode-acodec to mp4a
main debug: set config option: sout-transcode-ab to 64
main debug: set config option: sout-transcode-channels to 1
main debug: set config option: sout-transcode-samplerate to 44100
stream_out_transcode debug: codec audio=mp4a 44100Hz 1 channels 64Kb/s
stream_out_transcode debug: codec video=h264 0x0 scaling: 1.000000 0kb/s
main debug: using sout stream module "stream_out_transcode"
main debug: TIMER module_need() : 5.000 ms - Total 5.000 ms / 1 intvls (Avg 5.000 ms)
main debug: using timeshift granularity of 50 MiB
main debug: using timeshift path 'C:\Users\HGAECH~1\AppData\Local\Temp'
main debug: `fake://' gives access `fake' demux `' path `'
main debug: creating demux: access='fake' demux='' path=''
main debug: looking for access_demux module: 1 candidate
access_fake debug: fake:// access_demux detected
main debug: selecting program id=0
main debug: using access_demux module "access_fake"
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main debug: looking for packetizer module: 21 candidates
main debug: using packetizer module "packetizer_copy"
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main debug: thread started
main debug: thread (decoder) created at priority 0 (input/decoder.c:301)
main debug: starting in async mode
main debug: looking for meta reader module: 1 candidate
lua debug: Trying Lua scripts in C:\Users\hgaechter\AppData\Roaming\vlc\lua\meta\reader
lua debug: Trying Lua scripts in C:\msys\1.0\home\hgaechter\debug\lua\meta\reader
main debug: no meta reader module matching "any" could be loaded
main debug: TIMER module_need() : 5.000 ms - Total 5.000 ms / 1 intvls (Avg 5.000 ms)
main debug: `fake://' successfully opened
main debug: Buffering 0%
main debug: switching to sync mode
main debug: Buffering 13%
main debug: adding a new sout input (sout_input:0x6515db0)
stream_out_transcode debug: creating video transcoding from fcc=`fake' to fcc=`h264'
main debug: looking for decoder module: 34 candidates
main debug: using decoder module "invmem"
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main debug: looking for encoder module: 11 candidates
x264 debug: version x264 0.98.X
x264 debug: initializing pthread-win32
main debug: using encoder module "x264"
main debug: TIMER module_need() : 35.000 ms - Total 35.000 ms / 1 intvls (Avg 35.000 ms)
x264 debug: framecount still in libx264 buffer: 0
main debug: Buffering 26%
x264 debug: pthread-win32 deinitialized
main debug: removing module "x264"
main debug: Buffering 40%
main debug: Buffering 53%
main debug: Buffering 66%
main debug: Buffering 80%
main debug: Buffering 93%
main debug: Stream buffering done (320 ms in 320 ms)
main debug: Decoder buffering done in 0 ms
stream_out_transcode debug: late picture skipped (140000)
stream_out_transcode debug: late picture skipped (110000)
stream_out_transcode debug: late picture skipped (75000)
stream_out_transcode debug: late picture skipped (45000)
stream_out_transcode debug: late picture skipped (10000)
stream_out_transcode debug: drift is too high, resetting master sync
stream_out_transcode debug: decoder aspect is 1.333333:1
stream_out_transcode debug: source pixel aspect is 1.000000:1
stream_out_transcode debug: scaled pixel aspect is 1.000000:1
stream_out_transcode debug: source 1280x960, destination 1280x960
stream_out_transcode debug: encoder aspect is 1280:960
main debug: looking for video filter2 module: 18 candidates
swscale debug: 1280x960 chroma: RV24 -> 1280x960 chroma: I420 with scaling using Bicubic (good quality)
main debug: using video filter2 module "swscale"
main debug: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
main debug: Filter 'Swscale' (0x6517e38) appended to chain
stream_out_transcode debug: destination (after video filters) 1280x960
main debug: looking for encoder module: 11 candidates
x264 debug: version x264 0.98.X
x264 debug: initializing pthread-win32
main debug: using encoder module "x264"
main debug: TIMER module_need() : 30.000 ms - Total 30.000 ms / 1 intvls (Avg 30.000 ms)
main debug: adding a new input
mux_ts debug: adding input codec=h264 pid=68
mux_ts debug: new PCR PID is 68

At this point I get a SIGSEGV in module libx264_plugin.dll (address 0x6e2ebbc4, function x264_frame_expand_boder_lowres) and the application crashes.

I've also tried to use the fake access module and option :fake-file=C:\Temp\Test.bmp with VLC to see if VLC also crashes but it doesn't. Tested with fake access and file in my program: Same crash as with invmem.

If I change the stream to a MMS with WMV/WMA codecs for transcoding it works without any problems so it seems to be something which is hidden in one of the libraries used for RTP, H.264 and MP4. I assume that something is going wrong in the x264 library because the SIGSEGV was reported there.

Perhaps somebody could shed a little light on this.

Re: SIGSEGV while using libVLC 1.1.4 in libx264_plugin.dll

Posted: 15 Sep 2010 23:03
by Jean-Baptiste Kempf
Did you compile your plugins or are you using VLC's normal ones?

Re: SIGSEGV while using libVLC 1.1.4 in libx264_plugin.dll

Posted: 16 Sep 2010 08:34
by Titanic
I used the plugins from the file contrib-20100608-win32-bin-gcc-4.4.4-runtime-3.17-only.tar. I'll try to compile VLc again with the current version of the plugins. Perhaps that helps. Keep you posted

Re: SIGSEGV while using libVLC 1.1.4 in libx264_plugin.dll

Posted: 16 Sep 2010 09:32
by Titanic
OK, I updated the contrib file with the latest download (contrib-20100824-win32-bin-gcc-4.4.4-runtime-3.17-only.tar.bz2) but when I compile the source tarball 1.1.4 I get linker errors (undefined references in vlc/modules/services_discovery/upnp_intel_cpp).

I also tried the Git version 1.2.0 to compile with the newest contrib files but when I bootstrap the probejct I get the following error:

' is already registered with AC_CONFIG_FILES
/usr/src/autoconf/autoconf-2.63/lib/autoconf/status.m4:305: AC_CONFIG_FILES expanded from...
/usr/share/aclocal-1.11/cond-if.m4:39: AM_COND_IF is expanded from...
configure.ac:4639: the top level
autom4te: /bin/m4 failed with exit status: 1
C:/msys/1.0/bin/aclocal: autom4te failed with exit status: 1
autoreconf: aclocal failed with exit status: 1

What do I have to change to get the Git version bootstrapped?

Edit: Fixed wrong filename for contrib files

Re: SIGSEGV while using libVLC 1.1.4 in libx264_plugin.dll

Posted: 16 Sep 2010 11:34
by Titanic
I've played around with the x264 libraries (libh264_plugin.dll and libx264_plugin.dll).
In my first report, VLC was using the x264 version 0.98.X (I assume this is the version from contrib 20100608) but my installed VLC player (1.1.4) has x264 version 0.104.X. So I thougt, perhaps replacing my 0.98 version dlls with the one from my installer VLC player (x264 version 0.104) might do the trick. Done and tested: It works!

So, if somebody could answer my question regarding compiling VLC 1.1.4 source tarball with Contrib files 20100824 without getting the linker errors might do the trick.

Re: SIGSEGV while using libVLC 1.1.4 in libx264_plugin.dll

Posted: 17 Sep 2010 09:34
by Titanic
OK, with the help of j-b (over IRC) I got my 1.1.4 source tarball with newest contrib files (20100824) compiled on MSys/MinGW. You simply have to change the configure script to disable compiling of the upnp part of VLC (--disable-upnp). That did the trick for me. Thanks again to j-b for helping me out.

Re: SIGSEGV while using libVLC 1.1.4 in libx264_plugin.dll

Posted: 17 Sep 2010 12:19
by Jean-Baptiste Kempf
You are welcome :D