Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFmpeg VMAF v1.3.5 - Segfault #177

Closed
jessp01 opened this issue Jun 21, 2018 · 14 comments
Closed

FFmpeg VMAF v1.3.5 - Segfault #177

jessp01 opened this issue Jun 21, 2018 · 14 comments
Assignees

Comments

@jessp01
Copy link

jessp01 commented Jun 21, 2018

Hello VMAF team,

When linking FFmpeg against libvmaf.a built from 1.3.5, the following results in a segfault:

$ ffmpeg -i big_buck.mp4 -i big_buck.mp4 -lavfi libvmaf -f null -t 3 -

This works correctly with v1.3.4.
If you need a full reproduction, please use https://gitlab.com/jessp011/fully-static-ffmpeg-build.
Simply edit https://gitlab.com/jessp011/fully-static-ffmpeg-build/blob/master/env.rc#L20 and build.
This repo also includes the test MP4 file:
https://gitlab.com/jessp011/fully-static-ffmpeg-build/blob/master/test/big_buck.mp4

#0  0x000000000114bb66 in get_at (a=0x7ffff1febd90, pos=274214) at /tmp/build/vmaf-1.3.5/wrapper/src/darray.c:71
#1  0x00000000010ced8c in VmafRunner::run (this=this@entry=0x7ffff1fec620, asset=..., 
    read_frame=read_frame@entry=0x53d880 <read_frame_8bit>, user_data=user_data@entry=0x43936c0, disable_clip=false, 
    enable_transform=false, do_psnr=false, do_ssim=false, do_ms_ssim=false) at /tmp/build/vmaf-1.3.5/wrapper/src/vmaf.cpp:377
#2  0x00000000010d1a27 in RunVmaf (fmt=0x2b9c21f "yuv420p", width=width@entry=640, height=360, 
    read_frame=read_frame@entry=0x53d880 <read_frame_8bit>, user_data=0x43936c0, 
    model_path=model_path@entry=0x43930d0 "/usr/local/share/model/vmaf_v0.6.1.pkl", log_path=0x0, log_fmt=0x0, disable_clip=false, 
    enable_transform=false, do_psnr=false, do_ssim=false, do_ms_ssim=false, pool_method=0x0)
    at /tmp/build/vmaf-1.3.5/wrapper/src/vmaf.cpp:645
#3  0x00000000010ca5d3 in compute_vmaf (vmaf_score=vmaf_score@entry=0x4393738, fmt=0x2b9c21f "yuv420p", width=640, height=360, 
    read_frame=0x53d880 <read_frame_8bit>, user_data=user_data@entry=0x43936c0, 
    model_path=0x43930d0 "/usr/local/share/model/vmaf_v0.6.1.pkl", log_path=0x0, log_fmt=0x0, disable_clip=0, disable_avx=0, 
    enable_transform=0, phone_model=0, do_psnr=0, do_ssim=0, do_ms_ssim=0, pool_method=0x0)
    at /tmp/build/vmaf-1.3.5/wrapper/src/libvmaf.cpp:64
#4  0x000000000053d637 in compute_vmaf_score (s=0x43936c0) at libavfilter/vf_libvmaf.c:164
#5  call_vmaf (ctx=0x43936c0) at libavfilter/vf_libvmaf.c:174
#6  0x00000000011da6ea in start_thread (arg=0x7ffff1fed700) at pthread_create.c:308

Full backtrace:

Thread 14 "ffmpeg_g" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 25208]
0x000000000114bb66 in get_at (a=0x7fffed7f8d90, pos=274214) at /tmp/build/vmaf-1.3.5/wrapper/src/darray.c:71
71      /tmp/build/vmaf-1.3.5/wrapper/src/darray.c: No such file or directory.
(gdb) bt full
#0  0x000000000114bb66 in get_at (a=0x7fffed7f8d90, pos=274214) at /tmp/build/vmaf-1.3.5/wrapper/src/darray.c:71
No locals.
#1  0x00000000010ced8c in VmafRunner::run (this=this@entry=0x7fffed7f9620, asset=..., 
    read_frame=read_frame@entry=0x53d880 <read_frame_8bit>, user_data=user_data@entry=0x4393640, disable_clip=false, 
    enable_transform=false, do_psnr=false, do_ssim=false, do_ms_ssim=false) at /tmp/build/vmaf-1.3.5/wrapper/src/vmaf.cpp:377
        i = 274213
        score_transform = {tag = 116 't', subtype = 0 '\000', isproxy = true, pad = "", a = 0x0, u = {s = 116 't', S = 116 't', 
            i = 23156, I = 23156, l = 88692, L = 88692, x = 88692, X = 88692, b = 116, f = 1.24283963e-40, 
            d = 4.3819670260951838e-319, c = {re = 116 't', im = 90 'Z'}, C = {re = 116 't', im = 90 'Z'}, e = {re = 23156, im = 1}, 
            E = {re = 23156, im = 1}, g = {re = 88692, im = 0}, G = {re = 88692, im = 0}, h = {re = 88692, im = 140736548836192}, H = {
              re = 88692, im = 140736548836192}, F = {re = 1.24283963e-40, im = 0}, D = {re = 4.3819670260951838e-319, 
              im = 6.9533093894221335e-310}, a = "tZ\001\000\000\000\000", 
            t = "tZ\001\000\000\000\000\000`\023\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            n = "tZ\001\000\000\000\000\000`\023\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            P = "tZ\001\000\000\000\000\000`\023\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            o = "tZ\001\000\000\000\000\000`\023\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            u = "tZ\001\000\000\000\000\000`\023\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            q = "tZ\001\000\000\000\000\000`\023\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            Q = "tZ\001\000\000\000\000\000`\023\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000"}}
        svm_model_ptr = {
          _M_t = {<std::_Tuple_impl<0ul, svm_model*, SvmDelete>> = {<std::_Tuple_impl<1ul, SvmDelete>> = {<std::_Tuple_impl<2ul>> = {<No data fields>}, <std::_Head_base<1ul, SvmDelete, true>> = {<SvmDelete> = {<No data fields>}, <No data fields>}, <No data fields>}, <std::_Head_base<0ul, svm_model*, false>> = {_M_head_impl = 0x7fffc8007c90}, <No data fields>}, <No data fields>}}
        h = <optimized out>
        motion_array = {array = 0x7fffc801f6d0, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, __owner = 0, 
              __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, 
            __align = 0}}
        vif_num_scale3_array = {array = 0x7fffc802d200, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, 
              __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
            __size = '\000' <repeats 39 times>, __align = 0}}
        num_frms = 0
        ADM_SCALE_CONSTANT = 0
        adm_scale3 = {l = {<std::_Vector_base<double, std::allocator<double> >> = {
              _M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, 
---Type <return> to continue, or q <return> to quit---
                _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}
        score_clip = {tag = 110 'n', subtype = 90 'Z', isproxy = true, pad = "", a = 0x0, u = {s = 110 'n', S = 110 'n', i = 23150, 
            I = 23150, l = 88686, L = 88686, x = 88686, X = 88686, b = 110, f = 1.24275556e-40, d = 4.3816705867076791e-319, c = {
              re = 110 'n', im = 90 'Z'}, C = {re = 110 'n', im = 90 'Z'}, e = {re = 23150, im = 1}, E = {re = 23150, im = 1}, g = {
              re = 88686, im = 0}, G = {re = 88686, im = 0}, h = {re = 88686, im = 140736548836224}, H = {re = 88686, 
              im = 140736548836224}, F = {re = 1.24275556e-40, im = 0}, D = {re = 4.3816705867076791e-319, 
              im = 6.9533093894237145e-310}, a = "nZ\001\000\000\000\000", 
            t = "nZ\001\000\000\000\000\000\200\023\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            n = "nZ\001\000\000\000\000\000\200\023\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            P = "nZ\001\000\000\000\000\000\200\023\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            o = "nZ\001\000\000\000\000\000\200\023\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            u = "nZ\001\000\000\000\000\000\200\023\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            q = "nZ\001\000\000\000\000\000\200\023\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            Q = "nZ\001\000\000\000\000\000\200\023\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000"}}
        adm_den_array = {array = 0x7fffc800dd00, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, __owner = 0, 
              __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, 
            __align = 0}}
        adm_num_scale1_array = {array = 0x7fffc8013af0, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, 
              __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
            __size = '\000' <repeats 39 times>, __align = 0}}
        adm_den_scale2_array = {array = 0x7fffc80198e0, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, 
              __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
            __size = '\000' <repeats 39 times>, __align = 0}}
        ADM2_CONSTANT = 0
        motion2 = {l = {<std::_Vector_base<double, std::allocator<double> >> = {
              _M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, 
                _M_start = 0x7ffff41f0010, _M_finish = 0x7ffff4407938, _M_end_of_storage = 0x7ffff45f0010}}, <No data fields>}}
        nodes = <optimized out>
        ms_ssim_array = {array = 0x7fffc8036e90, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, __owner = 0, 
              __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, 
            __align = 0}}
        vif_num_scale1_array = {array = 0x7fffc80254c0, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, 
              __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
            __size = '\000' <repeats 39 times>, __align = 0}}
---Type <return> to continue, or q <return> to quit---
        vif_den_scale2_array = {array = 0x7fffc802b2b0, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, 
              __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
            __size = '\000' <repeats 39 times>, __align = 0}}
        adm_den_scale0_array = {array = 0x7fffc8011ba0, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, 
              __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
            __size = '\000' <repeats 39 times>, __align = 0}}
        psnr = {l = {<std::_Vector_base<double, std::allocator<double> >> = {
              _M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, 
                _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}
        ssim = {l = {<std::_Vector_base<double, std::allocator<double> >> = {
              _M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, 
                _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}
        errmsg = '\000' <repeats 384 times>...
        adm2 = {l = {<std::_Vector_base<double, std::allocator<double> >> = {
              _M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, 
                _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}
        w = <optimized out>
        adm_num_scale2_array = {array = 0x7fffc8017990, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, 
              __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
            __size = '\000' <repeats 39 times>, __align = 0}}
        vif_den_scale0_array = {array = 0x7fffc8023570, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, 
              __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
            __size = '\000' <repeats 39 times>, __align = 0}}
        vif = {l = {<std::_Vector_base<double, std::allocator<double> >> = {
              _M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, 
                _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}
        slopes = {tag = 110 'n', subtype = 90 'Z', isproxy = true, pad = "", a = 0x0, u = {s = 110 'n', S = 110 'n', i = 23150, 
            I = 23150, l = 88686, L = 88686, x = 88686, X = 88686, b = 110, f = 1.24275556e-40, d = 4.3816705867076791e-319, c = {
              re = 110 'n', im = 90 'Z'}, C = {re = 110 'n', im = 90 'Z'}, e = {re = 23150, im = 1}, E = {re = 23150, im = 1}, g = {
              re = 88686, im = 0}, G = {re = 88686, im = 0}, h = {re = 88686, im = 140736548860928}, H = {re = 88686, 
              im = 140736548860928}, F = {re = 1.24275556e-40, im = 0}, D = {re = 4.3816705867076791e-319, 
              im = 6.9533093906442543e-310}, a = "nZ\001\000\000\000\000", 
            t = "nZ\001\000\000\000\000\000\000t\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            n = "nZ\001\000\000\000\000\000\000t\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
---Type <return> to continue, or q <return> to quit---
            P = "nZ\001\000\000\000\000\000\000t\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            o = "nZ\001\000\000\000\000\000\000t\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            u = "nZ\001\000\000\000\000\000\000t\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            q = "nZ\001\000\000\000\000\000\000t\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            Q = "nZ\001\000\000\000\000\000\000t\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000"}}
        num_frms_is_consistent = <optimized out>
        vif_scale0 = {l = {<std::_Vector_base<double, std::allocator<double> >> = {
              _M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, 
                _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}
        vmaf = {l = {<std::_Vector_base<double, std::allocator<double> >> = {
              _M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, 
                _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}
        ms_ssim = {l = {<std::_Vector_base<double, std::allocator<double> >> = {
              _M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, 
                _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}
        norm_type = {tag = 97 'a', subtype = 0 '\000', isproxy = false, pad = "", a = 0x0, u = {s = 108 'l', S = 108 'l', i = 26988, 
            I = 26988, l = 1701734764, L = 1701734764, x = 8241431605750425964, X = 8241431605750425964, b = 108, f = 7.03667446e+22, 
            d = 8.3875082901933609e+242, c = {re = 108 'l', im = 105 'i'}, C = {re = 108 'l', im = 105 'i'}, e = {re = 26988, 
              im = 25966}, E = {re = 26988, im = 25966}, g = {re = 1701734764, im = 1918857825}, G = {re = 1701734764, 
              im = 1918857825}, h = {re = 8241431605750425964, im = -8214454204159003803}, H = {re = 8241431605750425964, 
              im = 10232289869550547813}, F = {re = 7.03667446e+22, im = 4.4258197e+30}, D = {re = 8.3875082901933609e+242, 
              im = -3.073663301322354e-241}, a = "linear_r", 
            t = "linear_rescale\000\216\360z\177\355\377\177\000\000\300z\177\355\377\177\000\016", 
            n = "linear_rescale\000\216\360z\177\355\377\177\000\000\300z\177\355\377\177\000\016", 
            P = "linear_rescale\000\216\360z\177\355\377\177\000\000\300z\177\355\377\177\000\016", 
            o = "linear_rescale\000\216\360z\177\355\377\177\000\000\300z\177\355\377\177\000\016", 
            u = "linear_rescale\000\216\360z\177\355\377\177\000\000\300z\177\355\377\177\000\016", 
            q = "linear_rescale\000\216\360z\177\355\377\177\000\000\300z\177\355\377\177\000\016", 
            Q = "linear_rescale\000\216\360z\177\355\377\177\000\000\300z\177\355\377\177\000\016"}}
        vif_num_scale2_array = {array = 0x7fffc8029360, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, 
              __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
            __size = '\000' <repeats 39 times>, __align = 0}}
        vif_den_scale3_array = {array = 0x7fffc802f150, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, 
              __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
---Type <return> to continue, or q <return> to quit---
            __size = '\000' <repeats 39 times>, __align = 0}}
        psnr_array = {array = 0x7fffc8032ff0, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, __owner = 0, 
              __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, 
            __align = 0}}
        psnr_array_ptr = 0x0
        ms_ssim_array_ptr = 0x0
        vif_scale1 = {l = {<std::_Vector_base<double, std::allocator<double> >> = {
              _M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, 
                _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}
        result = {d = {_M_t = {
              _M_impl = {<std::allocator<std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, StatVector> > >> = {<__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, StatVector> > >> = {<No data fields>}, <No data fields>}, 
                _M_key_compare = {<std::binary_function<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool>> = {<No data fields>}, <No data fields>}, _M_header = {
                  _M_color = std::_S_red, _M_parent = 0x0, _M_left = 0x0, _M_right = 0x0}, _M_node_count = 0}}}, 
          score_aggregate_method = MEAN}
        adm_num_scale0_array = {array = 0x7fffc800fc50, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, 
              __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
            __size = '\000' <repeats 39 times>, __align = 0}}
        adm_den_scale1_array = {array = 0x7fffc8015a40, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, 
              __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
            __size = '\000' <repeats 39 times>, __align = 0}}
        vif_array = {array = 0x7fffc80310a0, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, __owner = 0, 
              __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, 
            __align = 0}}
        ret = <optimized out>
        vif_scale2 = {l = {<std::_Vector_base<double, std::allocator<double> >> = {
              _M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, 
                _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}
        intercepts = {tag = 110 'n', subtype = 90 'Z', isproxy = true, pad = "", a = 0x0, u = {s = 110 'n', S = 110 'n', i = 23150, 
            I = 23150, l = 88686, L = 88686, x = 88686, X = 88686, b = 110, f = 1.24275556e-40, d = 4.3816705867076791e-319, c = {
              re = 110 'n', im = 90 'Z'}, C = {re = 110 'n', im = 90 'Z'}, e = {re = 23150, im = 1}, E = {re = 23150, im = 1}, g = {
              re = 88686, im = 0}, G = {re = 88686, im = 0}, h = {re = 88686, im = 140736548860896}, H = {re = 88686, 
---Type <return> to continue, or q <return> to quit---
              im = 140736548860896}, F = {re = 1.24275556e-40, im = 0}, D = {re = 4.3816705867076791e-319, 
              im = 6.9533093906426733e-310}, a = "nZ\001\000\000\000\000", 
            t = "nZ\001\000\000\000\000\000\340s\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            n = "nZ\001\000\000\000\000\000\340s\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            P = "nZ\001\000\000\000\000\000\340s\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            o = "nZ\001\000\000\000\000\000\340s\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            u = "nZ\001\000\000\000\000\000\340s\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            q = "nZ\001\000\000\000\000\000\340s\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            Q = "nZ\001\000\000\000\000\000\340s\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000"}}
        adm_den_scale3_array = {array = 0x7fffc801d780, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, 
              __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
            __size = '\000' <repeats 39 times>, __align = 0}}
        vif_scale3 = {l = {<std::_Vector_base<double, std::allocator<double> >> = {
              _M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, 
                _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}
        adm_scale0 = {l = {<std::_Vector_base<double, std::allocator<double> >> = {
              _M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, 
                _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}
        adm_num_scale3_array = {array = 0x7fffc801b830, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, 
              __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
            __size = '\000' <repeats 39 times>, __align = 0}}
        vif_num_scale0_array = {array = 0x7fffc8021620, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, 
              __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
            __size = '\000' <repeats 39 times>, __align = 0}}
        vif_den_scale1_array = {array = 0x7fffc8027410, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, 
              __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
            __size = '\000' <repeats 39 times>, __align = 0}}
        ssim_array = {array = 0x7fffc8034f40, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, __owner = 0, 
              __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, 
            __align = 0}}
        ssim_array_ptr = 0x0
        adm_scale1 = {l = {<std::_Vector_base<double, std::allocator<double> >> = {
              _M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, 
                _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}
---Type <return> to continue, or q <return> to quit---
        feature_names = {tag = 110 'n', subtype = 90 'Z', isproxy = true, pad = "", a = 0x0, u = {s = 110 'n', S = 110 'n', i = 23150, 
            I = 23150, l = 88686, L = 88686, x = 88686, X = 88686, b = 110, f = 1.24275556e-40, d = 4.3816705867076791e-319, c = {
              re = 110 'n', im = 90 'Z'}, C = {re = 110 'n', im = 90 'Z'}, e = {re = 23150, im = 1}, E = {re = 23150, im = 1}, g = {
              re = 88686, im = 0}, G = {re = 88686, im = 0}, h = {re = 88686, im = 140736548860640}, H = {re = 88686, 
              im = 140736548860640}, F = {re = 1.24275556e-40, im = 0}, D = {re = 4.3816705867076791e-319, 
              im = 6.9533093906300252e-310}, a = "nZ\001\000\000\000\000", 
            t = "nZ\001\000\000\000\000\000\340r\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            n = "nZ\001\000\000\000\000\000\340r\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            P = "nZ\001\000\000\000\000\000\340r\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            o = "nZ\001\000\000\000\000\000\340r\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            u = "nZ\001\000\000\000\000\000\340r\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            q = "nZ\001\000\000\000\000\000\340r\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000", 
            Q = "nZ\001\000\000\000\000\000\340r\000\310\377\177\000\000\360z\177\355\377\177\000\000\300z\177\355\377\177\000"}}
        fmt = 0x2b9c21f "yuv420p"
        adm_num_array = {array = 0x7fffc8002a60, used = 0, size = 1000, mutex = {__data = {__lock = 0, __count = 0, __owner = 0, 
              __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, 
            __align = 0}}
        motion = {l = {<std::_Vector_base<double, std::allocator<double> >> = {
              _M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, 
                _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}
        adm_scale2 = {l = {<std::_Vector_base<double, std::allocator<double> >> = {
              _M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, 
                _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}}
#2  0x00000000010d1a27 in RunVmaf (fmt=0x2b9c21f "yuv420p", width=width@entry=640, height=360, 
    read_frame=read_frame@entry=0x53d880 <read_frame_8bit>, user_data=0x4393640, 
    model_path=model_path@entry=0x4393050 "/usr/local/share/model/vmaf_v0.6.1.pkl", log_path=0x0, log_fmt=0x0, disable_clip=false, 
    enable_transform=false, do_psnr=false, do_ssim=false, do_ms_ssim=false, pool_method=0x0)
    at /tmp/build/vmaf-1.3.5/wrapper/src/vmaf.cpp:645
        runner = {model_path = 0x4393050 "/usr/local/share/model/vmaf_v0.6.1.pkl", 
          libsvm_model_path = 0x7fffc80008c0 "/usr/local/share/model/vmaf_v0.6.1.pkl.model", static INIT_FRAMES = 1000}
        timer = {m_start = {__d = {__r = 1529618788760081452}}, m_stop = {__d = {__r = 0}}}
        aggregate_vmaf = <optimized out>
        result = {d = {_M_t = {
              _M_impl = {<std::allocator<std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<cha---Type <return> to continue, or q <return> to quit---
r> > const, StatVector> > >> = {<__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, StatVector> > >> = {<No data fields>}, <No data fields>}, 
                _M_key_compare = {<std::binary_function<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool>> = {<No data fields>}, <No data fields>}, _M_header = {
                  _M_color = std::_S_red, _M_parent = 0x0, _M_left = 0x0, _M_right = 0x0}, _M_node_count = 0}}}, 
          score_aggregate_method = MEAN}
        num_frames = <optimized out>
        exec_fps = <optimized out>
#3  0x00000000010ca5d3 in compute_vmaf (vmaf_score=vmaf_score@entry=0x43936b8, fmt=0x2b9c21f "yuv420p", width=640, height=360, 
    read_frame=0x53d880 <read_frame_8bit>, user_data=user_data@entry=0x4393640, 
    model_path=0x4393050 "/usr/local/share/model/vmaf_v0.6.1.pkl", log_path=0x0, log_fmt=0x0, disable_clip=0, disable_avx=0, 
    enable_transform=0, phone_model=0, do_psnr=0, do_ssim=0, do_ms_ssim=0, pool_method=0x0)
    at /tmp/build/vmaf-1.3.5/wrapper/src/libvmaf.cpp:64
        score = <optimized out>
        d_p = false
        d_c = <optimized out>
        e_t = <optimized out>
        d_s = <optimized out>
        d_m_s = false
#4  0x000000000053d637 in compute_vmaf_score (s=0x4393640) at libavfilter/vf_libvmaf.c:164
        read_frame = <optimized out>
#5  call_vmaf (ctx=0x4393640) at libavfilter/vf_libvmaf.c:174
        s = 0x4393640
#6  0x00000000011da6ea in start_thread (arg=0x7fffed7fa700) at pthread_create.c:308
        __res = <optimized out>
        pd = 0x7fffed7fa700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, 0, 49322816, 140737177954752, 0, 3, -40685237436416, 2453724463104}, 
              mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"

Also, v1.3.6rc and v1.3.7rc cannot be used due this commit:
1b0f6ef#diff-fa18e21ed0ed7b3f769ceab3d86c7e3aR28

Because FFmpeg uses a C compiler and not a C++ one [in my case GCC], it will fail with:

In file included from libavfilter/vf_libvmaf.c:28:0:
./libvmaf.h:28:85: error: unknown type name 'bool'
      int do_ssim, int do_ms_ssim, char *pool_method, int n_thread, int n_subsample, bool conf_interval);

Thanks,

@li-zhi li-zhi assigned li-zhi and kylophone and unassigned li-zhi Jun 22, 2018
@kylophone
Copy link
Collaborator

Investigating. Thanks for the report.

@stoyanovgeorge
Copy link

the libvmaf support for ffmpeg is broken from VDK 1.3.5 onwards, 1.3.5 you are able to compile ffmpeg with libvmaf support but when trying to use it it gives a segmentation fault and ffmpeg doesn't compile with VDK 1.3.6 and 1.3.7, the last working version of libvmaf is 1.3.4. According to the ffmpeg developers the API has changed in VDK 1.3.5 onwards.

@RonLu
Copy link

RonLu commented Aug 1, 2018

I have reverted to use libvmaf 1.3.4 with ffmpeg 4.0.2 according to your discussion.
I got libvmaf 1.3.4 from https://github.com/Netflix/vmaf/archive/v1.3.4.tar.gz
and ffmpeg 4.0.2 from http://ffmpeg.org/releases/ffmpeg-4.0.2.tar.gz;
I then compiled the ffmpeg 4.0.2 with libvmaf 1.3.4 successfully.
However when I ran the following command, I still got segmentation fault error.
./ffmpeg -i 11.mp4 -i 22.mp4 -lavfi libvmaf -f null -

Can anybody give some light on this? Thanks!

@jessp01
Copy link
Author

jessp01 commented Aug 1, 2018

Hi @RonLu,

It works correctly for me with FFmpeg 4.0.2 and VMAF 1.3.4. You can use my build process if you'd like, see:
https://gitlab.com/jessp011/fully-static-ffmpeg-build

If it doesn't work for you, I suggest you run it with GDB and provide the full backtrace.

@RonLu
Copy link

RonLu commented Aug 1, 2018

Hi @jessp01,
Thanks for the quick response! I haven't try your build process yet. But I went to try gdb with my current build and got the following backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff74ef84e in pthread_join () from /lib64/libpthread.so.0
(gdb) bt
#0 0x00007ffff74ef84e in pthread_join () from /lib64/libpthread.so.0
#1 0x0000000000413842 in uninit (ctx=) at libavfilter/vf_libvmaf.c:320
#2 0x00000000004c3683 in avfilter_free (filter=0x3ee64c0) at libavfilter/avfilter.c:771
#3 0x00000000004c56cc in avfilter_graph_free (graph=0x7fffffffd518) at libavfilter/avfiltergraph.c:126
#4 0x0000000000493db5 in init_complex_filtergraph (fg=0x3878a80) at fftools/ffmpeg_filter.c:369
#5 0x000000000048ff43 in init_complex_filters () at fftools/ffmpeg_opt.c:2046
#6 ffmpeg_parse_options (argc=argc@entry=10, argv=argv@entry=0x7fffffffe378) at fftools/ffmpeg_opt.c:3250
#7 0x0000000000486371 in main (argc=10, argv=0x7fffffffe378) at fftools/ffmpeg.c:4814
(gdb)

I checked the vf_libvmaf.c in the source code I download, it looks like it does't include the fix 51775bc1cdeff04b836422be66e8098146aedcce (avfilter/vf_libvmaf: the libvmaf filter tried to join on an invalid t…) which was committed on 30 Apr. But the source code is from ffmpeg 4.0.2 version which was released on July 18th. Why it doesn't include the change on 30 Apr?

@jessp01
Copy link
Author

jessp01 commented Aug 1, 2018

Hi @RonLu,

That's a different problem, obviously, so I would suggest opening a separate issue for it and attaching the BT.
@kylophone - any progress in regards to the problem I reported, BTW?

@RonLu
Copy link

RonLu commented Aug 2, 2018

Hi @jessp01
Thanks for the suggestion. I manually fixed the vf_libvmaf.c and recompiled. It's ok now. I can get the VMAF score using the ffmpeg command.
So this is an ffmpeg problem. Do you know how to open issue to ffmpeg? I didn't see a way to do so in git?

@kylophone
Copy link
Collaborator

kylophone commented Aug 2, 2018

@RonLu, @jessp01: I was planning to (finally) look at this tonight, but it seems like @RonLu already has a fix. @RonLu, can you share your ffmpeg vf_libvmaf.c diff? I can make sure it gets pushed upstream.

@RonLu
Copy link

RonLu commented Aug 2, 2018

Hi @kylophone,
My fix is exactly what the commit 51775bc1cdeff04b836422be66e8098146aedcce (avfilter/vf_libvmaf: the libvmaf filter tried to join on an invalid t…) did which was committed on 30 Apr. You can have a look here - FFmpeg/FFmpeg@51775bc.
The problem is this commit was not included in the ffmpeg 4.0.1 or ffmpeg 4.0.2 source code.

@jessp01
Copy link
Author

jessp01 commented Aug 2, 2018

Also, @kylophone, please look at the different BTs and descriptions. @RonLu's issue is different to mine.
His report is about 1.3.4 which, for me, works correctly. My issue was introduced in 1.3.5, please see the commit I referenced.

@RonLu - as per your question, FFmpeg's bug tracker is here https://trac.ffmpeg.org

@kylophone
Copy link
Collaborator

@jessp01
Copy link
Author

jessp01 commented Aug 8, 2018

Hi @kylophone,

This patch with VMAF 1.3.9 resolves the issue.

@kylophone
Copy link
Collaborator

Cool. Thanks.

@jessp01
Copy link
Author

jessp01 commented Aug 8, 2018

Cheers, @kylophone. If anyone is interested, I now apply the patch in my project here:
https://gitlab.com/jessp011/fully-static-ffmpeg-build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants