
Recherche avancée
Médias (1)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
Autres articles (33)
-
Pas question de marché, de cloud etc...
10 avril 2011Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
sur le web 2.0 et dans les entreprises qui en vivent.
Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...) -
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (2755)
-
Catching ffmpeg stream in C# interrupts after a few seconds
15 septembre 2017, par ChrisI want to catch an ip-cam stream with ffmpeg in c# and send it with asp.net mvc web api to a client.
As a client I use also ffmpeg to test the api call.In my api controller I call the ffmpeg.exe with the proper arguments.
string argumentString = $"-i rtsp://{_user}:{_password}@{_ipAddress}/12 -nostdin -vcodec copy -f h264 pipe:1";
ProcessStartInfo startinfo = new ProcessStartInfo(HostingEnvironment.MapPath("~/App_Data/ffmpeg.exe"), argumentString);As you can see I am ignoring the standard input (
-nostdin
) and use the standard output to output the data (pipe:1
).But the client is always closing the connection after a few seconds (12-14).
Here the error message on the server (ASP.NET) :
And here the error message on the client (ffmpeg)
I tried several ways to catch the ip-cam stream.
Via the event
OutputDataReceived
:public HttpResponseMessage Get()
{
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new PushStreamContent((stream, content, context) =>
{
Process ffmpeg = new Process();
string argumentString = $"-i rtsp://{_user}:{_password}@{_ipAddress}/12 -nostdin -vcodec copy -f h264 pipe:1";
ProcessStartInfo startinfo = new ProcessStartInfo(HostingEnvironment.MapPath("~/App_Data/ffmpeg.exe"), argumentString);
startinfo.RedirectStandardError = true;
startinfo.RedirectStandardOutput = true;
startinfo.RedirectStandardInput = true;
startinfo.UseShellExecute = false;
startinfo.CreateNoWindow = true;
ffmpeg.StartInfo = startinfo;
ffmpeg.ErrorDataReceived += (s, e) =>
{
Debug.WriteLine(e.Data);
};
StreamWriter writer = new StreamWriter(stream);
ffmpeg.OutputDataReceived += (s, e) =>
{
writer.Write(e.Data);
};
ffmpeg.Start();
ffmpeg.BeginOutputReadLine();
ffmpeg.BeginErrorReadLine();
ffmpeg.WaitForExit();
}, new MediaTypeHeaderValue("video/mp4")),
};
return result;
}I also tried to do it without a StreamWriter, with every possible Encoding :
ffmpeg.OutputDataReceived += (s, e) =>
{
byte[] toBytes = Encoding.BigEndianUnicode.GetBytes(e.Data);
stream.Write(toBytes, 0, toBytes.Length);
stream.Flush();
};Via the underlying stream from StandardOutput :
public HttpResponseMessage Get()
{
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new PushStreamContent((stream, content, context) =>
{
Process ffmpeg = new Process();
string argumentString = $"-i rtsp://{_user}:{_password}@{_ipAddress}/12 -nostdin -vcodec copy -f h264 pipe:1";
ProcessStartInfo startinfo = new ProcessStartInfo(HostingEnvironment.MapPath("~/App_Data/ffmpeg.exe"), argumentString);
startinfo.RedirectStandardError = true;
startinfo.RedirectStandardOutput = true;
startinfo.RedirectStandardInput = true;
startinfo.UseShellExecute = false;
startinfo.CreateNoWindow = true;
ffmpeg.StartInfo = startinfo;
ffmpeg.Start();
byte[] buffer = new byte[512];
int length = 0;
while ((length = ffmpeg.StandardOutput.BaseStream.Read(buffer, 0, buffer.Length)) > 0)
{
stream.Write(buffer, 0, length);
stream.Flush();
}
}, new MediaTypeHeaderValue("video/mp4")),
};
return result;
}But the result is always the same.
When I do not send the data to the client it is working fine :
public HttpResponseMessage Get()
{
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new PushStreamContent((stream, content, context) =>
{
Process ffmpeg = new Process();
string argumentString = $"-i rtsp://{_user}:{_password}@{_ipAddress}/12 -nostdin -vcodec copy -f h264 pipe:1";
ProcessStartInfo startinfo = new ProcessStartInfo(HostingEnvironment.MapPath("~/App_Data/ffmpeg.exe"), argumentString);
startinfo.RedirectStandardError = true;
startinfo.RedirectStandardOutput = true;
startinfo.RedirectStandardInput = true;
startinfo.UseShellExecute = false;
startinfo.CreateNoWindow = true;
ffmpeg.StartInfo = startinfo;
ffmpeg.Start();
byte[] buffer = new byte[512];
int length = 0;
while ((length = ffmpeg.StandardOutput.BaseStream.Read(buffer, 0, buffer.Length)) > 0)
{
//stream.Write(buffer, 0, length);
//stream.Flush();
}
}, new MediaTypeHeaderValue("video/mp4")),
};
return result;
}So what is wrong with my code ?
-
Getting same frame each time using FFmpegFrameGrabber.grabImage() in Android
12 février 2017, par AlphabateCoderTrying to extract each frame from a video file using javaCV, FFFmpegFramGrabber and save as jpg, end up getting the same frame each time.
FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(cVideoFilePath+ "/" + "VID_20170211_132657.mp4");
try {
AndroidFrameConverter convertToBitmap = new AndroidFrameConverter();
grabber.start();
for (int i= 0; i< grabber.getFrameRate();i++){
frame1 = grabber.grabImage();
Bitmap bitmap = convertToBitmap.convert(frame1);
String date = simpleDateFormat.format(new Date());
File picfile = new File(file_name);
if (!picfile.exists()) {
try {
picfile.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
try {
FileOutputStream out = new FileOutputStream(picfile);
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);
out.flush();
out.close();
} catch (IOException ex) {
} finally {
}
} -
Any tips on debugging java servlet for playing video
15 octobre 2015, par JohnI have a website that allows users to upload videos that they make and then I have another page where these videos can be viewed. However, some videos that users upload can’t be viewed on my page. But if I download the video and open it with the browser it displays fine. I assume there is something wrong with the way my server is dealing with returning partial content. Any suggestions on how to figure out what the problem is ?
Here’s the page to view a video :
https://userbob.com/shareVideo.jsp?code=NSSQ04TBZAW1QWQ7D3NDAV393IY4B3_944_455128_2831Here’s the relevant servlet code that returns the response :
{
try {
video = getVideo( testResult.getVideoId() );
String rangeHeader = request.getHeader( "Range" );
if ( rangeHeader != null ) {
String[] parts = rangeHeader.split( "=" );
if ( parts.length == 2 && parts[0].equals( "bytes" )) {
parts = parts[1].split("-");
if ( parts.length > 0 ) {
rangeStart = Long.parseLong( parts[0] );
if ( parts.length > 1 ) {
rangeEnd = Long.parseLong( parts[1] );
}
else {
rangeEnd = video.getVideoSize() - 1;
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
if ( request.getParameter("download") == null ) {
response.setContentType( "video/webm" );
response.setHeader( "Content-Disposition","inline; filename=screenCast" + testResult.getId() + ".webm");
}
else {
response.setHeader( "Content-Disposition","attachment; filename=screenCast" + testResult.getId() + ".webm");
}
response.setHeader( "Accept-Ranges", "bytes" );
response.setHeader( "Content-Length", Integer.toString( video.getVideoSize() ) );
if ( rangeStart >= 0 ) {
if ( rangeStart >= rangeEnd ) {
response.setStatus( HttpServletResponse.SC_REQUESTED_RANGE_NOT_SATISFIABLE );
String contentRange = "bytes */" + video.getVideoSize() ;
response.setHeader( "Content-Range", contentRange );
return ;
}
response.setStatus( HttpServletResponse.SC_PARTIAL_CONTENT );
String contentRange = "bytes " + rangeStart + "-" + rangeEnd + "/" + video.getVideoSize() ;
response.setHeader( "Content-Range", contentRange );
response.setHeader( "Content-Length", Long.toString(rangeEnd-rangeStart+1) );
}
else {
response.setHeader( "Content-Length", Integer.toString( video.getVideoSize() ) );
}
if ( content ) {
ServletOutputStream outputStream = response.getOutputStream();
InputStream inputStream = video.getVideoStream();
byte[] buffer = new byte[50000];
int bytesRead;
long pos = 0;
if ( rangeStart > 0 ) {
inputStream.skip( rangeStart );
pos += rangeStart ;
}
while ((bytesRead = inputStream.read(buffer)) != -1 ) {
if ( rangeEnd>=0 && pos + bytesRead>rangeEnd ) {
outputStream.write( buffer, 0, (int) (rangeEnd-pos+1) );
outputStream.flush();
pos = rangeEnd ;
break;
}
else {
outputStream.write(buffer, 0, bytesRead);
outputStream.flush();
pos += bytesRead ;
}
}
outputStream.close();
}}