Recherche avancée

Médias (91)

Autres articles (21)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

  • Les statuts des instances de mutualisation

    13 mars 2010, par

    Pour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
    Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)

Sur d’autres sites (4410)

  • ffmpeg creating mpeg-dash chunk files too slowly resulting in 404 errors

    17 juillet 2021, par Danny

    I have a hardware encoder feeding FFmpeg to create a MPEG-DASH Low Latency stream. It works well for a while, but after letting FFmpeg run for a while and reloading the page there are many 404 errors.

    


    When that happens, the dash.js player tries to fetch the segment file on the "live edge" but the file has not been created yet by FFmpeg. For example, after running for 20-30 minutes and loading the web page player, debug code in the web server shows :

    


    2021-07-16 16:46:30.64 : GET REQUEST : /data/ott/chunk-stream0-00702.m4s
2021-07-16 16:46:30.67 : NOT FOUND. Latest files on filesystem:
    chunk-stream0-00699.m4s.tmp
    chunk-stream0-00698.m4s
    chunk-stream0-00697.m4s
    chunk-stream0-00696.m4s
    ...


    


    So you can see the browser requested chunk 702 but the latest on the server is (part of) 699. With 2 second chunks, that is 3-5 seconds of content not yet available.

    


    To analyze, I modified FFmpeg's dashenc.c to add a timestamp every time a file is opened which displays like :

    


    [dash @ 0x9b17c0] 21:48:52.935 1626443332.935  : dashenc_io_open() - opened /data/ott/chunk-stream0-00060.m4s.tmp


    


    And loaded the timestamps into Excel.

    


    Despite a segment duration of 2.000 seconds, the average time between file opens is 2.011 seconds. Over two hours this accumulated to a 45 second difference between the calculated live edge and the latest file on the server.

    


    The HW encoder is set to 25 fps and a GOP size of 5. I've confirmed both by analyzing the H.264 NALUs output by the HW encoder.

    


    My Question : Is this a bug in FFmpeg or can I avoid this problem by adjusting the settings of either the HW encoder and/or FFmpeg options ?

    


    REFERENCE

    


    FFmpeg: Version 4.4 
Centos 8 
Apache 2.4.37


    


    FFmpeg command line (pipe is fed by process reading HW encoder)

    


    ffmpeg -re -loglevel verbose -an -f h264 -i pipe:17 -c:v copy \
-f dash -dash_segment_type mp4 -b:v 1000000 -seg_duration 2.000000 \
-frag_type duration -frag_duration 0.200000 -target_latency 1 \
-window_size 10 -extra_window_size 5 -remove_at_exit 1 -streaming 1 \
-ldash 1 -use_template 1 -use_timeline 0 -write_prft 1 -avioflags direct \
-fflags +nobuffer+flush_packets -format_options movflags=+cmaf \
-utc_timing_url /web/be/time.php /data/ott/master.mpd


    


    Modified dash_io_open() from dashenc.c

    


    static int 
dashenc_io_open(AVFormatContext *s, AVIOContext **pb, char *filename, AVDictionary **options)
{
    DASHContext *c = s->priv_data;
    int http_base_proto = filename ? ff_is_http_proto(filename) : 0;
    int err = AVERROR_MUXER_NOT_FOUND;
    if (!*pb || !http_base_proto || !c->http_persistent)
    {
        err = s->io_open(s, pb, filename, AVIO_FLAG_WRITE, options);

        // My Debug
        {
            char buf[20], milli[60];
            struct timeb tp;

            ftime(&tp); // sec + ms
            struct tm *tmInfo = localtime(&tp.time);

            // 2020-05-15 21:15:12.123
            strftime(buf, sizeof(buf), "%H:%M:%S", tmInfo);
            snprintf(milli, 59, "%s.%03d %d.%03d ", buf, tp.millitm, tp.time, tp.millitm);

            av_log(s, AV_LOG_INFO, "%s : dashenc_io_open() - opened %s\n", milli, filename);
        }
    }
    return err;
}


    


  • Pyinstaller exe works halfway on another computer

    5 novembre 2022, par At Bay

    I wrote a code which uses FFMPEG and os, subprocess, datetime, speechrecognition, and xlsxwriter libraries. Below a brief sketch of the code - it goes through a directory of wav files and creates a transcription for X seconds in length and saves it into an excel sheet.
import os
import subprocess
import datetime
import speech_recognition as sr
import xlsxwriter

    


    def ffmpeg():
   #create clip
   subprocess.run(["ffmpeg", "-ss", starti, "-t", lengthi, "-i", filepathO, filepathNEW1])

   #convert to mono
   subprocess.run(["ffmpeg", "-i", filepathNEW1, "-ac", "1", filepathNEW2])
   
   #compres to 44.1 kHZ
   subprocess.run(["ffmpeg", "-i", filepathNEW2, "-ar", "44100", filepathNEW3])

def transcription():
    with sr.AudioFile(os.path.abspath(clippath)) as source:
       audio = r.record(source)  # read the entire audio file
       transcriptstring = str(r.recognize_google(audio, language = 'en', show_all=True))
       worksheet.write(tcol, transcriptstring)


#call functions in this order
for filename in os.listdir(ufolder):
   if (filename.endswith(".wav")):
       ffmpeg() #cuts clips, compresses to mono and 44.1 khz
       transcription() 

workbook.close()



    


    When I try to run the exe created by pyinstaller, I get the following error :

    


    Enter directory of wav files: C:\Users\myname\Downloads\&#xA;Enter clip start (seconds): 0&#xA;Enter desired clip length (seconds): 5&#xA;Traceback (most recent call last):&#xA;  File "cliptranscript.py", line 134, in <module>&#xA;  File "cliptranscript.py", line 47, in ffmpeg&#xA;  File "subprocess.py", line 503, in run&#xA;  File "subprocess.py", line 971, in __init__&#xA;  File "subprocess.py", line 1440, in _execute_child&#xA;FileNotFoundError: [WinError 2] The system cannot find the file specified&#xA;[13304] Failed to execute script &#x27;cliptranscript&#x27; due to unhandled exception!&#xA;</module>

    &#xA;

    Below is a partial view of the folder created by pyinstaller :&#xA;1

    &#xA;

  • 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++

    &#xA;&#xA;

    This is a part of my code

    &#xA;&#xA;

    $file = "D:\edl\input\CPExport.xlsx"&#xA;$sheetName = "Sheet1"&#xA;$objExcel = New-Object -ComObject Excel.Application&#xA;$workbook = $objExcel.Workbooks.Open($file)&#xA;$sheet = $workbook.Worksheets.Item($sheetName)&#xA;$objExcel.Visible = $false&#xA;$rowMax = ($sheet.UsedRange.Rows).count&#xA;$nu = 0&#xA;$rowcount = 000 &#xA;&#xA;for ($i = 0; $i -le $rowMax - 1; $i&#x2B;&#x2B;) {&#xA;    $id = $sheet.Cells.Item($rowName &#x2B; $i, $colName).text&#xA;    $name = $sheet.Cells.Item($rowAge &#x2B; $i, $colAge).text&#xA;    $subtitle = $sheet.Cells.Item($rowCity &#x2B; $i, $colCity).text&#xA;    $jpgId = "$id.jpg"&#xA;    $videoId = "$id.mp4"&#xA;    $audioId = "$id.m4a"&#xA;    $duration1 = if ((ffmpeg -i $audioId 2>&amp;1 | Out-String) -match &#x27;Duration:\s&#x2B;([\d:"."]&#x2B;)&#x27;) { $matches[1] };&#xA;    $duration2 = if ((ffmpeg -i $jpgId 2>&amp;1 | Out-String) -match &#x27;Duration:\s&#x2B;([\d:"."]&#x2B;)&#x27;) { $matches[1] };&#xA;    $duration = if ((ffmpeg -i $videoId 2>&amp;1 | Out-String) -match &#x27;Duration:\s&#x2B;([\d:"."]&#x2B;)&#x27;) { $matches[1] };&#xA;&#xA;    $newduration = ("$duration").Replace(".", ":")&#xA;    $newduration1 = ("$duration1").Replace(".", ":")&#xA;    $newduration2 = ("$duration2").Replace(".", ":")&#xA;&#xA;    $out1 = ""&#xA;    $out2 = ""&#xA;    $out = ""&#xA;    $nu&#x2B;&#x2B;&#xA;    $rowcount&#x2B;&#x2B;&#xA;    if ($newduration1) {&#xA;&#xA;        if ($nu -eq 1) {&#xA;            $audioA = "00:00:00:00"&#xA;        }&#xA;&#xA;        $audioB = Add-Frame -Base $newduration1 -Offset $audioA&#xA;        $out1 = "$rowcount" &#x2B; "  " &#x2B; "AX" &#x2B; "   " &#x2B; "AA" &#x2B; "     " &#x2B; "C" &#x2B; "   " &#x2B; "00:00:00:00" &#x2B; " " &#x2B; $newduration1 &#x2B; "   " &#x2B; $audioA &#xA;    }&#xA;&#xA;    if ($newduration2) {&#xA;&#xA;        $imagecal = Add-Frame -Base $imageA -Offset "00:00:06:00"&#xA;        $imageB = $imagecal&#xA;        $out = "$rowcount" &#x2B; "  " &#x2B; "AX" &#x2B; "   " &#x2B; "V" &#x2B; "      " &#x2B; "C" &#x2B; "   " &#x2B; "02:00:05:15" &#x2B; " " &#x2B; $newduration2 &#x2B; "   " &#x2B; " " &#x2B; $imageA &#xA;    }&#xA;&#xA;&#xA;    if ($newduration) {&#xA;&#xA;        $videoA = $imageB&#xA;        $videocal = Add-Frame -Base $newduration -Offset $videoA&#xA;        $videoB = $videocal&#xA;        $out2 = "$rowcount" &#x2B; "  " &#x2B; "AX" &#x2B; "   " &#x2B; "AA/V" &#x2B; "   " &#x2B; "C" &#x2B; "   " &#x2B; "00:00:00:00" &#x2B; " " &#x2B; $hh &#x2B; "   " &#x2B; " " &#x2B; $videoA &#xA;    }&#xA;    else {&#xA;        $videoB = ""&#xA;    }&#xA;    $gg = $out1 &#x2B; "`n" &#x2B; "`n" &#x2B; $out &#x2B; "`n" &#x2B; "`n" &#x2B; $out2 &#x2B; "`n"&#xA;    echo $gg&#xA;&#xA;    $gg | Out-File -FilePath d:\edl\input\output.txt -Append&#xA;}&#xA;#close excel file&#xA;$objExcel.quit()&#xA;

    &#xA;&#xA;

    i have echo $gg&#xA;this is the output

    &#xA;&#xA;

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

    &#xA;&#xA;

    Output prints only 1-5 &#xA;I need it to be printed 1 - 15

    &#xA;&#xA;

    any suggestions ?

    &#xA;&#xA;

    thank you for reading

    &#xA;