解決方法:OpenCV: FFMPEG: tag 0x00000898/'???' is not found (format 'avi / AVI (Audio Video Interleaved)

I couldn't get that code to run on my Windows 10 machine either.

So here's what I did:

  1. I followed these instructions and installed the latest ffmpeg build on machine:

     

     

    1. Download the latest static build for Windows and then extract the files. You may need 7zip to extract.
    2. Create a folder in C:\ called ffmpeg
    3. Copy the contents of the extracted files into C:\ffmpeg
    4. Edit your PATH environment variable to append at the end the following entry: C:\ffmpeg\bin;
    5. Confirm that everything is working correct by opening a cmd prompt and enter the following (Note you might need to run cmd as administrator): ffmpeg -version

    我通過這些步驟,通過安裝最新的ffmpeg 在機器上 

    1.下載最新的static build for Windows 然後解壓這些文件 

    2.創建一個文件在C盤下面,文件名叫做ffmpeg 

    3.複製上面解壓出來的文件到ffmpeg文件中 

    4.設置環境變量(網上搜索就好)複製上述變量名字到裏面就可以 

    5.確定所有的工作都可以正常運行通過cmd打開命令行輸入ffmpeg -version

    最後在自己openCV代碼中寫入文件的格式改成mp4格式

    如:

    cv::VideoWriter writer("VideoTest.mp4", cv::CAP_OPENCV_MJPEG, rate, videoSize); 

     

這段是在網站上搜索到的:翻譯部分是我自己寫的。鏈接在這貼出來: https://stackoverflow.com/questions/36643139/python-and-opencv-cannot-write-readable-avi-video-files/36647509

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章