
Recherche avancée
Médias (91)
-
Spitfire Parade - Crisis
15 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Wired NextMusic
14 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (31)
-
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)
Sur d’autres sites (5545)
-
Android : BitmapFactory.decodeStream() returns null after first success
27 avril 2014, par giraffeMy code is intended to update an ImageView with an image from a server when a UI button is pressed.
The client side code shown below is a Runnable that runs when the button is pressed. The server is a desktop Java application with ffmpeg running in the background, continuously updating image.png with an image from the webcam. When the button is pressed on the Android app, the Android app attempts to receive image.png from the server, and because ffmpeg is constantly updating this image, it should be the most recent image taken with the server’s webcam.
My problem is that the first button press shows the correct image, but every subsequent button press will just clear out my ImageView. BitmapFactory.decodeStream() is returning null every time I call it after the first time.
Client side (runs when button is pressed) :
InputStream inputStream = s.getInputStream();
img = BitmapFactory.decodeStream(inputStream);
jpgView.setImageBitmap(img);
jpgView.invalidate();Server side :
ServerSocket sock = new ServerSocket(PORT_NUMBER);
Socket clientSocket = sock.accept();
for (;;) {
File f = new File("C:/folder/image.png");
FileInputStream fileInput = new FileInputStream(f);
BufferedInputStream bufferedInput = new BufferedInputStream(fileInput);
OutputStream outStream = clientSocket.getOutputStream();
try {
byte[] outBuffer = new byte[fSize];
int bRead = bufferedInput.read(outBuffer, 0, outBuffer.length);
outStream.write(outBuffer, 0, bRead);
outStream.flush();
} catch (Exception e) {
e.printStackTrace();
} finally {
bufferedInput.close();
}
} -
subprocess.py returns a File Not Found error
7 avril 2021, par wasneeplusAs part of a video analysis script I wanted to find the duration of a video file. For this I found the script offered in the first answer to this question : How to get the duration of a video in Python ?


import subprocess

def get_length(filename):
 result = subprocess.run(["ffprobe", "-v", "error", "-show_entries",
 "format=duration", "-of",
 "default=noprint_wrappers=1:nokey=1", filename],
 stdout=subprocess.PIPE,
 stderr=subprocess.STDOUT)
 return float(result.stdout)



This code works fine when my friend runs it in a Jupyter server environment, but when I try it on my laptop the trouble starts.


When I imput the following filename into the function :


filename = "C:\\Users\\benja\\OneDrive - De Haagse Hogeschool\\Onderzoeken 3\\8V.mp4"



I get the following error :


Traceback (most recent call last):
 File "c:/Users/benja/OneDrive - De Haagse Hogeschool/Onderzoeken 3/python_script.py", line 9, in <module>
 num_of_frames = math.floor((pf.get_length(filename) - 1)) * 30
 File "c:\Users\benja\OneDrive - De Haagse Hogeschool\Onderzoeken 3\python_funcs.py", line 21, in get_length
 stderr=subprocess.STDOUT)
 File "C:\Users\benja\Anaconda3\lib\subprocess.py", line 466, in run
 with Popen(*popenargs, **kwargs) as process:
 File "C:\Users\benja\Anaconda3\lib\subprocess.py", line 769, in __init__
 restore_signals, start_new_session)
 File "C:\Users\benja\Anaconda3\lib\subprocess.py", line 1172, in _execute_child
 startupinfo)
FileNotFoundError: [WinError 2] Het systeem kan het opgegeven bestand niet vinden
</module>


I do realise that my problem is almost identical to that of several other questions on here. However, their solutions don't seem to work for me. I have tried to :


- 

- Add the location of ffmpeg-win64-4.2.2.exe to the Path system variable.
- Add the location of python.exe to the ComSpec system variable.
- Put the videofile in the same directory as the script.








I would be most grateful if someone could point me in the right direction. Thank you in advance.


-
Why process output reader returns null data ? When same code in other process works correct
26 août 2019, par Владимир ВодовI try to get output from ffmpeg process but cant get output.
In another processes and commands it works correctly but output returns immideately when start !using (var process = new Process())
{
process.StartInfo = new ProcessStartInfo()
{
FileName = LinkHelper.IPFS_PATH,
Arguments = cmd,
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardOutput = true
};
process.ErrorDataReceived += FfmpegErrorRecieved;
process.Start();
using (StreamReader reader = process.StandardOutput)
{
string output = await reader.ReadToEndAsync();
Console.WriteLine(output);
}
process.WaitForExit();
}Update :
As szatmary said ffmpeg use output error instead standard output, so when you initialize process.StandartInfo don’t forget initialize property "RedirectStandardError" to TRUE !Here is correct code :
private async Task DetectFFmpegCamerasAsync()
{
var cmd = "-list_devices true -f dshow -i dummy";
using (var process = new Process())
{
process.StartInfo = new ProcessStartInfo()
{
FileName = LinkHelper.FFMPEG_PATH,
Arguments = cmd,
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardError = true
};
process.Start();
using (StreamReader reader = process.StandardError)
{
string output = await reader.ReadToEndAsync();
Console.WriteLine($"Camera detection output: \n {output}");
}
process.WaitForExit();
}
}