
Recherche avancée
Autres articles (55)
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
Demande de création d’un canal
12 mars 2010, parEn fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...) -
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.
Sur d’autres sites (9867)
-
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.


-
variable value does not change after for loop c#
10 août 2022, par DokoaI need to use the formula
height
to get a new int value for each cycle, but it is always equal to180
, provided that the index variable changes.

internal class Program
{
 static void Main(string[] args)
 {
 ///some code
 WorkContainer.StartUp(Source, Mode, Output);
 }
}

internal class WorkContainer
{
 public static void StartUp(string Source, string Mode, string Output)
 { 
 ///some code
 int maxWidth = 180;
 int maxHeight = 420;
 int framerate = 30;

 switch (Mode)
 {
 case "Bouncing":
 int delta = 5;
 double bouncesPerSecond = 1.5;
 int index = 0;
 int height = (int)(index == 0 ? maxHeight : (Math.Floor(Math.Abs(Math.Cos(index / (framerate / bouncesPerSecond) * Math.PI) * (maxHeight - delta))) + delta));
 ffmpegWork.ffmpegPngChangeResolution(CurrentDirectory, RandomTempFolderIdentity, index, maxWidth, height);
 break;
 }
 }
}

internal class ffmpegWork 
{
 public static void ffmpegPngChangeResolution(string CurrentDirectory, string RandomTempFolderIdentity, int index, int maxWidth, int height)
 {
 int ImgValues = new DirectoryInfo($"{CurrentDirectory}/Temp{RandomTempFolderIdentity}/img/").GetFiles().Length;
 for (int i = 0; i < ImgValues; i++, index++)
 {
 try
 { 
 Process compiler = new Process();
 compiler.StartInfo.FileName = $"{CurrentDirectory}/ffmpeg/bin/ffmpeg";
 compiler.StartInfo.Arguments = $"-y -i {CurrentDirectory}/Temp{RandomTempFolderIdentity}/img/img-{i + 1}.png -vf scale={maxWidth}:{height} -c:a libvorbis {CurrentDirectory}/Temp{RandomTempFolderIdentity}/webmImg/img-{i + 1}.png";
 compiler.StartInfo.RedirectStandardOutput = true;
 compiler.StartInfo.CreateNoWindow = true;
 compiler.StartInfo.UseShellExecute = false;
 compiler.Start();
 Console.WriteLine($"png frame - {i + 1}/{ImgValues}\nheight={height}");
 }
 catch (Exception e)
 {
 Console.WriteLine(e.Message);
 }
 }
 }
}



console output>>>


png frame - 1/n
height=180
png frame - 2/n
height=180
png frame - 3/n
height=180



-
shorten : pad the internal bitstream buffer
28 novembre 2013, par Anton Khirnov