
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (8)
-
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...) -
Other interesting software
13 avril 2011, parWe don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
We don’t know them, we didn’t try them, but you can take a peek.
Videopress
Website : http://videopress.com/
License : GNU/GPL v2
Source code : (...)
Sur d’autres sites (2841)
-
Révision 18369 : Report de r18368 : Révision du code HTML produit par le filtre agenda_memo (et so...
22 août 2011, par esj@rezo.netremplacement de "cellpadding" par la propriété CSS "padding" * remplacement de "cellspacing=0" par la propriété CSS "border-collapse : collapse * remplacement de la plupart des tables par des Div positionnéés, afin d’évacuer certaines tables imbriquées * mise en Ajax du triple mini-agenda aparaissant au (...)
-
Révision 18368 : Révision du code HTML produit par le filtre agenda_memo (et son utilisation impl...
22 août 2011, par esj@rezo.netremplacement de "cellpadding" par la propriété CSS "padding" * remplacement de "cellspacing=0" par la propriété CSS "border-collapse : collapse * remplacement de la plupart des tables par des Div positionnéés, afin d’évacuer certaines tables imbriquées * mise en Ajax du triple mini-agenda aparaissant au (...)
-
How can i capture a screenshots from pictureBox1 every X milliseconds ?
9 avril 2016, par Brubaker HaimThe way it is now it’s capturing screenshots depending on on what screen I am in.
For example if i’m in my desktop it will take screenshots of my desktop if I move to the form1 and see the pictureBox1 it will take screenshots of the pictureBox1.But how can I get directly screenshots from the pictureBox1 no matter on what screen I am ?
Bitmap bmp1;
public static int counter = 0;
private void timer1_Tick(object sender, EventArgs e)
{
counter++;
Rectangle rect = new Rectangle(0, 0, pictureBox1.ClientSize.Width, pictureBox1.ClientSize.Height);
bmp1 = new Bitmap(rect.Width, rect.Height, PixelFormat.Format32bppArgb);
Graphics g = Graphics.FromImage(bmp1);
g.CopyFromScreen(rect.Left, rect.Top, 0, 0, bmp1.Size, CopyPixelOperation.SourceCopy);
bmp1.Save(@"e:\screenshots\" + "screenshot" + counter.ToString("D6") + ".bmp", ImageFormat.Bmp);
bmp1.Dispose();
g.Dispose();
if (counter == 500)//1200)
{
timer1.Stop();
this.Close();
}
}The timer1 is set now to 100ms interval in the designer.
But what is a reasonable speed to take screenshots from animation in the pictureBox1 ? In this case I have a game I show in the pictureBox1 and I want to take a screenshots of each frame from the pictureBox1 and in real time to create mp4 video file on the hard disk from each frame I took.So instead saving the bmp1 to the hard disk I need somehow to save each frame I capture in memory and build mp4 video file in real time.
I created a ffmpeg class for that :
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.IO.Pipes;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.IO;
using DannyGeneral;
namespace ffmpeg
{
public class Ffmpeg
{
NamedPipeServerStream p;
String pipename = "mytestpipe";
System.Diagnostics.Process process;
string ffmpegFileName = "ffmpeg.exe";
string workingDirectory;
public Ffmpeg()
{
workingDirectory = Path.GetDirectoryName(Application.ExecutablePath);
Logger.Write("workingDirectory: " + workingDirectory);
if (!Directory.Exists(workingDirectory))
{
Directory.CreateDirectory(workingDirectory);
}
ffmpegFileName = Path.Combine(workingDirectory, ffmpegFileName);
Logger.Write("FfmpegFilename: " + ffmpegFileName);
}
public void Start(string pathFileName, int BitmapRate)
{
try
{
string outPath = pathFileName;
p = new NamedPipeServerStream(pipename, PipeDirection.Out, 1, PipeTransmissionMode.Byte);
ProcessStartInfo psi = new ProcessStartInfo();
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.UseShellExecute = false;
psi.CreateNoWindow = false;
psi.FileName = ffmpegFileName;
psi.WorkingDirectory = workingDirectory;
psi.Arguments = @"-f rawvideo -pix_fmt bgra -video_size 1920x1080 -i \\.\pipe\mytestpipe -c:v mpeg2video -crf 20 -r " + BitmapRate + " " + outPath;
process = Process.Start(psi);
process.EnableRaisingEvents = false;
psi.RedirectStandardError = true;
p.WaitForConnection();
}
catch (Exception err)
{
Logger.Write("Exception Error: " + err.ToString());
}
}
public void PushFrame(Bitmap bmp)
{
try
{
int length;
// Lock the bitmap's bits.
//bmp = new Bitmap(1920, 1080);
Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
//Rectangle rect = new Rectangle(0, 0, 1280, 720);
System.Drawing.Imaging.BitmapData bmpData =
bmp.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadOnly,
bmp.PixelFormat);
int absStride = Math.Abs(bmpData.Stride);
// Get the address of the first line.
IntPtr ptr = bmpData.Scan0;
// Declare an array to hold the bytes of the bitmap.
//length = 3 * bmp.Width * bmp.Height;
length = absStride * bmpData.Height;
byte[] rgbValues = new byte[length];
//Marshal.Copy(ptr, rgbValues, 0, length);
int j = bmp.Height - 1;
for (int i = 0; i < bmp.Height; i++)
{
IntPtr pointer = new IntPtr(bmpData.Scan0.ToInt32() + (bmpData.Stride * j));
System.Runtime.InteropServices.Marshal.Copy(pointer, rgbValues, absStride * (bmp.Height - i - 1), absStride);
j--;
}
p.Write(rgbValues, 0, length);
bmp.UnlockBits(bmpData);
}
catch(Exception err)
{
Logger.Write("Error: " + err.ToString());
}
}
public void Close()
{
p.Close();
}
}
}And using the ffmpeg class like this :
public static Ffmpeg fmpeg;
Then
fmpeg = new Ffmpeg();
fmpeg.Start(@"e:\screenshots\test.mp4", 25);And
fmpeg.PushFrame(_screenShot);
My main question is first how to get the screenshots(frames) from the pictureBox1 directly no matter what screen i’m in now ?
And how to use on each frame with the fmpeg to get a fine mp4 speed video file I mean that I will not miss a frame to capture all frames and also that the mp4 video file will when I play it later will not display a fast video or too slow ?