Recherche avancée

Médias (0)

Mot : - Tags -/presse-papier

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

Autres articles (38)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Submit enhancements and plugins

    13 avril 2011

    If you have developed a new extension to add one or more useful features to MediaSPIP, let us know and its integration into the core MedisSPIP functionality will be considered.
    You can use the development discussion list to request for help with creating a plugin. As MediaSPIP is based on SPIP - or you can use the SPIP discussion list SPIP-Zone.

Sur d’autres sites (6992)

  • Convert multible files with threading ffmpeg in Python

    21 mars 2020, par Florian

    I’m trying to convert mp3 files to m4a. The files are in different folders like MainFolder(folder1, folder2,...)

    It works already but is very slow because it is converting file by file.

    import os
    import sys

    path = "/Users/flo/Desktop/test"

    for root, dir, files in os.walk(path):
       dir.sort()
       files.sort()

       for file in files:
           if file.find('.mp3') != -1:
               os.system('ffmpeg -i ' +'"' +root +'/' +file +'" ' +'-c:v copy -c:a libfdk_aac -b:a 300k '  +'"' +root +'/' +file[:-4] +'.m4b' +'"')

    Now I would like to implement multitasking.

    import os
    import sys
    import threading
    import queue

    path = "/Users/flo/Desktop/test"
    def convert(file):
       if file.find('.mp3') != -1:
           os.system('ffmpeg -i ' +'"' +root +'/' +file +'" ' +'-c:v copy -c:a libfdk_aac -b:a 300k '  +'"' +root +'/' +file[:-4] +'.m4b' +'"')

    for root, dir, files in os.walk(path):
       dir.sort()
       files.sort()

       q = queue.Queue
       threads = [threading.Thread(target=convert(file)) for file in files]
       for t in threads:
           t.start()

       for file in files:
           q.put(file)

       for file in files:
           q.put('stop')

       q.join()

       for t in threads:
           t.join()

    But I got the error message :

    File "/var/folders/r6/z5f_jcf139b8fh2n8m4lznlm0000gn/T/atom_script_tempfiles/30127c90-6b13-11ea-af8a-432a34b059ac", line 31
       threads = [threading.Thread(target=convert(file)) for file in files]
       ^
    IndentationError: unexpected indent
    [Finished in 0.028s]
  • ffmpeg jpg batch script with timestamp

    3 juillet 2021, par Chris

    I currently have this batch script using ffmpeg to scale images and place in a new location with the same folder structure. How do i include the timestamp from the original jpg file in the filename of the new scaled jpg file ?

    


    This gives files named m-H-S_IMG_0305

    


    @echo off &setlocal
set /a nfile=0
echo Copying directory structure from %1 to %2 ...
xcopy /T "%~1" "%~2"
REM walk directory structure and convert each file in quiet mode
set "sourcefolder=%~1"
set "targetfolder=%~2"
for /R "%sourcefolder%" %%a in (*.JPG) do (
    echo converting "%%~nxa" ...
    set "sourcefile=%%~fa"
    set "sourcepath=%%~dpa"
    set "targetfile=%%~na.JPG"
    setlocal enabledelayedexpansion
    set "targetfolder=%targetfolder%!sourcepath:%sourcefolder%=!"
    ffmpeg -v quiet -i "!sourcefile!" -vf scale=256x256 -q:v 1 -strftime 1 "!targetfolder!%Y-%m-%d_%H-%M-%S_!targetfile!"
    endlocal
    set /A nfile+=1
)
echo Done! Converted %nfile% file(s)


    


    Working version for file modify date :

    


    @echo off &setlocal
set /a nfile=0
echo Copying directory structure from %1 to %2 ...
xcopy /T "%~1" "%~2"
REM walk directory structure and convert each file in quiet mode
set "sourcefolder=%~1"
set "targetfolder=%~2"
for /R "%sourcefolder%" %%a in (*.JPG) do (
    echo converting "%%~nxa" ...
    echo which has a timestamp of "%%~ta" ...
    set "sourcefile=%%~fa"
    set "sourcepath=%%~dpa"
    set "targetfile=%%~na.JPG"
    set "timestamp=%%~ta"
    setlocal enabledelayedexpansion
    set "timestamp=!timestamp: =_!"
    set "timestamp=!timestamp::=-!"
    set "timestamp=!timestamp:/=-!"
    set "targetfolder=%targetfolder%!sourcepath:%sourcefolder%=!"
    ffmpeg -v quiet -i "!sourcefile!" -vf scale=256x256 -q:v 1 "!targetfolder!!timestamp!_!targetfile!"
    endlocal
    set /A nfile+=1
)
echo Done! Converted %nfile% file(s)


    


    File Creation date option attempt using exiftool (This works but it stops frequently so there is an error somewhere) :

    


    @echo off &setlocal
set /a nfile=0
echo Copying directory structure from %1 to %2 ...
xcopy /T "%~1" "%~2"
REM walk directory structure and convert each file in quiet mode
set "sourcefolder=%~1"
set "targetfolder=%~2"
for /R "%sourcefolder%" %%a in (*.JPG) do (
    echo converting "%%~nxa" ...
    echo which has a timestamp of "%%~ta" ...
    set "sourcefile=%%~fa"
    set "sourcepath=%%~dpa"
    set "targetfile=%%~na.JPG"
    set "timestamp=('exiftool -d %%Y%%m%%d_%%H%%M%%S -CreateDate %%~a')"
    for /f "tokens=1,2 delims=x" %%a in ('exiftool -T -d %%Y%%m%%d_%%H%%M%%S -CreateDate "%%a"') do (
        set "timestamp=%%a"
    )
    setlocal enabledelayedexpansion
    set "targetfolder=%targetfolder%!sourcepath:%sourcefolder%=!"
    ffmpeg -v quiet -i "!sourcefile!" -vf scale=256x256 -q:v 1 "!targetfolder!!timestamp!_!targetfile!"
    endlocal
    set /A nfile+=1
)
echo Done! Converted %nfile% file(s)


    


  • Video stream analysis on the fly - advise ?

    8 avril 2016, par jakkolwiek

    I’m planning to develop a simple solution that would able me to perform a very basic video stream analysis on the fly. I’ve never done anything like that before, hence the very general and open question. The main focus is on checking if the stream is going without problems like - freeze frames, black screens and if the audio is there. Sync is out of scope. I read about open libraries like OpenCV and Xuggler, but they seem more complex than for my needs. FFmpeg is able to detect black screens, but not on the fly.

    Is there any other open lib I could look into ? Could you advise me anything ? I’m thinking about using Java or Python. Or maybe both. Efficiency of the solution is out of scope, I’m focusing now only on freeze frames and black screens detection.

    Any advise is welcome !

    Best regards,
    Peter