
Recherche avancée
Médias (2)
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
Autres articles (80)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)
Sur d’autres sites (12065)
-
OpenCV returns an Array of All Zeros on video.read
19 janvier 2020, par Ikechukwu AnudeBelow is the relevant code
import cv2 as cv
import numpy as np
video = cv.VideoCapture(0) #tells obj to use built in camera\
#create a face cascade object
face_cascade =
cv.CascadeClassifier(r"C:\Users\xxxxxxx\AppData\Roaming\Python\Python36\site-
packages\cv2\data\haarcascade_frontalcatface.xml")
a = 1
#create loop to display a video
while True:
a = a + 1
check, frame = video.read()
print(frame)
#converts to a gray scale img
gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
#create the faces
faces = face_cascade.detectMultiScale(gray, scaleFactor=1.5, minNeighbors=5)
for(x, y, w, h) in faces:
print(x, y, w, h)
#show the image
cv.imshow('capturing', gray)
key = cv.waitKey(1) #gen a new frame every 1ms
if key == ord('q'): #once you enter 'q' the loop will be exited
break
print(a) #this will print the number of frames
#captures the first frame
video.release() #end the web cam
#destroys the windows when you are not defined
cv.destroyAllWindows()The code displays a video captured from my webcam camera. Despite that, OpevCV doesn’t seem to be processing any frames as all the frames look like this
[[0 0 0]
[0 0 0]
[0 0 0]
...
[0 0 0]
[0 0 0]
[0 0 0]]]which I assume means that they are empty.
This I believe is preventing the algorithm from being able to detect my face in the frame. I have a feeling that the issue lies in the ffmpeg codec, but I’m not entirely sure how to proceed even if that is the case.
OS : Windows 10
Language : PythonEDIT : The Frame is not empty but all the values in the array seem to be ’0’
Why is the frame empty and how can I get OpenCV to detect my face in the frame ?
-
AVCodecContex returns zero for width and height in android
7 mars 2014, par WhoamiNot sure what was my mistake in the below code. I m trying with ffmpeg 0.11 and SDL2.0 in android.
QUESTION :
Why Width and Height of the CodecContext gives me always zero ?..int main(int argc, char *argv[])
{
int flags;
flags = SDL_INIT_VIDEO | SDL_INIT_TIMER;
if (SDL_Init (flags)) {
LOGD ("Could not intialize Video for SDL: %s \n", SDL_GetError());
}
else
LOGD (" SUCCESS: SDL_Init ");
// ffmpeg Register all services..
ffmpeg_register_all ();
pFrame = avcodec_alloc_frame ();
context = avformat_alloc_context();
err = avformat_open_input (&context, "rtsp:ip:port", NULL, NULL);
if ( err < 0) {
__android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "Unable to open rtsp... ");
return -1;
}
for (i = 0; i < context->nb_streams; i++)
{
// Find the Decoder.
codec = avcodec_find_decoder(context->streams[i]->codec->codec_id);
if (codec->type == AVMEDIA_TYPE_VIDEO ) {
__android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "Found Video Streaming.. ");
videoStreamIndex = i;
}
}
// Play RTSP
av_read_play(context);
// Get Codec Context.
pCodecCtx = context->streams[videoStreamIndex]->codec;
if ( pCodecCtx == NULL )
__android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "CodecCtx is NULL>>> ");
else
__android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "CodecCtx is <<<ok>>> ");
//Find the Decoder.
pCodec = avcodec_find_decoder (pCodecCtx->codec_id);
avcodec_open2 (pCodecCtx, pCodec, NULL);
int w = pCodecCtx->width; // Why me getting 0 ?
int h = pCodecCtx->height;
window = SDL_CreateWindow ("Test ffmpeg",SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w, h, SDL_WINDOW_SHOWN|SDL_WINDOW_ALLOW_HIGHDPI);
// What this HIGHDPI Means ??
if ( window != NULL )
{
LOGD (" WINDOW CREATED.. , create Renderer ..");
renderer = SDL_CreateRenderer (window, -1, 0);
}
else
{
LOGD (" Invalid SDL Window ");
}
__android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "Width and Height of PCodeccCtx.. %d .. %d " , w, h);
return 0;
}
</ok> -
AVCodecContex returns zero for width and height in android
17 février 2023, par WhoamiNot sure what was my mistake in the below code. I m trying with ffmpeg 0.11 and SDL2.0 in android.



QUESTION :
Why Width and Height of the CodecContext gives me always zero ?..



int main(int argc, char *argv[])
{

 int flags;
 flags = SDL_INIT_VIDEO | SDL_INIT_TIMER;

 if (SDL_Init (flags)) {
 LOGD ("Could not intialize Video for SDL: %s \n", SDL_GetError());
 }
 else 
 LOGD (" SUCCESS: SDL_Init ");

 // ffmpeg Register all services..
 ffmpeg_register_all (); 


 pFrame = avcodec_alloc_frame ();
 context = avformat_alloc_context();

 err = avformat_open_input (&context, "rtsp:ip:port", NULL, NULL);
 if ( err < 0) {
 __android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "Unable to open rtsp... ");

 return -1;
 }

 for (i = 0; i < context->nb_streams; i++)
 { 
 // Find the Decoder.
 codec = avcodec_find_decoder(context->streams[i]->codec->codec_id);
 if (codec->type == AVMEDIA_TYPE_VIDEO ) {
 __android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "Found Video Streaming.. ");
 videoStreamIndex = i;

 }
 }

 // Play RTSP
 av_read_play(context);

 // Get Codec Context.
 pCodecCtx = context->streams[videoStreamIndex]->codec;
 if ( pCodecCtx == NULL )
 __android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "CodecCtx is NULL>>> ");
 else
 __android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "CodecCtx is <<<ok>>> ");


 //Find the Decoder.
 pCodec = avcodec_find_decoder (pCodecCtx->codec_id);
 avcodec_open2 (pCodecCtx, pCodec, NULL);


 int w = pCodecCtx->width; // Why me getting 0 ? 
 int h = pCodecCtx->height;

 window = SDL_CreateWindow ("Test ffmpeg",SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w, h, SDL_WINDOW_SHOWN|SDL_WINDOW_ALLOW_HIGHDPI);
 // What this HIGHDPI Means ??

 if ( window != NULL ) 
 {
 LOGD (" WINDOW CREATED.. , create Renderer ..");
 renderer = SDL_CreateRenderer (window, -1, 0); 
 }
 else
 {
 LOGD (" Invalid SDL Window "); 
 }
__android_log_print(ANDROID_LOG_DEBUG, "ffmpegguard", "Width and Height of PCodeccCtx.. %d .. %d " , w, h); 
 return 0;
}
</ok>