
Recherche avancée
Médias (91)
-
Les Miserables
9 décembre 2019, par
Mis à jour : Décembre 2019
Langue : français
Type : Textuel
-
VideoHandle
8 novembre 2019, par
Mis à jour : Novembre 2019
Langue : français
Type : Video
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
-
Un test - mauritanie
3 avril 2014, par
Mis à jour : Avril 2014
Langue : français
Type : Textuel
-
Pourquoi Obama lit il mes mails ?
4 février 2014, par
Mis à jour : Février 2014
Langue : français
-
IMG 0222
6 octobre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Image
Autres articles (72)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Le profil des utilisateurs
12 avril 2011, parChaque 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 (...)
Sur d’autres sites (5316)
-
Methods : Adding Smart Quotes to stripHTML's punctuation removal
14 janvier 2014, par jamierytlewskiMethods : Adding Smart Quotes to stripHTML's punctuation removal
Addresses an issue with the word count where smart quotes were not
removed, but the word count counted the words as the punctuation was not
removed.Closes gh-811
-
ffmpeg get the audio stream from mp4 and send it to speech recognition
12 juillet 2013, par user1896859I have few .mp4 video files in which at the start of each video file there is a word, I want to load these files get the audio check what is the spoken word and rename the file accordingly.
Currently what i am doing is, converting all the mp4 files to wav and then sending the to speech recognition and then doing the renaming stuff.
Is there a way to cut short the "converting to wav" part out and directly send the mp4 audio stream to speech recognition ??
Thanks,
-
Windows batch - unable to assign a variable within an iterative for loop
17 janvier 2024, par user23254772I 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 inffprobe
the first subtitle iss:0
, so I subtract1
fromnums


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 variablecodecs
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>