
Recherche avancée
Autres articles (100)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
Sur d’autres sites (11304)
-
Cannot access the file because it is being used by another process using ffmpeg
17 avril 2015, par Andrew SimpsonI am getting the error :
Cannot access the file because it is being used by another process
I have a C# desktop app.
I am using the Process class to convert images to a video file by using FFMPEG.
This is my code :
using (Process serverBuild = new Process())
{
serverBuild.StartInfo.WorkingDirectory = Environment.CurrentDirectory;
string args = " -f image2 -i " + {path} + "\\img%05d.jpg -s 352x288 -filter:v \"setpts=5.0*PTS\" -y " + {path}\\File.mp4;
serverBuild.StartInfo.Arguments = args;
serverBuild.StartInfo.FileName = "ffmpeg.exe";
serverBuild.StartInfo.UseShellExecute = false;
serverBuild.StartInfo.RedirectStandardOutput = true;
serverBuild.StartInfo.RedirectStandardError = true;
serverBuild.StartInfo.CreateNoWindow = true;
serverBuild.Start();
// string output = serverBuild.StandardOutput.ReadToEnd();
//Log.Instance.Debug(serverBuild.StandardError.ReadToEnd());
serverBuild.WaitForExit();
serverBuild.Close();
}
Directory.Delete(ExportRoute + FFMPEGPacket.LicenseKey + "\\" + FFMPEGPacket.Guid, true);
//which raise the error..The images are all deleted but the File.Mp4 is not and that is the error. The error says that the newly created MP4 file cannot be deleted.
NB
This is partial code to illustrate the error -
ffmpeg - how to seek a video in random access using duration value ?
30 décembre 2014, par danieladHello Guys I am Building a video library , thumbnail generation application/library using pure PHP here .
All the video upload and thumb generation works. But , in order to randomly generate a four random thumbnails taken out of the video being uploaded , i want to have a random value out of the actaull video duration.
Below is my code taken form Here and it works fine.
$cmd = "ffmpeg -i {$src} 2>&1 |grep Duration";
$output = array ();
exec($cmd, $output);
if(count($output)) {
$duration = explode(':', trim(str_replace('Duration:', NULL, current(explode(',', current($output))))));
list($hour, $min, $sec) = $duration;
$sec = sprintf("%02d:%02d:%02d", rand(0, $hour), rand(0, $min), rand(0, $sec));
} else {
$sec = "00:00:12"; //12sec it's ok :)
}
$cmd = "ffmpeg -ss {$sec} -i {$src} -s {$w}x{$h} -f image2 -vframes 1 {$destination}";
$output = array ();
exec($cmd, $output);But this a sequential access of a video if want to access like 10:00:00 minute frame to generate thumbnails you will have to wait until ffmPEG get to that place like 10minutes i guess.
So , how can i seek faster of the video being thumbnails are taken randomly or how to speed of this thumb generation. I use below code :
$cmd = sprintf('%sffmpeg -i %s %s -an -ss '.$sec.' -r 1 -vframes 1 -s %s %s %s', $ffmpeg_path, null, $input_file, $element['size'], $thumb_output_file, $log_settings);
Thanks
-
FFmpeg avcodec_encode_video2 access violation
28 février 2016, par JustPingoI’ve been trying to encode a frame using FFmpeg with Visual C++. Here is how I do it.
I first have a planar RGB24 image buffer. I convert it to planar YUV using the following rule :Y = ((66 * R + 129 * G + 25 * B + 128) >> 8) + 16;
U = ((-38 * R - 74 * G + 112 * B + 128) >> 8) + 128;
V = ((112 * R - 94 * G - 18 * B + 128) >> 8) + 128;I implemented it like this :
void rgb8toYuv(uchar* rgb, uchar* yuv, uint pixelAmount) {
uchar r, g, b;
for (uint i = 0; i < pixelAmount; i++) {
r = rgb[3 * i];
g = rgb[3 * i + 1];
b = rgb[3 * i + 2];
yuv[3 * i] = ((66 * r + 129 * g + 25 * b + 128) >> 8) + 16;
yuv[3 * i + 1] = ((-38 * r - 74 * g + 112 * b + 128) >> 8) + 128;
yuv[3 * i + 2] = ((112 * r - 94 * g - 18 * b + 128) >> 8) + 128;
}
}I open everything like this (I’m using malloc because I’m used to it in C and it’s my first C++ program, I guess it shouldn’t cause any problem ?) :
AVCodec* codec = avcodec_find_encoder(AV_CODEC_ID_H264);
AVFormatContext* outContext;
avformat_alloc_output_context2(&outContext, NULL, "mp4", filepath);
AVStream* video = avformat_new_stream(outContext, codec);
video->codec->bit_rate = VIDEOBITRATE;
video->codec->width = VIDEOWIDTH;
video->codec->height = VIDEOHEIGHT;
video->time_base = fps;
video->codec->gop_size = 10;
video->codec->max_b_frames = 1;
video->codec->pix_fmt = AV_PIX_FMT_YUV420P;
video->codec->codec_id = AV_CODEC_ID_H264;
video->codec->codec_type = AVMEDIA_TYPE_VIDEO;
avio_open(&outContext->pb, filepath, AVIO_FLAG_READ_WRITE);
avformat_write_header(outContext, NULL);
AVFrame* frame = av_frame_alloc();
frame->width = VIDEOWIDTH;
frame->height = VIDEOHEIGHT;
frame->format = AV_PIX_FMT_YUV420P;Then, here is the function I use to encode a frame :
void encodeFrame(uint currentFrame, uchar* data) { // RGB data
uchar* yuvData = (uchar*) malloc(videoWidth * videoHeight * 3);
rgb8toYuv(data, yuvData, videoWidth * videoHeight);
av_image_fill_arrays(frame->data, frame->linesize, yuvData, AV_PIX_FMT_YUV420P, videoWidth, videoHeight, 3); // I'm not sure about that 3, I couldn't find any documentation about it
AVPacket* packet = (AVPacket*) malloc(sizeof(AVPacket));
memset(packet, 0, sizeof(AVPacket));
av_init_packet(packet);
packet->data = NULL;
packet->size = 0;
frame->pts = currentFrame; // I don't know if this is corrrect too
avcodec_encode_video2(video->codec, packet, frame, NULL);
av_interleaved_write_frame(outContext, packet);
av_packet_unref(packet);
free(yuvData);
free(packet);
}However, this causes an
Access violation writing location 0x00000000
onavcodec_encode_video2
. I checked the errors returned by every of FFmpeg’s functions, and it seems like they all work exceptav_image_fill_arrays
that returns a weird1382400
error, although according to the debugger’s RAM-viewing tool, everything gets filled correctly.It seems like
avcodec_encode_video2
tries to access a NULL object that shouldn’t be, however I can’t find what it could be, as I followed a lot of sources example, and I don’t know what I did wrong.Thanks in advance !
EDIT : After applying the fix suggested by Edgar Rokyan (which is setting the 4th argument to an int pointer), I now get an access violation on
0x00000024
, still withavformat_alloc_output_context2
. I believe the problem is similar, but I still can’t find anything.