
Recherche avancée
Autres articles (66)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
MediaSPIP : Modification des droits de création d’objets et de publication définitive
11 novembre 2010, parPar défaut, MediaSPIP permet de créer 5 types d’objets.
Toujours par défaut les droits de création et de publication définitive de ces objets sont réservés aux administrateurs, mais ils sont bien entendu configurables par les webmestres.
Ces droits sont ainsi bloqués pour plusieurs raisons : parce que le fait d’autoriser à publier doit être la volonté du webmestre pas de l’ensemble de la plateforme et donc ne pas être un choix par défaut ; parce qu’avoir un compte peut servir à autre choses également, (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (11072)
-
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 -
Convert .heic to .jpg using ffmpeg ?
19 novembre 2018, par Ketan ChauhanUsing MP4Box :
MP4Box -info IMG_5915.HEIC
I get :
prof colour profile not supported
prof colour profile not supported
Root Meta type : "pict" - 52 resource item(s)
Primary Item - ID 49
Item #1 - ID 1 - Name :
..
.
Item #49 - ID 49 - Name :
Item #50 - ID 50 - Name : Item #51 - ID 51 - Name :
File has no movie (moov) - static data container
Then if I extract all of these :
for i in
seq 51
; do MP4Box -dump-item $i:path=item$i.hevc
IMG_5915.HEIC ; doneThen if i continue, and convert these tiles to jpeg with ffmpeg it convert one tile to jpeg i.e it creates 51 HEVC tiles.
ffmpeg -i item1.hevc -frames:v 1 -vsync vfr -q:v 1 -an image1.jpg
How can I combine these tiles into a single jpg file ?
-
Writing frames from camera using skvideo.io.FFmpegWriter
28 juin 2018, par Liam DeaconI’m trying to finely control the video encoding of camera image frames captured on the fly using
skvideo.io.FFmpegWriter
andcv2.VideoCapture
, e.g.from skvideo import io
import cv2
fps = 60
stream = cv2.VideoCapture(0) # 0 is for /dev/video0
print("fps: {}".format(stream.set(cv2.CAP_PROP_FPS, fps)))
stream.set(cv2.CAP_PROP_FRAME_WIDTH, 1920)
stream.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080)
print("bit_depth: {}".format(stream.set(cv2.CAP_PROP_FORMAT, cv2.CV_8U)))
video = io.FFmpegWriter('/tmp/test_ffmpeg.avi',
inputdict={'-r': fps, '-width': 1920, '-height': 1080},
outputdict={'-r': fps, '-vcodec': 'libx264', '-pix_fmt': 'h264'}
)
try:
for i in range(fps*10): # 10s of video
ret, frame = stream.read()
video.writeFrame(frame)
finally:
stream.release()
try:
video.close()
except:
passHowever, I get the following exception (in Jupyter notebook) :
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in <module>()
18 while range(fps*10):
19 ret, frame = stream.read()
---> 20 video.writeFrame(frame)
21 except BaseException as err:
22 raise err
/usr/local/lib/python3.6/site-packages/skvideo/io/ffmpeg.py in writeFrame(self, im)
446 T, M, N, C = vid.shape
447 if not self.warmStarted:
--> 448 self._warmStart(M, N, C)
449
450 # Ensure that ndarray image is in uint8
/usr/local/lib/python3.6/site-packages/skvideo/io/ffmpeg.py in _warmStart(self, M, N, C)
412 cmd = [_FFMPEG_PATH + "/" + _FFMPEG_APPLICATION, "-y"] + iargs + ["-i", "-"] + oargs + [self._filename]
413
--> 414 self._cmd = " ".join(cmd)
415
416 # Launch process
TypeError: sequence item 3: expected str instance, int found
</module>Changing this to
video.writeFrame(frame.tostring())
results inValueError: Improper data input
, leaving me stumped.How should I go about writing each frame (as returned by OpenCV) to my FFmpegWriter instance ?
EDIT
The code works fine if I remove
inputdict
andoutputdict
from theio.FFmpegWriter
call, however this defeats the purpose for me as I need fine control over the video encoding (I am experimenting with lossless/near-lossless compression of the raw video captured from the camera and trying to establish the best compromise in terms of compression vs fidelity for my needs).