
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (67)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là , dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (6410)
-
avformat_find_stream_info not return on Linux
23 novembre 2015, par yuan tianI want to fetch the camera video stream on both windows and linux.The code goes everything well with windows.But when I transplant it to Linux,function avformat_find_stream_info can Not return !
bool VideoFetcher::enumCamera(){
for (int i = 0; i<10; i++){
AVInputFormat *pInputFormat = av_find_input_format(
#ifdef __WIN32
"dshow"
#elif __linux
"v4l2"
#else
""
#endif
);
assert(pInputFormat);
#ifdef __linux
char str[128];
sprintf(str, "/dev/video%d", i);
#endif
AVDictionary* dictionary = NULL;
//av_dict_set(&dictionary, "video_size", "640x480", NULL);
//av_dict_set(&dictionary, "framerate", "30", NULL);
if (avformat_open_input(
&this->cameraFormatContext,
#ifdef __WIN32
(std::string("video=")+thg-¬>getCameraName()).c_str(),
#elif __linux
str,
#else
""
#endif
pInputFormat, &dictionary)
< 0)
{
Log("Error : Couldn't open the camera\n");
}else{
return true;
}
}
return false;
}
assert(avFormatContext);
// int streamError;
auto streamError = avformat_find_stream_info(avFormatContext, NULL);
//the function can not return !
printf("findcodec1\n");
if (streamError< 0){
throw StreamErrorException();
} -
DirectShowLib library is not working with .MP4
4 novembre 2015, par Ragesh PuthiyedathI am a newbie in using DirectShowLib for create image thumbnails from video.
Now i try to use this library for make a thumbnail of my .mp4 video.
Please see my code below.
public static bool CreateThumb(string videoFilename, string thumbFilename, double positionPercent)
{
//Logger.ReportInfo("Creating thumb for " + videoFilename);
bool rval = false;
try
{
IMediaDet m = new MediaDet() as IMediaDet;
m.put_Filename(videoFilename);
int streamCount;
m.get_OutputStreams(out streamCount);
AMMediaType media_type = new AMMediaType();
for (int i = 0; i < streamCount; i++)
{
m.get_StreamMediaType(media_type);
VideoInfoHeader vih = (VideoInfoHeader)Marshal.PtrToStructure(media_type.formatPtr, typeof(VideoInfoHeader));
if (vih == null)
{
continue;
}
double pos;
m.get_StreamLength(out pos);
pos = (int)(pos * positionPercent);
int width = vih.BmiHeader.Width;
int height = vih.BmiHeader.Height;
if (height < 10 || width < 10)
{
continue;
}
string tempfile = Path.GetTempFileName() + ".bmp";
m.WriteBitmapBits(pos, width, height, tempfile);
if (File.Exists(tempfile))
{
using (var bitmap = new Bitmap(tempfile))
{
bitmap.Save(thumbFilename, ImageFormat.Png);
}
File.Delete(tempfile);
rval = true;
}
break;
}
Marshal.ReleaseComObject(m);
}
catch (Exception ex)
{
throw ex;
}
return rval;
}But this method is skiped after this line code execution.
m.get_OutputStreams(out streamCount) ;
streamCount is always ’0’. Is this library is not supported the .mp4 format.
Please give me a advice.
Thanks
-
FFmpeg muxing to avi
2 septembre 2015, par UnciasI have program, that succefully shows h264 stream using SDL : I’m getting h264 frame, decode it using ffmpeg and draw using SDL.
Also I can write frames to file (using fwrite) and play this file through ffplay.But I want to mux data to the avi and face some problems in av_write_frame.
Here is my code :
...
/*Initializing format context - outFormatContext is the member of my class*/
AVOutputFormat *outFormat;
outFormat = av_guess_format(NULL,"out.avi",NULL);
outFormat->video_codec = AV_CODEC_ID_H264;
outFormat->audio_codec = AV_CODEC_ID_NONE;
avformat_alloc_output_context2(&outFormatContext, outFormat, NULL, "out.avi");
AVCodec *outCodec;
AVStream *outStream = add_stream(outFormatContext, &outCodec, outFormatContext->oformat->video_codec);
avcodec_open2(outStream->codec, outCodec, NULL);
av_dump_format(outFormatContext, 0, "out.avi", 1);
if (avio_open(&outFormatContext->pb, "out.avi", AVIO_FLAG_WRITE) < 0)
throw Exception("Couldn't open file");
if (avformat_write_header(outFormatContext, NULL) < 0)
throw Exception("Couldn't write to file");
//I don't have exceptions here - so there is 6KB header in out.avi.
...
static AVStream *add_stream(AVFormatContext *oc, AVCodec **codec,
enum AVCodecID codec_id)
{
AVCodecContext *c;
AVStream *st;
/* find the encoder */
*codec = avcodec_find_encoder(codec_id);
if (!(*codec))
throw("Could not find encoder");
st = avformat_new_stream(oc, *codec);
if (!st)
throw ("Could not allocate stream");
st->id = oc->nb_streams-1;
c = st->codec;
c->bit_rate = 400000;
/* Resolution must be a multiple of two. */
c->width = 1920;
c->height = 1080;
c->pix_fmt = PIX_FMT_YUV420P;
c->flags = 0;
c->time_base.num = 1;
c->time_base.den = 25;
c->gop_size = 12; /* emit one intra frame every twelve frames at most */
return st;
}
...
/* Part of decoding loop. There is AVPacket packet - h264 packet;
int ret = av_write_frame(outFormatContext, &packet); //it return -22 code - Invadlid argument;
if (avcodec_decode_video2(pCodecCtx, pFrame, &frameDecoded, &packet) < 0)
return;
if (frameDecoded)
{
//SDL stuff
}Also i tried to use avcodec_encode_video2 (encode pFrame back to the H264) next to the SDL stuff but encoding is not working - i’ve got empty packets :( It is the second problem.
Using av_interleaved_write_frame causes acces violation.
Code of the muxing part i copied from ffmpeg muxing example (https://www.ffmpeg.org/doxygen/2.1/doc_2examples_2muxing_8c-example.html)