
Recherche avancée
Autres articles (59)
-
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. -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...) -
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (6105)
-
Is there a way to extract frames from a video file using ffmpeg to memory and make some manipulation on each frame ?
28 octobre 2022, par Rojer BriefThe goal is to extract each time a frame from the video file then make histogram from the image and then to move to the next frame. this way all the frames.


The frames extraction and the histogram manipulation is working fine when the frames have saved as images on the hard disk. but now i want to do it all in memory.


to extract the frames i'm using ffmpeg because i think it's fast enough :


ffmpeg -r 1 -i MyVid.mp4 -r 1 "$filename%03d.png



for now i'm using the ffmpeg in command prompt window.


with this command it will save on the hard disk over 65000 images(frames).
but instead saving them on the hard disk i wonder if i can make the histogram manipulation on each frame in memory instead saving all the 65000 frames to the hard disk.


then i want to find specific images using the histogram and save to the hard disk this frames.


the histogram part for now is also using files from the hard disk and not from the memory :


private void btnLoadHistogram_Click(object sender, System.EventArgs e)
 {
 string[] files = Directory.GetFiles(@"d:\screenshots\", "*.jpg");

 for (int i = 0; i < files.Length; i++)
 {
 sbInfo.Text = "Loading image";
 if (pbImage.Image != null)
 pbImage.Image.Dispose();

 pbImage.Image = Image.FromFile(files[i]);//txtFileName.Text);

 Application.DoEvents();

 sbInfo.Text = "Computing histogram";
 long[] myValues = GetHistogram(new Bitmap(pbImage.Image));

 Histogram.DrawHistogram(myValues);

 sbInfo.Text = ""; 
 } 
 }

 public long[] GetHistogram(System.Drawing.Bitmap picture)
 {
 long[] myHistogram = new long[256];

 for (int i=0;i3;
 myHistogram[Temp]++;
 }

 return myHistogram;
 }



and the code of the class of the constrol HistogramaDesenat :


using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

namespace Histograma
{
 /// <summary>
 /// Summary description for HistogramaDesenat.
 /// </summary>
 public class HistogramaDesenat : System.Windows.Forms.UserControl
 {
 /// <summary> 
 /// Required designer variable.
 /// </summary>
 private System.ComponentModel.Container components = null;

 public HistogramaDesenat()
 {
 // This call is required by the Windows.Forms Form Designer.
 InitializeComponent();

 // TODO: Add any initialization after the InitializeComponent call

 this.Paint += new PaintEventHandler(HistogramaDesenat_Paint);
 this.Resize+=new EventHandler(HistogramaDesenat_Resize);
 }

 /// <summary> 
 /// Clean up any resources being used.
 /// </summary>
 protected override void Dispose( bool disposing )
 {
 if( disposing )
 {
 if(components != null)
 {
 components.Dispose();
 }
 }
 base.Dispose( disposing );
 }

 #region Component Designer generated code
 /// <summary> 
 /// Required method for Designer support - do not modify 
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
 // 
 // HistogramaDesenat
 // 
 this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
 this.Name = "HistogramaDesenat";
 this.Size = new System.Drawing.Size(208, 176);
 }
 #endregion

 private void HistogramaDesenat_Paint(object sender, PaintEventArgs e)
 {
 if (myIsDrawing)
 {

 Graphics g = e.Graphics;
 Pen myPen = new Pen(new SolidBrush(myColor),myXUnit);
 //The width of the pen is given by the XUnit for the control.
 for (int i=0;i/We draw each line 
 g.DrawLine(myPen,
 new PointF(myOffset + (i*myXUnit), this.Height - myOffset), 
 new PointF(myOffset + (i*myXUnit), this.Height - myOffset - myValues[i] * myYUnit));

 //We plot the coresponding index for the maximum value.
 if (myValues[i]==myMaxValue)
 {
 SizeF mySize = g.MeasureString(i.ToString(),myFont);

 g.DrawString(i.ToString(),myFont,new SolidBrush(myColor),
 new PointF(myOffset + (i*myXUnit) - (mySize.Width/2), this.Height - myFont.Height ),
 System.Drawing.StringFormat.GenericDefault);
 }
 }

 //We draw the indexes for 0 and for the length of the array beeing plotted
 g.DrawString("0",myFont, new SolidBrush(myColor),new PointF(myOffset,this.Height - myFont.Height),System.Drawing.StringFormat.GenericDefault);
 g.DrawString((myValues.Length-1).ToString(),myFont, 
 new SolidBrush(myColor),
 new PointF(myOffset + (myValues.Length * myXUnit) - g.MeasureString((myValues.Length-1).ToString(),myFont).Width,
 this.Height - myFont.Height),
 System.Drawing.StringFormat.GenericDefault);

 //We draw a rectangle surrounding the control.
 g.DrawRectangle(new System.Drawing.Pen(new SolidBrush(Color.Black),1),0,0,this.Width-1,this.Height-1);
 }

 }

 long myMaxValue;
 private long[] myValues;
 private bool myIsDrawing;

 private float myYUnit; //this gives the vertical unit used to scale our values
 private float myXUnit; //this gives the horizontal unit used to scale our values
 private int myOffset = 20; //the offset, in pixels, from the control margins.

 private Color myColor = Color.Black;
 private Font myFont = new Font("Tahoma",10);

 [Category("Histogram Options")]
 [Description ("The distance from the margins for the histogram")]
 public int Offset
 {
 set
 {
 if (value>0)
 myOffset= value;
 }
 get
 {
 return myOffset;
 }
 }

 [Category("Histogram Options")]
 [Description ("The color used within the control")]
 public Color DisplayColor
 {
 set
 {
 myColor = value;
 }
 get
 {
 return myColor;
 }
 }

 /// <summary>
 /// We draw the histogram on the control
 /// </summary>
 /// The values beeing draw
 public void DrawHistogram(long[] Values)
 {
 myValues = new long[Values.Length];
 Values.CopyTo(myValues,0);

 myIsDrawing = true;
 myMaxValue = getMaxim(myValues);

 ComputeXYUnitValues();

 this.Refresh();
 }

 /// <summary>
 /// We get the highest value from the array
 /// </summary>
 /// The array of values in which we look
 /// <returns>The maximum value</returns>
 private long getMaxim(long[] Vals)
 {
 if (myIsDrawing)
 {
 long max = 0;
 for (int i=0;i max)
 max = Vals[i];
 }
 return max;
 }
 return 1;
 }

 private void HistogramaDesenat_Resize(object sender, EventArgs e)
 {
 if (myIsDrawing)
 {
 ComputeXYUnitValues();
 }
 this.Refresh();
 }

 private void ComputeXYUnitValues()
 {
 myYUnit = (float) (this.Height - (2 * myOffset)) / myMaxValue;
 myXUnit = (float) (this.Width - (2 * myOffset)) / (myValues.Length-1);
 }
 }
}



so in the end this is what i want to do :


- 

-
extract the frames from the video file in memory using the ffmpeg.


-
instead using Directory.GetFiles i want to make the histogram manipulation on each frame from the memory that is extracted by the ffmpeg.


-
each extracted frame image to use the histogram to find if there is a lightning(weather lightning) in the image.


-
if there is a lightning save the frame image to the hard disk.












-
-
Make better marketing decisions with attribution modeling
19 décembre 2017, par InnoCraftDo you suspect some traffic sources are not getting the rewards they deserve ? Do you want to know how much credit each of your marketing channel actually gets ?
When you look at which referrers contribute the most to your goal conversions or purchases, Matomo (Piwik) shows you only the referrer of the last visit. However, in reality, a visitor often visits a website multiple times from different referrers before they convert a goal. Giving all credit to the referrer of the last visit ignores all other referrers that contributed to a conversion as well.
You can now push your marketing analysis to the next level with attribution modeling and finally discover the true value of all your marketing channels. As a result, you will be able to shift your marketing efforts and spending accordingly to maximize your success and stop wasting resources. In marketing, studying this data is called attribution modeling.
Get the true value of your referrers
Attribution is a premium feature that you can easily purchase from the Matomo (Piwik) marketplace.
Once installed, you will be able to :
- identify valuable referrers that you did not see before
- invest in potential new partners
- attribute a new level of conversion
- make this work very easily by filling just a couple of form information
Identify valuable referrers that you did not see before
You probably have hundreds or even thousands of different sources listed within the referrer reports. We also guess that you have the feeling that it is always the same referrers which are credited of conversions.
Guess what, those data are probably biased or at least are not telling you the whole story.
Why ? Because by default, Matomo (Piwik) only attributes all credit to the last referrer.It is likely that many non credited sources played a role in the conversion process as well as people often visit your website several times before converting and they may come from different referrers.
This is exactly where attribution modeling comes into play. With attribution modeling, you can decide which touchpoint you want to study. For example, you can choose to give credit to all the referrers a single visitor came from each time the user visits your website, and not only look at the last one. Without this feature, chances are, that you have spent too much money and / or efforts on the wrong referrer channels in the past because many referrers that contributed to conversions were ignored. Based on the insights you get by applying different attribution models, you can make better decisions on where to shift your marketing spending and efforts.
Invest in potential new partners
Once you apply different attribution models, you will find out that you need to consider a new list of referrers which you before either over- or under-estimated in terms of how much they contributed to your conversions. You probably did not identify those sources before because Matomo (Piwik) shows only the last referrer before a conversion. But you can now also look at what these newly discovered referrers are saying about your company, looking for any advertising programs they may offer, getting in contact with the owner of the website, and more.
Apply up to 6 different attribution models
By default, Matomo (Piwik) is attributing the conversion to the last referrer only. With attribution modeling you can analyze 6 different models :
- Last Interaction : the conversion is attributed to the last referrer, even if it is a direct access.
- Last Non-Direct : the conversion is attributed to the last referrer, but not in the case of a direct access.
- First Interaction : the conversion is attributed to the first referrer which brought you the visit.
- Linear : whatever the number of referrers which brought you the conversion, they will all get the same value.
- Position Based : first and last referrer will be attributed 40% each the conversion value, the remaining 60% is divided between the rest of the referrers.
- Time Decay : this attribution model means that the closer to the date of the conversion is, the more your last referrers will get credit.
Those attribution models will enable you to analyze all your referrers deeply and increase your conversions.
Let’s look at an example where we are comparing two models : “last interaction” and “first interaction”. Our goal is to identify whether some referrers that we are currently considering as less important, are finally playing a serious role in the total amount of conversions :
Comparing Last Interaction model to First Interaction model
Here it is interesting to observe that the website www.hongkiat.com is bringing almost 90% conversion more with the first interaction model rather than the last one.
As a result we can look at this website and take the following actions :
- have a look at the message on this website
- look at opportunities to change the message
- look at opportunities to display extra marketing messages
- get in contact with the owner to identify any other communication opportunities
The Multi Channel Attribution report
Attribution modeling in Matomo (Piwik) does not require you to add any tracking code. The only thing you need is to install the plugin and let the magic happen.
Simple as pie is the word you should keep in mind for this feature. Once installed, you will find the report within the goal section, just above the goals you created :The Multi Attribution menu
There you can select the attribution model you would like to apply or compare.
Attribution modeling is not just about playing with a new report. It is above all an opportunity to increase the number of conversions by identifying referrers that you may have not recognized as valuable in the past. To grow your business, it is crucial to identify the most (and least) successful channels correctly so you can spend your time and money wisely.
The post Make better marketing decisions with attribution modeling appeared first on Analytics Platform - Matomo.
-
Revision 33515 : Erreur dans la requête
4 décembre 2009, par kent1@… — LogErreur dans la requête