Recherche avancée

Médias (0)

Mot : - Tags -/serveur

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (18)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Demande de création d’un canal

    12 mars 2010, par

    En 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 à (...)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

Sur d’autres sites (3640)

  • 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



    


  • 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

    


  • avformat/matroskaenc : Improve mimetype search

    3 novembre 2019, par Andreas Rheinhardt
    avformat/matroskaenc : Improve mimetype search
    

    Use the mime_types of the corresponding AVCodecDescriptor instead of
    tables specific to Matroska. The former are generally more encompassing :
    They contain every item of the current lists except "text/plain" for
    AV_CODEC_ID_TEXT and "binary" for AV_CODEC_ID_BIN_DATA.

    The former has been preserved by special-casing it while the latter is
    a hack added in c9212abf so that the demuxer (which uses the same tables)
    sets the appropriate CodecID for broken files ("binary" is not a correct
    mime type at all) ; using it for the muxer was a mistake. The correct
    mime type for AV_CODEC_ID_BIN_DATA is "application/octet-stream" and
    this is what one gets from the AVCodecDescriptor.

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>

    • [DH] libavformat/matroskaenc.c