Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (103)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (8270)

  • Recursively run ffprobe to get codec types

    5 juin 2022, par Timothy Massing

    I modified @rojo code from here a little to look for h264/AC3 and to recursively run thru all the children folders. My only issue is that it always says the videos has h264 and AC3, but when I run the ffprobe command manually it states different. Am I missing something ?

    



    @if (@CodeSection == @Batch) @then
@echo off & setlocal

for /R %%f in (*.mkv, *.mp4) do (
    echo Testing %%f

    set ffprobe=C:\ffmpeg-4.0.2-win64-static\bin\ffprobe -v quiet -show_entries "stream=codec_name,height" -of json "%%f"

    for /f "delims=" %%I in ('%ffprobe% ^| cscript /nologo /e:JScript "%~f0"') do set "%%~I"

    set "pre=-hide_banner -fflags +genpts+discardcorrupt+fastseek -analyzeduration 100M"
    set "pre=%pre% -probesize 50M -hwaccel dxva2 -y -threads 3 -v error -stats"
    set "global="
    set "video=-c:v h264_nvenc"
    set "audio=-c:a ac3"

    if defined h264 if defined ac3 (
        echo %%~nf already in x264 + AC3 format.
    )

    if not defined h264 if not defined ac3 (

        if not defined ac3 (
            echo Already has AC3 audio.  Re-encoding video only.
            set "audio=-c:a copy"
        ) 

        if not defined h264 (
            echo Already has h264 video.  Re-encoding audio only.
            set "video=-c:v copy"
        )

        echo output "%%~df%%~pf%%~nf.new.mkv"
        echo C:\ffmpeg-4.0.2-win64-static\bin\ffmpeg %pre% -i "%%f" %global% %video% %audio% "%%~df%%~pf%%~nf.new.mkv"

        pause

        echo del "%%f" /f /q
        echo ren "%%~df%%~pf%%~nf.new.mkv" "%%f"
    )

)
@end // end Batch / begin JScript

var stdin = WSH.CreateObject('Scripting.FileSystemObject').GetStandardStream(0),
    htmlfile = WSH.CreateObject('htmlfile'),
    JSON;

htmlfile.write('');
htmlfile.close(JSON = htmlfile.parentWindow.JSON);

var obj = JSON.parse(stdin.ReadAll());

for (var i = obj.streams.length; i--;) {
    if (/h264/i.test(obj.streams[i].codec_name)) WSH.Echo('h264=true');
    if (/ac3/i.test(obj.streams[i].codec_name)) WSH.Echo('ac3=true');
}


    



    I had this working of a second then it stopped for not reason.

    



    @if (@CodeSection == @Batch) @then
@echo off & setlocal & goto run

:run
for /R %%f in (*.mkv, *.mp4) do (
    echo Testing %%f

    set "file=%%f"
    set "drive=%%~df"
    set "dir=%%~pf"
    set "name=%%~nf"
    set "ext=%%~xf"

    for /f "delims=" %%I in ('C:\ffmpeg-4.0.2-win64-static\bin\ffprobe.exe -v quiet -show_entries "stream=codec_name,height" -of json "%%f" ^| cscript /nologo /e:JScript "%~f0"') do (set "%%~I")

    set "pre=-hide_banner -fflags +genpts+discardcorrupt+fastseek -analyzeduration 100M"
    set "pre=%pre% -probesize 50M -hwaccel dxva2 -y -threads 3 -v error -stats"
    set "global="
    set "video=-c:v h264_nvenc"
    set "audio=-c:a ac3"

    if defined ac3 if defined h264 call :both
    if not defined ac3 call :either
    if not defined h264 call :either
)

:both
echo %name% already in x264 + AC3 format.
goto :EOF

:either
if not defined h264 (
    echo Already has AC3 audio.  Re-encoding video only.
    set "audio=-c:a copy"
) 

if not defined ac3 (
    echo Already has h264 video.  Re-encoding audio only.
    set "video=-c:v copy"
)

echo "C:\ffmpeg-4.0.2-win64-static\bin\ffmpeg %pre% -i "%file%" %global% %video% %audio% "%drive%%dir%%name%.new.mkv""
echo del "%file%" /f /q
echo ren "%drive%%dir%%name%.new.mkv" "%name%%ext%"
goto :EOF

@end // end Batch / begin JScript

var stdin = WSH.CreateObject('Scripting.FileSystemObject').GetStandardStream(0),
    htmlfile = WSH.CreateObject('htmlfile'),
    JSON;

htmlfile.write('');
htmlfile.close(JSON = htmlfile.parentWindow.JSON);

var obj = JSON.parse(stdin.ReadAll());

for (var i = obj.streams.length; i--;) {
    if (/h264/i.test(obj.streams[i].codec_name)) WSH.Echo('h264=true');
    if (/ac3/i.test(obj.streams[i].codec_name)) WSH.Echo('ac3=true');
}


    



    ffprobe Output for h264

    



    {
    "programs": [

    ],
    "streams": [
        {
            "codec_name": "h264",
            "height": 528
        },
        {
            "codec_name": "aac"
        }
    ]
}


    



    output for ac3

    



    {
    "programs": [

    ],
    "streams": [
        {
            "codec_name": "h265",
            "height": 528
        },
        {
            "codec_name": "ac3"
        }
    ]
}


    



    output for both ac3/h264

    



    {
    "programs": [

    ],
    "streams": [
        {
            "codec_name": "h264",
            "height": 528
        },
        {
            "codec_name": "ac3"
        }
    ]
}


    


  • How can I read all the data from a pipe and prevent it from closing ?

    23 septembre 2014, par slhck

    I’m trying to read raw YUV data from a compressed file using ffmpeg and pipes with Python.
    The ffmpeg command correctly spits out frames as raw YUV data, and I’m reading it like this :

    def read_from_pipe(pipe, amount):
       raw = pipe.stdout.read(amount)
       pipe.stdout.flush()
       return raw

    pipe_ref = subprocess.Popen('ffmpeg -i "' + input + '" -r 30 -c:v rawvideo -pix_fmt yuv420p -an -f rawvideo -t 5 -',
     shell = True,
     stdout = subprocess.PIPE,
     bufsize=1920*1080*3*2)

    frame_num = 0
    while True:
       data = read_from_pipe(pipe_ref, width*height*3)

       # no more data
       if (len(data) != width*height*3))
           return results

       image = extract_image_data(data, width, height)
       # do something with image, put it into "results" and print frame / SSIM values to console
       frame_num += 1

    The problem is, as soon as ffmpeg is done converting all frames, my program stops. Since the program is a little slower than ffmpeg, it will stop receiving data and exit.

    Basically, for example, I can only work up to frame 30, then ffmpeg finishes at frame 60, and my program also exits. The command line output would say :

    Frame=25 SSIM=0.990472732391
    Frame=26 SSIM=0.98359411819
    Frame=27 SSIM=0.981074433586
    Frame=28 SSIM=0.97850843075
    frame=   60 fps= 27 q=0.0 Lsize=  182250kB time=00:00:02.00 bitrate=746496.0kbits/s dup=12 drop=0    
    video:182250kB audio:0kB subtitle:0 data:0 global headers:0kB muxing overhead 0.000000%
    Frame=29 SSIM=0.977698849804
    frame=   60 fps= 27 q=0.0 Lsize=  182250kB time=00:00:02.00 bitrate=746496.0kbits/s dup=12 drop=0    
    video:182250kB audio:0kB subtitle:0 data:0 global headers:0kB muxing overhead 0.000000%

    How can I get it to work on all frames that are output by ffmpeg ? Or is there any other easier way of obtaining the raw YUV data from any file if not through a pipe ? (I need it to work concurrently)

  • Revision b76fd48a99 : Remove vp9_ prefix from static function names in loopfilter_16_msa Remove the c

    17 juillet 2015, par Jingning Han

    Changed Paths :
     Modify /vpx_dsp/mips/loopfilter_16_msa.c



    Remove vp9_ prefix from static function names in loopfilter_16_msa

    Remove the codec-specific global prefix from static function names.

    Change-Id : I61b2d5f2b7b5fb9dc8bc357d5493ea44df8ab19d