Recherche avancée

Médias (0)

Mot : - Tags -/metadatas

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (72)

Sur d’autres sites (9360)

  • Python librosa NoBackendError even though ffmpeg is installed

    11 avril 2020, par Slavko Kovačević

    I recently installed librosa (package I've been using for a while on different PC) on my new PC with Windows 10 running. After that I've downloaded latest static version of ffmpeg and copied it to C: and added it to the Path. Tested ffmpeg and it works like a charm ! For python I am using Anaconda environment and after starting Jupyter Notebook and running librosa.load(path, sr = None) I've got

    



     in <module>&#xA;----> 1 audio = librosa.load(pathToJson)&#xA;&#xA;~\anaconda3\envs\tf_gpu\lib\site-packages\librosa\core\audio.py in load(path, sr, mono, offset, duration, dtype, res_type)&#xA;    117 &#xA;    118     y = []&#xA;--> 119     with audioread.audio_open(os.path.realpath(path)) as input_file:&#xA;    120         sr_native = input_file.samplerate&#xA;    121         n_channels = input_file.channels&#xA;&#xA;~\anaconda3\envs\tf_gpu\lib\site-packages\audioread\__init__.py in audio_open(path, backends)&#xA;    114 &#xA;    115     # All backends failed!&#xA;--> 116     raise NoBackendError()&#xA;&#xA;NoBackendError:&#xA;</module>

    &#xA;&#xA;

    strange isn't it ? Then I went all over the internet, doing whatnot trying to fix it and then I've got an idea to run my line of code inside anaconda command interface and it WORKS ?? How is this possible ? It is the same environment.

    &#xA;&#xA;

    python&#xA;Python 3.7.7 (default, Mar 23 2020, 23:19:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32&#xA;Type "help", "copyright", "credits" or "license" for more information.&#xA;>>> import librosa&#xA;>>> librosa.load(&#x27;test.wav&#x27;)&#xA;(array([-0.00027   , -0.00039953, -0.0003659 , ..., -0.16393574,&#xA;       -0.17814247,  0.        ], dtype=float32), 22050)&#xA;

    &#xA;&#xA;

    I did a lot of testing and I really prefer my Jupyter so any help would be appreciated. I tried the following : I've added C:\ffmpeg\bin and C:\ffmpeg to my Path for both User and System Variables. After that I've made specific variables for ffmpeg and ffmpeg_bin for both User and System Variables. No luck. After that I've tried installing ffmpeg using conda, without success. The last thing I've tested is this :

    &#xA;&#xA;

    import audioread&#xA;audioread.ffdec.FFmpegAudioFile(&#x27;test.wav&#x27;)&#xA;

    &#xA;&#xA;

    and that works. Thanks

    &#xA;

  • dcadec : simplify decoding of VQ high frequencies

    14 février 2014, par Christophe Gisquet
    dcadec : simplify decoding of VQ high frequencies
    

    The vector dequantization has a test in a loop preventing effective SIMD
    implementation. By moving it out of the loop, this loop can be DSPized.

    Therefore, modify the current DSP implementation. In particular, the
    DSP implementation no longer has to handle null loop sizes.

    The decode_hf implementations have following timings :

    For x86 Arrandale :
    C SSE SSE2 SSE4
    win32 : 260 162 119 104
    win64 : 242 N/A 89 72

    The arm NEON optimizations follow in a later patch as external asm. The
    now unused check for the y modifier in arm inline asm is removed from
    configure.

    • [DH] configure
    • [DH] libavcodec/arm/dca.h
    • [DH] libavcodec/dcadec.c
    • [DH] libavcodec/dcadsp.c
    • [DH] libavcodec/dcadsp.h
    • [DH] libavcodec/x86/dcadsp.asm
    • [DH] libavcodec/x86/dcadsp_init.c
  • Cannot use ffmpeg in qt on windows

    10 septembre 2016, par Johnnylin

    In my source file, I have the following include :

    #define __STDC_CONSTANT_MACROS

    extern "C" {
    #include "libavcodec/avcodec.h"
    #include "libavutil/imgutils.h"
    #include "libavutil/opt.h"
    #include "libswscale/swscale.h"
    }

    and in .pro file, I have :

    INCLUDEPATH += Z:\new_project\ffmpeg\include
    LIBS += -L"Z:/new_project/ffmpeg/lib" \
        -lavformat \
        -lavcodec \
        -lswscale \
        -lavutil

    In a function I call this :

       QImage YV12ToRGB24_FFmpeg(unsigned char* pYUV, int width, int height)
       {
           if (width &lt; 1 || height &lt; 1 || pYUV == NULL)
               return QImage();

           int length = height * width * 3;
           uchar* pRGB24 = new uchar[length];

           AVFrame pFrameYUV, pFrameRGB;
           av_image_fill_arrays(pFrameYUV.data, pFrameYUV.linesize, pYUV, AV_PIX_FMT_YUV420P, width, height, 1);
           //.......other operations.....//
      }

    when I run build in QtCreator, I got this error :

    undefined reference to 'av_image_fill_arrays'

    Can any one help ?

    BTW, I use ffmpeg-3.0-windows64-dev, and My qt use Qt5.7, QtCreator build use mingw32-make.

    EDIT :

    Compilation output :

    C:\Qt\Qt5.7.0\5.7\mingw53_32\bin\qmake.exe -spec win32-g++ -o Makefile ..\new_project.pro
    C:/Qt/Qt5.7.0/Tools/mingw530_32/bin/mingw32-make -f Makefile.Release
    mingw32-make[1]: Entering directory 'Z:/new_project/build'
    g++ -Wl,-s -Wl,-subsystem,windows -mthreads -o release\new_project.exe object_script.new_project.Release  -lmingw32 -LC:\Qt\Qt5.7.0\5.7\mingw53_32\lib C:\Qt\Qt5.7.0\5.7\mingw53_32\lib\libqtmain.a -LC:\utils\postgresql\pgsql\lib -LC:\utils\my_sql\my_sql\lib -lshell32 -LZ:\new_project\ffmpeg\lib -lavformat -lavcodec -lswscale -lavutil -LZ:\new_project\opencv_3.0\x86\mingw\bin -lopencv_core300 -lopencv_imgproc300 -lopencv_highgui300 -lopencv_imgcodecs300 C:\Qt\Qt5.7.0\5.7\mingw53_32\lib\libQt5Widgets.a C:\Qt\Qt5.7.0\5.7\mingw53_32\lib\libQt5Gui.a C:\Qt\Qt5.7.0\5.7\mingw53_32\lib\libQt5Core.a release\icon_res.o


    ./release\camera_node.o:camera_node.cpp:(.text+0x464): undefined reference to `av_image_fill_arrays'
    collect2.exe: error: ld returned 1 exit status