
Recherche avancée
Médias (1)
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (80)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
MediaSPIP Core : La Configuration
9 novembre 2010, parMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)
Sur d’autres sites (7711)
-
Why when using ffmpeg to create in real time avi video file from images the avi file is playing with purple noisy color ?
30 juin 2015, par Brubaker HaimThis is my Ffmpeg class i did some time ago
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 Manager
{
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 yuv420p -video_size 1920x1080 -i \\.\pipe\mytestpipe -map 0 -c:v mpeg4 -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 i’m using it in form1 in a button click event :
private void button1_Click(object sender, EventArgs e)
{
timer1.Start();
}the directroy screenshots is where i’m taking a screenshot every 100ms in the timer1 tick event :
ScreenShot shot = new ScreenShot();
public static int counter = 0;
private void timer1_Tick(object sender, EventArgs e)
{
counter++;
shot.GetScreenShot(@"e:\screenshots\", "screenshot");
if (counter == 1200)
{
timer1.Stop();
}
}I’m calling the method PushFrame from inside the ScreenShot class where i save the screenshots.
Ffmpeg fmpeg;
Then :
fmpeg = new Ffmpeg();
fmpeg.Start(@"e:\screenshots\test.avi", 25);And :
public Bitmap GetScreenShot(string folder, string name)
{
_screenShot = new Bitmap(GetScreen());
System.GC.Collect();
System.GC.WaitForPendingFinalizers();
string ingName = folder + name + Elgato_Video_Capture.counter.ToString("D6") + ".bmp";
_screenShot.Save(ingName);
fmpeg.PushFrame(_screenShot);
_screenShot.Dispose();
return _screenShot;
}All the images on the hard disk are fine i can edit/open them and watch them no problems.
They are also same size.The result in the end is one big avi file 1.08 GB size.
But when i play it i see many windows running inside very fast and all painted with noisy purple color.Here a screenshot from the video file when playing it :
I think the problem is somewhere in the Ffmpeg class where i give parameters to the ffmpeg.exe
psi.Arguments = @"-f rawvideo -pix_fmt yuv420p -video_size 1920x1080 -i \\.\pipe\mytestpipe -map 0 -c:v mpeg4 -r " + BitmapRate + " " + outPath;
Not sure what make this avi file to look like that.
This is the video file the result i got : https://www.youtube.com/watch?v=fdxPus-Xv1k&feature=youtu.be
-
How can I compress and create mp4 video file from batch of images on hard disk using ffmpeg ?
29 juin 2015, par Brubaker HaimIn my directory I copied ffmpeg.exe to the same directory where all the images are.
All images are bitmaps.Then in the command prompt windows I typed :
ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1920x1080 -i \\.\pipe\mytestpipe -map 0 -c:v mpeg4 -r out.mp4
But I get error that there is no a directory name :
\.\pipe\mytestpipe
So I removed it and typed the same line without the pipe part.
ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1920x1080 -i -map 0 -c:v mpeg4 -r out.mp4
Now there is no a directory name -map
So I moved the
-map 0
ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1920x1080 -i -c:v mpeg4 -r out.mp4
Now I’m getting error :
-c:v : Protocol not found
I used this line with the pipe in my c# program as arguments to ffmpeg using
ProcessStartInfo
but now I don’t want to use pipes only in the command prompt to type it and compress and create mp4 video file.Edit I tried this now :
ffmpeg -framerate 1/5 -i screenshot%06d.bmp -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
And what I get is some errors :
E:\screenshots>ffmpeg -framerate 1/5 -i screenshot%06d.bmp -c:v libx264 -r 30 -p
ix_fmt yuv420p out.mp4
ffmpeg version N-73165-gf1e1730 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena
ble-decklink --enable-zlib
libavutil 54. 27.100 / 54. 27.100
libavcodec 56. 45.100 / 56. 45.100
libavformat 56. 38.102 / 56. 38.102
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 18.100 / 5. 18.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.100 / 1. 2.100
libpostproc 53. 3.100 / 53. 3.100
[bmp @ 0000000002eb7f80] bad magic number
Last message repeated 2 times
[image2 @ 0000000002eb64e0] decoding for stream 0 failed
[image2 @ 0000000002eb64e0] Could not find codec parameters for stream 0 (Video:
bmp, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
screenshot%06d.bmp: could not find codec parameters
Input #0, image2, from 'screenshot%06d.bmp':
Duration: 00:07:35.00, start: 0.000000, bitrate: N/A
Stream #0:0: Video: bmp, none, 0.20 fps, 0.20 tbr, 0.20 tbn, 0.20 tbc
Output #0, mp4, to 'out.mp4':
Output file #0 does not contain any streamFor those who can see. When i’m doing it on a single file for example :
ffmpeg -framerate 1/5 -i screenshot000002.bmp -c:v libx264 -r 30 -pix_fmt yuv420p out1.mp4
orscreenshot000003.bmp
orscreenshot000122.bmp
it will work fine and create the video file. But when i’m doing this for all images i’m getting all the errors :ffmpeg -framerate 1/5 -i screenshot%06d.bmp -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
here is the results when i did onscreenshot000002.bmp
and it worked fine.When i’m doing it on a single image file it’s working fine like
screenshot000002.bmp
but when doing it on all the imagesscreenshot%06d.bmp
it’s giving me all the errors i mentioned above. -
Why seek on ts file is so slow ?
2 juillet 2015, par skipperI am dealing with a ts file, following is ffprobe output :
ffprobe version N-45589-gb6a0b8b- http://johnvansickle.com/ffmpeg/ Copyright (c) 2007-2014 the FFmpeg developers
built on Aug 28 2014 02:30:32 with gcc 4.8 (Debian 4.8.3-9)
configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --disable-ffserver --enable-libass --enable-gnutls --cc=gcc-4.8
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 0.101 / 56. 0.101
libavformat 56. 3.100 / 56. 3.100
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 0.103 / 5. 0.103
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
[hevc @ 0x298b4a0] No start code is found.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] No start code is found.
Last message repeated 2 times
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] No start code is found.
Last message repeated 7 times
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] No start code is found.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[mpegts @ 0x2987560] decoding for stream 0 failed
[mpegts @ 0x2987560] Could not find codec parameters for stream 0 (Video: hevc ([36][0][0][0] / 0x0024)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'mp4box-jlsj-4k.ts':
Duration: 00:02:15.00, start: 0.001111, bitrate: 31116 kb/s
Program 1
Stream #0:0[0x65]: Video: hevc ([36][0][0][0] / 0x0024), 25 tbr, 90k tbn, 90k tbc
Stream #0:1[0x66]: Audio: eac3, 48000 Hz, 5.1(side), fltp, 448 kb/sThe problem I’m having is that seeking on this file is extremely slow, it took more than 1 minute to complete seek operation.
This ts file is 500MB in size, has 2,793,052 ts packets, 2,750,469 video packets, 137 video packets with random_acces_indicator.
What’s the possible reason for the slow seek ? Why is ffmpeg reporting these errors ? What do I need to do for the analysis ?