国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

OpenCV 報(bào)錯:FFMPEG: tag 0x34363258/‘X264‘ is not supported with codec id 27 and format ‘mp4 / MP4‘

這篇具有很好參考價值的文章主要介紹了OpenCV 報(bào)錯:FFMPEG: tag 0x34363258/‘X264‘ is not supported with codec id 27 and format ‘mp4 / MP4‘。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

首先說一下報(bào)錯的地方,是在使用VideoWriter保存視頻時:

'''
opencv讀取攝像頭視頻流,并且顯示
'''

import cv2
import numpy as np

#調(diào)用攝像頭
cap = cv2.VideoCapture(0)

#DIVX,X264
fourcc = cv2.VideoWriter_fourcc(*'X264')
fps = 20
#獲取圖像的高寬
width  = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))

writer = cv2.VideoWriter('video.mp4',fourcc,fps,(width,height))

while True:
    #讀取視頻幀
    rec, frame = cap.read()

    #鏡像
    frame = cv2.flip(frame,1)
    #灰度圖片
    gray = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)

    #保存視頻
    writer.write(frame)

    #顯示圖片
    cv2.imshow('demo',frame)

    #退出條件
    if cv2.waitKey(10) & 0xFF == ord('q'):
        break

cap.release()
writer.release()
cv2.destroyAllWindows()

出現(xiàn)如下錯誤:

OpenCV: FFMPEG: tag 0x34363258/'X264' is not supported with codec id 27 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x31637661/'avc1'
[ERROR:0@0.234] global cap_ffmpeg_impl.hpp:2991 open Could not find encoder for codec_id=27, error: Encoder not found
[ERROR:0@0.234] global cap_ffmpeg_impl.hpp:3066 open VIDEOIO/FFMPEG: Failed to initialize VideoWriter

經(jīng)過查找網(wǎng)上資料,發(fā)現(xiàn)是cv2.VideoWriter_fourcc()參數(shù)存在問題,

解決方法:

fourcc = cv2.VideoWriter_fourcc(*'X264')

修改為:

fourcc = cv2.VideoWriter_fourcc(*'mp4v')

即可完美解決問題。文章來源地址http://www.zghlxwxcb.cn/news/detail-732592.html

到了這里,關(guān)于OpenCV 報(bào)錯:FFMPEG: tag 0x34363258/‘X264‘ is not supported with codec id 27 and format ‘mp4 / MP4‘的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • git 報(bào)錯 protocol ‘https‘ is not supported解決

    git 報(bào)錯 protocol ‘https‘ is not supported解決

    報(bào)錯原因:選擇不了其他分支代碼,甚至都看不到其他分支,我這邊解決了兩次報(bào)錯,情況如下: 第一種報(bào)錯: idea中刷新分支報(bào)錯如下: Fetch Failed protocol \\\'\\\'https\\\' is not supported 話不多說,直接上 解決方案: ?1:可以直接在idea命令窗中執(zhí)行:git remote set-url origin 你的url 2.然后

    2024年02月06日
    瀏覽(19)
  • pgsql 報(bào)錯 later table “drop column” is not supported now

    報(bào)錯 使用pgsql執(zhí)行下面的SQL報(bào)錯 報(bào)錯信息: later table “drop column” is not supported now。 報(bào)錯原因 hologres + pgsql的數(shù)據(jù)庫: 刪除列目前還是灰度測試階段,需要在sql前加上set hg_experimental_enable_drop_column =on; 解決: 一起執(zhí)行即可 結(jié)束! hy:28

    2024年02月09日
    瀏覽(15)
  • 安裝報(bào)錯:is not a supported wheel on this platform

    一. 在通過.whl文件導(dǎo)包時出現(xiàn)的錯誤,可能原因有以下兩點(diǎn): 安裝的不是對應(yīng)python版本的庫 whl文件不是給本電腦系統(tǒng)用的 whl文件名本臺電腦不支持 二. 解決辦法 原因1就從新下載對python版本的包,若python版本為python3.11.0即選擇cp311的文件。 原因2就下載對應(yīng)系統(tǒng)的文件。win

    2024年02月14日
    瀏覽(24)
  • Cloning into ‘XXXX‘... fatal: protocol ‘?https‘ is not supporte 報(bào)錯解決方法

    git bash 中出現(xiàn)信息如下信息: Cloning into \\\'XXXX\\\'... fatal: protocol \\\'?https\\\' is not supporte? 經(jīng)過百度搜索: 可能存在問題一:git clone 使用的時候不支持https,可能需要換成SSH方式 你可以通過命令git remote set-url origin 你倉庫的SSH地址,去除SSH認(rèn)證。 但是感覺不太實(shí)際。 然后繼續(xù)看下一篇

    2023年04月12日
    瀏覽(30)
  • (已解決)redis.get報(bào)錯com.alibaba.fastjson.JSONException: autoType is not support

    redis存取值問題,存自定義實(shí)體對象; 第一次取的時候報(bào)錯: com.alibaba.fastjson.JSONException: autoType is not support 。 GenericFastJsonRedisSerializer序列化和反序列化redis的value值,需要bean對象含有無參構(gòu)造方法。 解決: ? ? ? ? 檢查自定義實(shí)體對象是否有無參構(gòu)造方法 ;添加有參構(gòu)造后

    2024年02月12日
    瀏覽(29)
  • require() of ES modules is not supported.ts項(xiàng)目中添加js文件報(bào)錯

    require() of ES modules is not supported.ts項(xiàng)目中添加js文件報(bào)錯

    Must use import to load ES Module: E:1-vue3XXXXXXXXXbook-money.cz-config.js require() of ES modules is not supported. require() of E:1-vue3XXXXXXXXXbook-money.cz-config.js from E:1-vue3XXXXXXXXXbook-moneynode_modulesfind-configsrcfind-config.js is an ES module file as it is a .js file whose nearest parent package.json contains “type”: “modu

    2024年01月16日
    瀏覽(22)
  • whisper報(bào)錯:UserWarning: FP16 is not supported on CPU; using FP32 instead

    whisper報(bào)錯:UserWarning: FP16 is not supported on CPU; using FP32 instead

    報(bào)錯: 這個報(bào)錯說的是whisper要使用cpu,而你音頻是fp16的,cpu不支持。 要點(diǎn)在于如何解決為什么whisper沒使用GPU 應(yīng)該是搞別的時候把torch給搞成cpu版本的了。 按照這個方式在裝一下就好了 https://pytorch.org/

    2024年02月16日
    瀏覽(23)
  • 【because its MIME type (‘text/html‘) is not a supported 報(bào)錯原因與解決】

    【because its MIME type (‘text/html‘) is not a supported 報(bào)錯原因與解決】

    because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled 報(bào)錯原因與解決 事情是這樣的,筆者將一些CSS文件移動到LIB文件夾中,由于沒有正確的引用而出現(xiàn)的錯誤 如下圖1 如下圖2

    2024年02月13日
    瀏覽(21)
  • x264參數(shù)全集

    x264參數(shù)全集

    目錄 x264 介紹 x264 全部參數(shù) profile、preset、tune 相關(guān)參數(shù) CPU、Video properties 相關(guān)參數(shù) ?Encoder 相關(guān)參數(shù) x264是一種開源的視頻編碼器,它能夠?qū)⒁曨l數(shù)據(jù)壓縮為H.264/MPEG-4 AVC格式。x264編碼器具有高效、高質(zhì)量和靈活性等優(yōu)點(diǎn),因此被廣泛用于視頻制作和在線視頻分發(fā)等領(lǐng)域。 網(wǎng)

    2024年02月16日
    瀏覽(15)
  • vite4生產(chǎn)環(huán)境打包報(bào)錯NODE_ENV=production is not supported in the .env file.

    vite4生產(chǎn)環(huán)境打包報(bào)錯NODE_ENV=production is not supported in the .env file.

    vue3+vite4生產(chǎn)環(huán)境production打包報(bào)錯: 大致意思就是: NODE_ENV=.ENV文件中不支持生產(chǎn)。僅支持NODE_ENV=開發(fā)來創(chuàng)建項(xiàng)目的開發(fā)構(gòu)建。如果需要設(shè)置process.env.NODE_env,則可以在Vite配置中進(jìn)行設(shè)置。 ** ** 如果有警告 那就把vite.config.js里面的minify換成:terser(別忘記install下載了)

    2024年02月11日
    瀏覽(130)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包