
Recherche avancée
Autres articles (109)
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users. -
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 (...)
Sur d’autres sites (10924)
-
Stream with ffmpeg over LAN ?
5 septembre 2018, par KalpitI’m trying to stream a mpegts file over LAN, with the command
ffmpeg -re -i in.ts -vcodec copy -acodec copy -f mpegts "udp://localhost:5000/live/stream"
And trying to capture 10s chunks of it over LAN(at server) at
ffmpeg -i udp://192.168.xx.xx:5000/live/stream -c copy -f segment -segment_time 10 -strftime 1 "in /%Y-%m-%d_%H-%M-%S.mp4"
This isn’t working. I tested the stream in VLC, and there’s nothing to play.
Now, I suspect this is a port issue, since FFMPEG doesnt seem to write/listen over the 5000 port specified. I used netstat to check, and there are no PID including ffmpeg on the port. However, the command
ffmpeg -i udp://127.0.0.1:5000/live/stream -c copy -f segment -segment_time 10 -strftime 1 "in/%Y-%m-%d_%H-%M-%S.mp4"
generates the desired output on my machine(localhost), as does ffplay. Can anyone help ?
-
Video encoded by ffmpeg.exe giving me a garbage video in c# .net
10 septembre 2018, par Amit YadavI want to record video through webcam and file to be saved in
.mp4
format. So for recording i am usingAforgeNet.dll
for recording and formp4
format i am encoding raw video intomp4
usingffmpeg.exe
usingNamedPipeStreamServer
as i receive frame i push into the named pipe buffer. this process works fine i have checked inProcessTheErrorData
event but when i stop recording the output file play garbage video shown in the image belowHere is Code for this
Process Process;
NamedPipeServerStream _ffmpegIn;
byte[] _videoBuffer ;
const string PipePrefix = @"\\.\pipe\";
public void ffmpegWriter()
{
if(File.Exists("outputencoded.mp4"))
{
File.Delete("outputencoded.mp4");
}
_videoBuffer = new byte[widht * heigth * 4];
var audioPipeName = GetPipeName();
var videoPipeName = GetPipeName();
var videoInArgs = $@" -thread_queue_size 512 -use_wallclock_as_timestamps 1 -f rawvideo -pix_fmt rgb32 -video_size 640x480 -i \\.\pipe\{videoPipeName}";
var videoOutArgs = $"-vcodec libx264 -crf 15 -pix_fmt yuv420p -preset ultrafast -r 10";
_ffmpegIn = new NamedPipeServerStream(videoPipeName, PipeDirection.Out, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous, 0, _videoBuffer.Length);
Process=StartFFmpeg($"{videoInArgs} {videoOutArgs} \"{"outputencoded.mp4"}\"", "outputencoded.mp4");
}
bool WaitForConnection(NamedPipeServerStream ServerStream, int Timeout)
{
var asyncResult = ServerStream.BeginWaitForConnection(Ar => { }, null);
if (asyncResult.AsyncWaitHandle.WaitOne(Timeout))
{
ServerStream.EndWaitForConnection(asyncResult);
return ServerStream.IsConnected;
}
return false;
}
static string GetPipeName() => $"record-{Guid.NewGuid()}";
public static Process StartFFmpeg(string Arguments, string OutputFileName)
{
var process = new Process
{
StartInfo =
{
FileName = "ffmpeg.exe",
Arguments = Arguments,
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardError = true,
RedirectStandardInput = true,
},
EnableRaisingEvents = true
};
// var logItem = ServiceProvider.Get<ffmpeglog>().CreateNew(Path.GetFileName(OutputFileName));
process.ErrorDataReceived += (s, e) => ProcessTheErrorData(s,e);
process.Start();
process.BeginErrorReadLine();
return process;
}
</ffmpeglog>and Writing each frame like this.
private void video_NewFrame(object sender, NewFrameEventArgs eventArgs)
{
try
{
if (_recording)
{
using (var bitmap = (Bitmap) eventArgs.Frame.Clone())
{
var _videoBuffers = ImageToByte(bitmap);
if (_firstFrameTime != null)
{
bitmap.Save("image/" + DateTime.Now.ToString("ddMMyyyyHHmmssfftt")+".bmp");
_lastFrameTask?.Wait();
_lastFrameTask = _ffmpegIn.WriteAsync(_videoBuffers, 0, _videoBuffers.Length);
}
else
{
if (_firstFrame)
{
if (!WaitForConnection(_ffmpegIn, 5000))
{
throw new Exception("Cannot connect Video pipe to FFmpeg");
}
_firstFrame = false;
}
_firstFrameTime = DateTime.Now;
_lastFrameTask?.Wait();
_lastFrameTask = _ffmpegIn.WriteAsync(_videoBuffers, 0, _videoBuffers.Length);
}
}
}
using (var bitmap = (Bitmap) eventArgs.Frame.Clone())
{
var bi = bitmap.ToBitmapImage();
bi.Freeze();
Dispatcher.CurrentDispatcher.Invoke(() => Image = bi);
}
}
catch (Exception exc)
{
MessageBox.Show("Error on _videoSource_NewFrame:\n" + exc.Message, "Error", MessageBoxButton.OK,
MessageBoxImage.Error);
StopCamera();
}
}Even i have written each frame to disk as bitmap .bmp and frames are correct but i don’t know what’s i am missing here ? please help thanks in advance.
-
How do I set ffmpeg pipe output ?
5 décembre 2019, par mr_blondI need to read ffmpeg output as pipe.
There is a code example :public static void PipeTest()
{
Process proc = new Process();
proc.StartInfo.FileName = Path.Combine(WorkingFolder, "ffmpeg");
proc.StartInfo.Arguments = String.Format("$ ffmpeg -i input.mp3 pipe:1");
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardInput = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.Start();
FileStream baseStream = proc.StandardOutput.BaseStream as FileStream;
byte[] audioData;
int lastRead = 0;
using (MemoryStream ms = new MemoryStream())
{
byte[] buffer = new byte[5000];
do
{
lastRead = baseStream.Read(buffer, 0, buffer.Length);
ms.Write(buffer, 0, lastRead);
} while (lastRead > 0);
audioData = ms.ToArray();
}
using(FileStream s = new FileStream(Path.Combine(WorkingFolder, "pipe_output_01.mp3"), FileMode.Create))
{
s.Write(audioData, 0, audioData.Length);
}
}It’s log from ffmpeg, the first file is readed :
Input #0, mp3, from ’norm.mp3’ :
Metadata :
encoder : Lavf58.17.103
Duration : 00:01:36.22, start : 0.023021, bitrate : 128 kb/s
Stream #0:0 : Audio : mp3, 48000 Hz, stereo, fltp, 128 kb/s
Metadata :
encoder : Lavc58.27Then pipe :
[NULL @ 0x7fd58a001e00] Unable to find a suitable output format for ’$’
$ : Invalid argumentIf I run "-i input.mp3 pipe:1", the log is :
Unable to find a suitable output format for ’pipe:1’ pipe:1 : Invalid
argumentHow do I set correct output ? And how should ffmpeg know what the output format is at all ?