[Libav-user] segmentation fault when try to call av_find_stream_info

Александр Козлов kozzzloff at list.ru
Thu Jun 30 15:30:04 CEST 2011


Hi,

I use ffmpeg-0.7.1 (released on 2011-06-23) on Ubuntu 10.10 and I have a problem with decoding video from IP camera (rtsp).  
When I try to call av_find_stream_info I get a segmentation fault in two different places.
  
Here are logs:
  
Jun 30 14:31:55 alexcomp kernel: [ 2215.171020] vcsrv[4563]: segfault at 65 ip 002cd104 sp b650812c error 4 in libavutil.so.50.43.0[2c3000+1b000] 
Jun 30 14:32:10 alexcomp kernel: [ 2230.207775] vcsrv[4584]: segfault at 65 ip 00192104 sp b655e12c error 4 in libavutil.so.50.43.0[188000+1b000] 
Jun 30 14:32:25 alexcomp kernel: [ 2245.247871] vcsrv[4605]: segfault at 65 ip 007c2104 sp b64b612c error 4 in libavutil.so.50.43.0[7b8000+1b000] 
Jun 30 14:32:40 alexcomp kernel: [ 2260.293341] vcsrv[4626]: segfault at 65 ip 00b9b104 sp b665912c error 4 in libavutil.so.50.43.0[b91000+1b000] 
Jun 30 14:32:55 alexcomp kernel: [ 2275.331671] vcsrv[4650]: segfault at bbb2f198 ip 003e1ec4 sp b72d6130 error 6 in libavformat.so.52.110.0[318000+fc000] 
Jun 30 14:33:10 alexcomp kernel: [ 2290.377975] vcsrv[4673]: segfault at aa0ea794 ip 00ad8ec4 sp b72aa130 error 6 in libavformat.so.52.110.0[a0f000+fc000] 
Jun 30 14:33:15 alexcomp kernel: [ 2295.707711] vcsrv[4679]: segfault at b663e008 ip 0033cec4 sp b663d130 error 6 in libavformat.so.52.110.0[273000+fc000] 
Jun 30 14:33:30 alexcomp kernel: [ 2310.753208] vcsrv[4699]: segfault at b71b6114 ip 0098bec4 sp b71b5130 error 6 in libavformat.so.52.110.0[8c2000+fc000]

   
I'm not sure that problem is in libs. I use libs this way:
  
        CAMERA_MPEG_IP_OBJ* self_obj = NULL; 
        CAMERA_OBJ_EXT* obj_ext = camera_obj->context; 
        self_obj = (CAMERA_MPEG_IP_OBJ*)sys_malloc(sizeof(CAMERA_MPEG_IP_OBJ)); 
        if (self_obj) 
        { 
            AVInputFormat* file_iformat; 
            int err, i, width, height; 
            AVFormatContext* ic_ptr; 
            /* set rendering file name */  
            self_obj->m_URL = (obj_ext && obj_ext->conf.url ?  
                                        sys_strdup(obj_ext->conf.url) :  
                                        sys_strdup(camera_obj->name)); 
            if ( !self_obj->m_URL ) 
            { 
                status = VC_ERR_FATAL; 
            }  
           if (status == VC_ERR_NONE) 
            { 
                self_obj->m_ic = 0; 
                self_obj->m_video_st = 0; 
                self_obj->m_frame = 0; 
                self_obj->m_picture_pts = 0; 
     
                // Callback registration 
         avcodec_register_all(); 
                avdevice_register_all(); 
                avfilter_register_all(); 
                av_register_all(); 
                 
                self_obj->m_rgb_frame = (AVFrame*)sys_malloc(sizeof(AVFrame)); 
         self_obj->m_packet = (AVPacket*)sys_malloc(sizeof(AVPacket)); 
         self_obj->m_packet->data = NULL; 
         self_obj->m_picture = (AVPacket*)sys_malloc(sizeof(IplImage)); 
         file_iformat = av_find_input_format("rstp"); 
            } 
            // Open flow 
            if (status == VC_ERR_NONE) 
            { 
                ic_ptr = &(self_obj->m_ic); 
                err = av_open_input_file(ic_ptr, self_obj->m_URL, file_iformat,0, NULL); 
                if (err < 0)  
                { 
                    log_fatal(VC_LOG_CAMERA, "Problem during stream open\n"); 
                    status = VC_ERR_FATAL; 
                } 
            } 
             
            if (status == VC_ERR_NONE) 
            { 
                err = av_find_stream_info(self_obj->m_ic); 
                if (err < 0) 
                { 
                    log_fatal(VC_LOG_CAMERA, "Problem during stream info getting\n");     
                    status = VC_ERR_FATAL; 
                } 
            }

   
And here is a configuration of my build:
  
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc \ 
    --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb \ 
    --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid \ 
    --enable-x11grab --enable-shared --enable-swscale --prefix=/usr
   
Could you please help me with my problem?
  
Thanks in advance, 
Alexander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20110630/345b889d/attachment.html>


More information about the Libav-user mailing list