opencv / opencv/opencv-python

can write video but the video can not be play

Aperta
#951 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

incomplete
Lingua principale
Python
Stelle
5.4k
Fork
1k
Merge medio
22h 17m
PR unite (30g)
3

Descrizione

Expected behaviour

can write and play video with sound using opencv

Actual behaviour

can write video using opencv
but the video can not be play
using IPython.display.video()

Steps to reproduce
!wget -c http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4
pip install -U opencv-python
import numpy as np
import cv2 as cv
import IPython

cap = cv.VideoCapture('BigBuckBunny.mp4')

# Define the codec and create VideoWriter object
fourcc = cv.VideoWriter_fourcc(*'XVID')
out = cv.VideoWriter('output.avi', fourcc, 20.0, (640,  480))

while cap.isOpened():
    ret, frame = cap.read()

    if not ret:
        print("Can't receive frame (stream end?). Exiting ...")
        break

    out.write(frame)

    if cv.waitKey(1) == ord('q'):
        break

# Release everything if job is finished
cap.release()
out.release()
cv.destroyAllWindows()

IPython.display.Video('output.avi', embed = True)
  • operating system
    ubuntu jammy

  • architecture (e.g. x86)
    x86_64

  • opencv-python version
    4.9.0.80

  • screenshot
    image

Issue submission checklist
  • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
  • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
  • I'm using the latest version of opencv-python

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo il codice fornito in Google Colab con opencv-python 4.9.0.80 e IPython.display.Video, usando BigBuckBunny.mp4 e i codec elencati. Determina se il problema è specifico del pacchetto precompilato o dell’ambiente di riproduzione di Colab; il lavoro è completato quando viene documentato con prove un problema riproducibile della toolchain di build.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
jupyter, python
Ambito
computer-vision
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
15/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.