Recherche avancée

Médias (5)

Mot : - Tags -/open film making

Autres articles (99)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (14751)

  • Windows batch - unable to assign a variable within an iterative for loop

    17 janvier 2024, par user23254772

    I am using ffprobe to get the codec_name of subtitles in media files. But when I try to get the codec extension it fails. What am I doing wrong ?

    


    I have edited this post to address the comments and include the complete batch file

    


    Re : ns.txt - this command outputs the stream number of the subtitles :

    


    C:\ffmpeg\bin\ffprobe -loglevel error -select_streams s -show_entries stream=index:stream_tags=language -of csv=p=0 -i "%~dpnx1">ns.txt


    


    and the output in the txt file is :

    


    2
3


    


    Now I need to count the number of lines in this text file which will tell me how many subtitles my media file has :

    


    set "cmd=findstr /R /N "^^" ns.txt | find /C ":""
for /f %%a in ('!cmd!') do set nums=%%a
set /A nums=%nums%-1


    


    In this case nums = 2 but in ffprobe the first subtitle is s:0, so I subtract 1 from nums

    


    My iterative loop is :

    


    FOR %%i in (1,1,%nums%) DO (
C:\ffmpeg\bin\ffprobe.exe -v quiet -select_streams s:%%i -show_entries stream=%arg% -of default=noprint_wrappers=1:nokey=1 -i "%~dpnx1" >sub.txt
set /p codecs=code>

    


    Which puts the codec name in sub.txt and I create the variable codecs to store this value.

    


    Then I need to determine the appropriate container [extension] for the subtitle - here I changed my code from what I posted earlier :

    


    if !codecs! == mov_text set codecs1=srt
if !codecs! == subrip set codecs1=srt
if !codecs! == ass set codecs1=ass
if !codecs! == webvtt set codecs1=vtt
if !codecs! == ttml set codecs1=ttml
if !codecs! == dvb_subtitle set codecs1=dvbsub
if !codecs! == dvd_subtitle set codecs1=dvdsub
if !codecs! == hdmv_pgs_subtitle setcodecs1=sup
if !codecs! == xsub set codecs1=xsub


    


    Then I demux [extract] the subtitle using ffmpeg :

    


    c:\ffmpeg\bin\ffmpeg -i "%~dpnx1" -an -vn -c:s "!codecs!" "%~n1_d."!codecs1!"


    


    This is working, except I have an extra iteration, my output is :

    


    Mediafile: C:\Users\UNOIT\Desktop\Tears of Steel_2sub.mkv
subtile: Tears of Steel_2sub_d.srt
subtile: Tears of Steel_2sub_d.ass
subtile: Tears of Steel_2sub_d.ass
File 'Tears of Steel_2sub_d.ass' already exists. Overwrite? [y/N]


    


    And if the media file has only one subtitle, my ffmpeg output is :

    


    Mediafile: C:\Users\UNOIT\Desktop\_Jan2024-Media\mkv\Tears of Steel_ass.mkv
subtile: Tears of Steel_ass_d.ass
subtile: Tears of Steel_ass_d.ass
File 'Tears of Steel_ass_d.ass' already exists. Overwrite? [y/N]
subtile: Tears of Steel_ass_d.ass
File 'Tears of Steel_ass_d.ass' already exists. Overwrite? [y/N]


    


    I can choose not to overwrite the file - but obviously there is a problem with my iterative loop - maybe a subroutine would work

    


    Here is the batch file :

    


    ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
set "arg=codec_name"
set "arg1=codec_name"
set "arg2=codec_name"
echo Mediafile: %~dpnx1
C:\ffmpeg\bin\ffprobe -v quiet -loglevel error -select_streams s -show_entries stream=index:stream_tags=language -of csv=p=0 -i "%~dpnx1" >ns.txt
set "cmd=findstr /R /N "^^" ns.txt | find /C ":""
for /f %%a in ('!cmd!') do set nums=%%a
set /A nums=%nums%-1
FOR %%i in (0,1,%nums%) DO (
    C:\ffmpeg\bin\ffprobe.exe -v quiet -select_streams s:%%i -show_entries stream=%arg% -of default=noprint_wrappers=1:nokey=1 -i "%~dpnx1" >sub%%i.txt
    set /p codecs=code>

    


  • How to do this in batch-file for multiple files video and audio with ffmpeg ?

    11 août 2023, par alexdo

    Can someone help me creating a for loop for mutiple video files and audio in directory structure ?

    


    @ECHO OFF
Setlocal EnableDelayedExpansion
set INPUT=D:\Shorts\code\INPUT
set OUTPUT=D:\Shorts\code\OUTPUT

:: encode video:

for %%a in ("%INPUT%\*.*") DO ffmpeg -i "%%a" -i music.mp3 -c:v copy -map 0:v -map 1:a -map_metadata -1 -y -preset superfast "%output%\%%~na.mp4"

pause


    


    enter image description here

    


    This works good for one audio, but I'm lost how to do this in batch file for multiple files ramdom audio.

    


  • avcodec/nvenc : surface allocation reduction

    25 avril 2017, par Ben Chang
    avcodec/nvenc : surface allocation reduction
    

    This patch aims to reduce the number of input/output surfaces
    NVENC allocates per session. Previous default sets allocated surfaces to 32
    (unless there is user specified param or lookahead involved). Having large
    number of surfaces consumes extra video memory (esp for higher resolution
    encoding). The patch changes the surfaces calculation for default, B-frames,
    lookahead scenario respectively.

    The other change involves surface selection. Previously, if a session
    allocates x surfaces, only x-1 surfaces are used (due to combination
    of output delay and lock toggle logic). To prevent unused surfaces,
    changing surface rotation to using predefined fifo.

    Signed-off-by : Timo Rothenpieler <timo@rothenpieler.org>

    • [DH] libavcodec/nvenc.c
    • [DH] libavcodec/nvenc.h
    • [DH] libavcodec/nvenc_h264.c
    • [DH] libavcodec/nvenc_hevc.c