Recherche avancée

Médias (3)

Mot : - Tags -/image

Autres articles (74)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque 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, par

    Accé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 (9972)

  • How to count variable in for loop in power shell

    17 avril 2020, par ilham zacky

    I am using powershell and i have got a for loop running each time 3 variables get printed, for now, loop runs 5 times. I need to get the count like $i++

    



    This is a part of my code

    



    $file = "D:\edl\input\CPExport.xlsx"
$sheetName = "Sheet1"
$objExcel = New-Object -ComObject Excel.Application
$workbook = $objExcel.Workbooks.Open($file)
$sheet = $workbook.Worksheets.Item($sheetName)
$objExcel.Visible = $false
$rowMax = ($sheet.UsedRange.Rows).count
$nu = 0
$rowcount = 000 

for ($i = 0; $i -le $rowMax - 1; $i++) {
    $id = $sheet.Cells.Item($rowName + $i, $colName).text
    $name = $sheet.Cells.Item($rowAge + $i, $colAge).text
    $subtitle = $sheet.Cells.Item($rowCity + $i, $colCity).text
    $jpgId = "$id.jpg"
    $videoId = "$id.mp4"
    $audioId = "$id.m4a"
    $duration1 = if ((ffmpeg -i $audioId 2>&1 | Out-String) -match 'Duration:\s+([\d:"."]+)') { $matches[1] };
    $duration2 = if ((ffmpeg -i $jpgId 2>&1 | Out-String) -match 'Duration:\s+([\d:"."]+)') { $matches[1] };
    $duration = if ((ffmpeg -i $videoId 2>&1 | Out-String) -match 'Duration:\s+([\d:"."]+)') { $matches[1] };

    $newduration = ("$duration").Replace(".", ":")
    $newduration1 = ("$duration1").Replace(".", ":")
    $newduration2 = ("$duration2").Replace(".", ":")

    $out1 = ""
    $out2 = ""
    $out = ""
    $nu++
    $rowcount++
    if ($newduration1) {

        if ($nu -eq 1) {
            $audioA = "00:00:00:00"
        }

        $audioB = Add-Frame -Base $newduration1 -Offset $audioA
        $out1 = "$rowcount" + "  " + "AX" + "   " + "AA" + "     " + "C" + "   " + "00:00:00:00" + " " + $newduration1 + "   " + $audioA 
    }

    if ($newduration2) {

        $imagecal = Add-Frame -Base $imageA -Offset "00:00:06:00"
        $imageB = $imagecal
        $out = "$rowcount" + "  " + "AX" + "   " + "V" + "      " + "C" + "   " + "02:00:05:15" + " " + $newduration2 + "   " + " " + $imageA 
    }


    if ($newduration) {

        $videoA = $imageB
        $videocal = Add-Frame -Base $newduration -Offset $videoA
        $videoB = $videocal
        $out2 = "$rowcount" + "  " + "AX" + "   " + "AA/V" + "   " + "C" + "   " + "00:00:00:00" + " " + $hh + "   " + " " + $videoA 
    }
    else {
        $videoB = ""
    }
    $gg = $out1 + "`n" + "`n" + $out + "`n" + "`n" + $out2 + "`n"
    echo $gg

    $gg | Out-File -FilePath d:\edl\input\output.txt -Append
}
#close excel file
$objExcel.quit()


    



    i have echo $gg
this is the output

    



    1 AX   AA     C   00:00:00:00 00:00:03:48   
1  AX   V      C   02:00:05:15 02:00:11:15
1  AX   AA/V   C   00:00:00:00 00:00:06:93 
2  AX   AA     C   00:00:00:00 00:00:03:46   
2  AX   V      C   02:00:05:15 02:00:11:15    
2  AX   AA     C   00:00:00:00 00:00:03:46  
3  AX   AA     C   00:00:00:00 00:00:03:52   
3  AX   V      C   02:00:05:15 02:00:11:15   
3  AX   AA/V   C   00:00:00:00 00:00:06:93    
4  AX   AA     C   00:00:00:00 00:00:03:21   
4  AX   V      C   02:00:05:15 02:00:11:15    
4  AX   AA     C   00:00:00:00 00:00:03:21   
5  AX   AA     C   00:00:00:00 00:00:03:05   
5  AX   V      C   02:00:05:15 02:00:11:15    
5  AX   AA/V   C   00:00:00:00 00:00:06:93    


    



    Output prints only 1-5 
I need it to be printed 1 - 15

    



    any suggestions ?

    



    thank you for reading

    


  • powershell output to .txt file wont print the for loop

    15 avril 2020, par ilham zacky

    I have some audio, video & jpg files.
I am using ffmpeg to get all the duration

    



    all thing works perfect, I have got all durations from a for loop and set it to a variable, when I echo it, it works perfectly, but when I output it to a .txt file it prints only the last loop
any suggestion 
below is my code

    



    $file = "D:\edl\input\aa.xlsx"
  $sheetName = "Sheet1"
  #Create an instance of Excel.Application and Open Excel file
  $objExcel = New-Object -ComObject Excel.Application
  $workbook = $objExcel.Workbooks.Open($file)
  $sheet = $workbook.Worksheets.Item($sheetName)
  $objExcel.Visible=$false
  #Count max row
  $rowMax = ($sheet.UsedRange.Rows).count
  #Declare the starting positions
  $rowName,$colName = 1,1
  $rowAge,$colAge = 1,2
  $rowCity,$colCity = 1,3
  $rowMessage,$colMessage = 1,9
  #loop to get values and store it
  for ($i=0; $i -le $rowMax-1; $i++)
  {
  $id = $sheet.Cells.Item($rowName+$i,$colName).text
  $name = $sheet.Cells.Item($rowAge+$i,$colAge).text
  $subtitle = $sheet.Cells.Item($rowCity+$i,$colCity).text
$filename2 = "$id.jpg"
$filename = "$id.mp4"
$filename1 = "$id.m4a"
$duration2 = if ((ffmpeg -i $filename2 2>&1 | Out-String) -match 'Duration:\s+([\d:.]+)') { $matches[1] };
$duration1 = if ((ffmpeg -i $filename1 2>&1 | Out-String) -match 'Duration:\s+([\d:.]+)') { $matches[1] };
$duration = if ((ffmpeg -i $filename 2>&1 | Out-String) -match 'Duration:\s+([\d:.]+)') { $matches[1] };
if($duration2){
$duration2 = "02:00:11:15"
$bb = $duration2
$out = "$i" + "  " + "AX" + "   " + "V" + "      " + "C" + "   " + "00:00:00:00" + " " + $bb + "   "+ "* FROM CLIP NAME: " + $id+".jpg"
}
if($duration1){

$out1 = "$i"+ "  " + "AX"  + "   " + "AA" + "     " + "C" + "   " + "00:00:00:00" + " " + $duration1 + "   " + "* FROM CLIP NAME: " + $id+".m4a"
}
if(!$duration){
}else{
$out2 = "$i" + "  " + "AX" + "   " + "AA/V" + "   " + "C" + "   " + "00:00:00:00" + " " + $duration + "   "+ "* FROM CLIP NAME: " + $id+".mp4"
}

$gg = $out+"`n"+"`n"+$out1+"`n"+"`n"+$out2+"`n"
echo $gg
$gg | Out-File -FilePath d:\edl\input\output.txt

  }

  #close excel file
  $objExcel.quit()


    



    when i echo variable $gg
    
this is the output

    



    0  AX   V      C   00:00:00:00 02:00:11:15   * FROM CLIP NAME: 1aef53e6-92ac-4d28-89f8-4cce28fa0f58.jpg

0  AX   AA     C   00:00:00:00 00:00:03.48   * FROM CLIP NAME: 1aef53e6-92ac-4d28-89f8-4cce28fa0f58.m4a

0  AX   AA/V   C   00:00:00:00 00:00:07.64   * FROM CLIP NAME: 1aef53e6-92ac-4d28-89f8-4cce28fa0f58.mp4

1  AX   V      C   00:00:00:00 02:00:11:15   * FROM CLIP NAME: 9a52a954-ffe9-4420-a701-68988923f81f.jpg

1  AX   AA     C   00:00:00:00 00:00:03.46   * FROM CLIP NAME: 9a52a954-ffe9-4420-a701-68988923f81f.m4a

0  AX   AA/V   C   00:00:00:00 00:00:07.64   * FROM CLIP NAME: 1aef53e6-92ac-4d28-89f8-4cce28fa0f58.mp4

2  AX   V      C   00:00:00:00 02:00:11:15   * FROM CLIP NAME: 20b92847-72eb-455d-98ce-6661ed52951e.jpg

2  AX   AA     C   00:00:00:00 00:00:03.52   * FROM CLIP NAME: 20b92847-72eb-455d-98ce-6661ed52951e.m4a

2  AX   AA/V   C   00:00:00:00 00:00:09.75   * FROM CLIP NAME: 20b92847-72eb-455d-98ce-6661ed52951e.mp4

3  AX   V      C   00:00:00:00 02:00:11:15   * FROM CLIP NAME: 73aa1f8e-1067-4efd-b2bd-6748a088f33a.jpg

3  AX   AA     C   00:00:00:00 00:00:03.21   * FROM CLIP NAME: 73aa1f8e-1067-4efd-b2bd-6748a088f33a.m4a

2  AX   AA/V   C   00:00:00:00 00:00:09.75   * FROM CLIP NAME: 20b92847-72eb-455d-98ce-6661ed52951e.mp4

4  AX   V      C   00:00:00:00 02:00:11:15   * FROM CLIP NAME: 1877c551-ceef-48e9-a1a5-00629a9964eb.jpg

4  AX   AA     C   00:00:00:00 00:00:03.05   * FROM CLIP NAME: 1877c551-ceef-48e9-a1a5-00629a9964eb.m4a

4  AX   AA/V   C   00:00:00:00 00:00:06.93   * FROM CLIP NAME: 1877c551-ceef-48e9-a1a5-00629a9964eb.mp4


    



    but my txt file output

    



    4  AX   V      C   00:00:00:00 02:00:11:15   * FROM CLIP NAME: 1877c551-ceef-48e9-a1a5-00629a9964eb.jpg

4  AX   AA     C   00:00:00:00 00:00:03.05   * FROM CLIP NAME: 1877c551-ceef-48e9-a1a5-00629a9964eb.m4a

4  AX   AA/V   C   00:00:00:00 00:00:06.93   * FROM CLIP NAME: 1877c551-ceef-48e9-a1a5-00629a9964eb.mp4



    


  • FFMPEG Select Both Mp3 & M4a Files Through PowerShell

    30 avril 2020, par ilham zacky

    Question - Need to select both *.mp3, *.m4a files from a directory.
I have some audio, video files, I am using ffmpeg or ffprobe to get the file duration,

    



    It runs in a loop, audio names will be taken from an excel sheet. In my directory folder, I have both mp3, m4a files.

    



    This is my code :

    



        $file = (Get-Item -Path ".\CPExport.xlsx")
    #$sheetName = "Sheet1"
    #Create an instance of Excel.Application and Open Excel file
    $objExcel = New-Object -ComObject Excel.Application
    $workbook = $objExcel.Workbooks.Open($file)
    $sheet = $workbook.Worksheets.Item(1)
    $objExcel.Visible=$false
    #Count max row
    $rowMax = ($sheet.UsedRange.Rows).count
    #Declare the starting positions
    $rowName,$colName = 1,1

    $id = $sheet.Cells.Item($rowName+$i,$colName).text

    $audioId = "$id.m4a"
    $videoId = "$id.mp4"
    $duration6= ffprobe -v error -show_entries format=duration -of csv=p=0 $audioId


    



    So I am using this $audioId variable and passing it to my ffmpeg code. Here I can select only the m4a files,
I need to select both mp3 and m4a files.

    



    Any Suggestion ?

    



    I am using Powershell.

    



    Thank you.