
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (88)
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
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 (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)
Sur d’autres sites (7342)
-
Elixir long running background task doesn't complete, sometimes crashes
29 mars 2018, par KulixAs a little bit of background, I have an endpoint that is responsible for video upload. What I want to do, is copy the video file to a temporary location from the request, and spin up an asynchronous task (ffmpeg shell process) to transcode that video in the background so that my endpoint can return a 200 in a timely manner, and the response does not wait for ffmpeg to finish transcoding that video.
Here is my code from the controller.
def create(conn, %{"file" => file ... })
uuid = Video.uuid()
tmp_path = Application.get_env(:myapp, :video_tmp_path) <> "/" <> uuid
:ok = File.cp(file.path, tmp_path)
VideoService.process(tmp_path, final_path)The inside of VideoService looks like the following.
defmodule MyApp.Services do
defmodule VideoService do
def process(tmp_path, final_path) do
Task.start_link fn ->
System.cmd("ffmpeg", ["-i", tmp_path, final_path, "-hide_banner"])
File.rm(tmp_path)
end
end
end
endThe problem I am having here is that no matter what, nothing past the
System.cmd("ffmpeg")
call executes in theVideoService
, and sometimes theSystem.cmd
call doesn’t even spin up anffmpeg
process. Am I doing something wrong here ? What I need is a way to spin thisffmpeg
shell process out in the background from the controller / service and respond with a 200 on video upload. Thanks for help in advance. I am new to elixir / OTP, so I’m sure I’m doing something stupid.I also randomly see the following error
erl_child_setup: failed with error 32 on line 240
-
Limit number of Start-Process running in powershell
4 mai 2018, par AhhhhhhhhhhhhhdfgbvI have tried to limit the number of
Start-Process
running from a Powershell, but I can’t seem to get it to work.I tried to follow this process : https://exchange12rocks.org/2015/05/24/how-to-limit-a-number-of-powershell-jobs-running-simultaneously/ and Run N parallel jobs in powershell
But these are for Jobs not Processes, and I would like to remove the
-Wait
from theStart-Process
My concern with the script is that if there are 1000 audio files in the folder, then FFMpeg would crash the system.
# get the folder for conversion
function mbAudioConvert {
[Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
[System.Windows.Forms.Application]::EnableVisualStyles()
$fileBrowser = New-Object System.Windows.Forms.FolderBrowserDialog
$fileBrowser.SelectedPath = "B:\"
$fileBrowser.ShowNewFolderButton = $false
$fileBrowser.Description = "Select the folder with the audio which you wish to convert to Avid DNxHD 120 25P 48kHz"
$mbLoop = $true
$mbCount = 0001
$mbMaxJob = 4
while( $mbLoop ) {
if( $fileBrowser.ShowDialog() -eq "OK" ) {
$mbLoop = $false
$mbImage = ( Get-Item -Path "C:\Users\user\Desktop\lib\AudioOnly.jpg" )
$mbff32 = ( Get-Item -Path "C:\Users\user\Desktop\lib\ffmpeg32.exe" )
$mbff64 = ( Get-Item -Path "C:\Users\user\Desktop\lib\ffmpeg64.exe" )
$mbFolder = $fileBrowser.SelectedPath
$mbItemInc = ( ls $mbFolder\* -Include *.mp3, *.MP3, *.wav*, *.WAV*, *.ogg, *.OGG, *.wma, *.WMA, *.flac, *.FLAC, *.m4a, *.M4a )
$mbProgress = ( Get-ChildItem -Path $mbItemInc )
$mbHasRaw = ( $mbFolder + "\RAW" )
if( !( Test-Path -Path $mbHasRaw ) ) {
# force create a RAW folder if it does not exist
New-Item -ItemType Directory -Force -Path "$mbHasRaw"
}
foreach( $mbItem in $mbItemInc ) {
$mbCheck = $false
# output the progress
# Suggestion: You might want to consider updating this after starting the job and do the final update after running ex. Get-Job | Wait-Job to make the progress-bar stay until all processes are finished
#Write-Progress -Activity "Counting files for conversion" -status "Currently processing: $mbCount" -percentComplete ($mbCount / $mbItemInc.count*100)
# limit the run number
while ($mbCheck -eq $false) {
if( (Get-Job -State 'Running').count -lt $mbMaxJob) {
$mbScriptBlock = {
$mbItemName = $using:mbItem.BaseName
$mbNewItem = ( $using:mbFolder + "\RAW\" + $mbItemName + ".mov" )
$mbArgs = " -loop 1 -i $using:mbImage -i $using:mbItem -shortest -c:v dnxhd -b:v 120M -s 1920x1080 -pix_fmt yuv422p -r 25 -c:a pcm_s16le -ar 48k -af loudnorm=I=-12 $mbNewItem"
Start-Process -FilePath $using:mbff32 -ArgumentList $mbArgs -NoNewWindow -Wait
}
Start-Job -ScriptBlock $mbScriptBlock
#The job-thread doesn't know about $mbCount, better to increment it after starting the job
$mbCount++
$mbCheck = $true
}
}
}
} else {
$mbResponse = [System.Windows.Forms.MessageBox]::Show("You have exited out of the automation process!", "User has cancelled")
if( $mbResponse -eq "OK" ) {
return
}
}
}
$fileBrowser.SelectedPath
$fileBrowser.Dispose()
}
# call to function
mbAudioConvert -
Trying to pull in https paths into ffmpeg for node-js running on aws ec2 fails with 'input file does not exist'
11 juin 2018, par AuniqI have a script set up to load in a video file from an s3 bucket into a node script running on an ec2 instance, but I am having issues trying to get ffmpeg to accept the url. I know that my aws-sdk integration is working ok as I can read objects and write objects to the bucket, and I am generating a signed url to the object in order to easily pass the path through but it seems to be failing with an ’input file does not exist’ error.
If I use this generated signed path in a browser however, the video file can be found.
Has anyone else come across this issue ? I could probably try and pipe through the external file to a new file local to the ec2 instance but if I can get round that extra step that would be great !