Recherche avancée

Médias (0)

Mot : - Tags -/api

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

Autres articles (22)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (6247)

  • constructing an ffmpeg script for use in Xcode/swift project

    21 octobre 2019, par NCrusher

    I’m going back to the drawing board with this post because I’ve been through so much trial and error over the last day with this issue that the information I posted earlier is no longer relevant.

    I’ve only been learning both Swift and FFmpeg for a few weeks, and I’ve just exhausted my ability to troubleshoot this.

    I’m maybe 90% certain this is a problem with my ffmpeg script, rather than with the Swift component. But I think it’s complicated by what characters need special formatting in Swift (particularly mathematical operatives.)

    I started off using a method in Xcode modeled after this post, which Xcode actually managed to guide me through updating for current versions of swift without breaking. Which left me with this :

    func ffmpegConvert(inputPath: String, filters: String, outputPath: String) {
       guard let launchPath = Bundle.main.path(forResource: "ffmpeg", ofType: "") else { return }
       do {
           let convertTask: Process = Process()
           convertTask.launchPath = launchPath
           convertTask.arguments = [
               "-i", inputPath,
               filters,
               outputPath
           ]
           convertTask.standardInput = FileHandle.nullDevice
           convertTask.launch()
           convertTask.waitUntilExit()
       }
    }

    I call this function when I click the "Start Conversion" button on my app. Like I said, that part seems to work fine. The problem is either in the way ffmpeg is being called by the app, or with the construction of the strings in my arguments array.

    The inputFilePath and outputFilePath strings are self-explanatory. Both of them are perfectly acceptably formatted filepath strings.

    The filters is a little tougher. My app has five conversion options and a different filter set for each one. One is as simple as -c copy and the most complex is -c:a libmp3lame -ac 1 -ar 22050 -q:a 9 (I’m working with audiobooks so I don’t need a lot of complexity in my arguments.

    The app appears to be launching ffmpeg perfectly. But the console keeps giving me errors. And the errors keep changing depending on what I try. Here’s what I’ve been through so far :

    var inputFilePath = "/Volumes/CSW External/ffmpeg/diamonds.aac"
    var ffmpegFilters = "-c copy"
    var outputFilePath = "/Volumes/CSW External/ffmpeg/diamonds.m4b"

    Result :

    Unrecognized option ’c copy’.
    Error splitting the argument list : Option not found

    Next attempt, I tried var ffmpegFilters = "--c copy". Result was the same error.

    Then I tried var ffmpegFilters = " -c copy" and it actually read the metadata from my file before throwing a different error at me :

    Unable to find a suitable output format for ’ -c copy’ -c copy :
    Invalid argument

    I’m assuming that the fact that it read the metadata before throwing a different error at me means I made...some form of progress ?

    I spent a few hours researching that particular error and why people might be getting it and couldn’t find a situation that was analogous to what I was trying to do. Mostly people were encountering it from the command line and/or other operating systems. So no help there.

    At that point, since I was just throwing things at the wall to see what might stick, I decided to throw the whole command, inputPath / ffMpegFilters / outputPath into a single string to see if I could make that work (under the logic that if it did, I could narrow the cause of my trouble down to the way the separate strings are being constructed by XCode.)

    I tried it both with the whitespace in the filepath and with the whitespace escaped out (using double \ as required by Swift.) The ffmpeg log came displayed a perfectly valid

    Doing so took me back to the first error I got :

    Unrecognized option ’-c copy’.
    Error splitting the argument list : Option not found

    So then I started researching THAT error. Some of the discussions I came across indicated that the problem was that the arguments couldn’t all be in a single string, they needed to be split up and put in an array. Which I could see for a longer argument, but -c copy shouldn’t need that.

    But I decided to give it a go. Formerly my method for constructing the string of arguments would have looked like this

    func conversionSelection() {
       if inputFileUrl != nil {
           let conversionChoice = conversionOptionsPopup.indexOfSelectedItem
           switch conversionChoice {
               case 1 :
                   outputExtension = ".mp3"
                   ffmpegFilters = "-c:a libmp3lame -ac 1 -ar 22050 -q:a 9"
               (...case 2, 3, 4, default, etc)
           }
       }
    }

    Now it looks more like this :

    func conversionSelection() {
       if inputFileUrl != nil {
           let conversionChoice = conversionOptionsPopup.indexOfSelectedItem
           switch conversionChoice {
               case 1 :
                   outputExtension = ".mp3"
                   ffmpegCodec = "-c:a libmp3lame"
                   ffmpegChannels = "-ac 1"
                   ffmpegSampling = "-ar 22050"
                   ffmpegBitrate = "-q:a 9"
               (case 2, case 3, case 4, default, etc)
           }
       }
    }

    Unfortunately, this just brought me full circle. If I try to use -c:a libmp3lame or --c:a libmp3lame I get the Error splitting the argument list: Option not found error. Interestingly, however, it gives the argument with relation to the ffmpegSampling argument, which is a slight difference.

    If I put a whitespace in front of it -c:a libmp3lame it will get far enough into the process to read the input file metadata, then I get this :

    Unable to find a suitable output format for ’ -c:a libmp3lame’ -c:a
    libmp3lame : Invalid argument

    I’m stumped. I thought this was going to be an easy fix, but I’ve been at it almost a full day with all the trial and error, and nothing is working, and I’ve exhausted my newbie understanding of both Swift and ffmpeg.

  • ffmpeg include issue - some functions are missing

    27 septembre 2019, par Thomas Ayoub

    I try to follow and adapt this example to convert a video thanks to FFMPEG but some function seems to be missing like :

    int avcodec_open ( AVCodecContext * avctx, AVCodec * codec)    

    When I go in the doc to see where it come from, I find it in the file libavcodec/avcodec.h which is included in my program #include "libavcodec/avcodec.h" (in the top of my .h file).

    Given this, I don’t understand why Qt throw me this error :

    ../../Dev/Joker/libs/PhVideo/PhVideoEncoder.cpp:360:6: error: use of undeclared identifier 'avcodec_open'
       if (avcodec_open(c, codec) < 0) {
  • FFmpeg - Check if folder contains a matching filename with 2 different extensions and ignore both files. Process only filenames with 1 extension

    9 septembre 2019, par slyfox1186

    I need to batch convert all mkv files in a folder recursively to mp4.

    If a filename exists and matches both extensions, ignore both files and process only filenames that contain mkv, without matching mp4.

    Example : cat.mkv exists in folder with cat.mp4 = ignore both files

    Example : cat.mkv exists in folder and cat.mp4 does not = process cat.mkv to cat.mp4

    I have included a script that doesn’t work well. It processes all mkv files and mp4 files. The mp4 files throw an error as FFmpeg will not encode the same format in this manner over itself.

    As always thank you to anyone who might have a few ideas.

    UPDATE : I may have gotten it to work. I changed a few things from the original. If anyone has success or an idea to improve I’m all ears. Thanks.

    VERSION 2

    @ECHO ON
    SETLOCAL
    PROMPT $G
    COLOR 0A

    REM Set FFmpeg.exe location if not in system PATH already
    SET FF=C:\MAB\local64\bin-video\ffmpeg.exe

    REM Set MKV files root folder to recursively search
    SET "mkvPATH=C:\Encoding\1_Original\Test\"

    REM Change into mkvPATH DIR
    CD "C:\Encoding\1_Original\Test"

    REM Set temp file name
    SET TEMPFILE=convert_mkv.bat

    REM Create empty convert file
    COPY NUL "%TEMPFILE%" >NUL 2>&1

    REM ADD @ECHO OFF to top of blank convert_mkv.bat script
    ECHO @ECHO OFF >>"%TEMPFILE%"

    REM Recursively search MKV root folder
    FOR /R "%mkvPATH%" %%G IN (*.mkv *.mp4) DO (
       SET "GPATH=%%~fG"
       SET "GNAME=%%~nG"
       SETLOCAL ENABLEDELAYEDEXPANSION

       REM Ignore all files that have both
       REM extensions ".mkv" and ".mp4" in the file name
       IF "%%~nG.mkv"=="%%~nG.mkv" (
           IF NOT EXIST "%%~nG.mp4" (
               CALL :DO_FFmpeg "!GPATH!"
               IF "%%~nG.mkv"=="%%~nG.mkv" (
                   IF EXIST "%%~nG.mp4" (
                       ECHO(>>"%TEMPFILE%"
                   ) ELSE ENDLOCAL
               )
           )
       )
    )
    GOTO END

    REM CALL variables for use in FFmpeg's command line
    :DO_FFmpeg
    IF "%~1"=="" GOTO :END
    FOR %%I IN ("%~1") DO (
       SET "FOLDER=%%~dpI"
       SET "NAME=%%~nxI"
    )

    REM Export info to "%TEMPFILE% and RUN ffmpeg.exe's command line in the cmd.exe window
    ECHO %FF% -y -i "%~1" -ss 0 -t 300 -codec copy "%FOLDER%%~n1.mp4">>"%TEMPFILE%" && %FF% | %FF% -y -i "%~1" -ss 600 -t 30 -codec copy "%FOLDER%%~n1.mp4"

    :END
    PAUSE
    EXIT /B