Recherche avancée

Médias (2)

Mot : - Tags -/plugins

Autres articles (97)

  • 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

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (6414)

  • How to fix "Unable to find a suitable output format for '/'" error in ffmpeg running with PHP [on hold]

    4 avril 2019, par C.Pietro

    I want to compress video on the server after the upload.
    I installed correctly ffmpeg and when i run from the command line

    ffmpeg -i input.mp4 -vcodec libx265 -crf 28 -vcodec h264 -acodec aac -strict -2 output.mp4

    it works !

    But if i run the same command from PHP with exec,

    class VideoCompress {
       function compress($path, $name){
           if (`which ffmpeg`) {
               exec("cd \"$path\";ffmpeg -i \"$name\" -vcodec libx265 -crf 28 -vcodec h264 -acodec aac -strict -2 \"bk_$name\" / 2>&1", $o);
               print_r8($o);
           }
       }
    }

    it fails and return this error

    Array
    (
       [0] => ffmpeg version N-48518-g27c94c57dc-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers
       [1] =>   built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
       [2] =>   configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
       [3] =>   libavutil      56. 26.100 / 56. 26.100
       [4] =>   libavcodec     58. 48.100 / 58. 48.100
       [5] =>   libavformat    58. 26.101 / 58. 26.101
       [6] =>   libavdevice    58.  7.100 / 58.  7.100
       [7] =>   libavfilter     7. 48.100 /  7. 48.100
       [8] =>   libswscale      5.  4.100 /  5.  4.100
       [9] =>   libswresample   3.  4.100 /  3.  4.100
       [10] =>   libpostproc    55.  4.100 / 55.  4.100
       [11] => Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'WebHD_720p.mp4':
       [12] =>   Metadata:
       [13] =>     major_brand     : isom
       [14] =>     minor_version   : 512
       [15] =>     compatible_brands: isomiso2avc1mp41
       [16] =>     encoder         : Lavf57.71.100
       [17] =>   Duration: 00:03:23.22, start: 0.000000, bitrate: 1890 kb/s
       [18] =>     Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 9:10 DAR 8:5], 1754 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
       [19] =>     Metadata:
       [20] =>       handler_name    : VideoHandler
       [21] =>     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
       [22] =>     Metadata:
       [23] =>       handler_name    : SoundHandler
       [24] => [NULL @ 0x59fb100] Unable to find a suitable output format for '/'
       [25] => /: Invalid argument
    )

    Any idea on how can i fix it ?

  • "Convert regions extracted from wav audio file into Flac audio file " python using FFMPAG in Django

    9 avril 2019, par maryam mehboob

    Regions extracted from wav audio file have "Invalid duration specification for ss"
    For Example in my case duration is in this format

    [(0.006000000000000005, 1.03), (2.0540000000000003, 4.870000000000003)]

    This is for converting regions into Flac format.

        class FLACConverter(object):
            # pylint: disable=too-few-public-methods
       """
            Class for converting a region of an input audio or video file into a FLAC audio file
       """

        def __init__(self, source_path, include_before=0.25, include_after=0.25):
           self.source_path = source_path
           self.include_before = include_before
           self.include_after = include_after


        def __call__(self, region):
           try:
               print("regions to convert in flac:{}".format(region))
               start = region
               end = region
             #  start = max(0, start - self.include_before)
               start = list(map(lambda x: tuple(max(0, y - self.include_before) for y in x), start))
               end = list(map(lambda x: tuple(y + self.include_after for y in x), end))
               temp = tempfile.NamedTemporaryFile(suffix='.flac', delete=False)
               command = ["ffmpeg", "-ss", str(start), "-t", str([tuple(x-y for x, y in zip(x1, x2)) for (x1, x2) in zip(end, start)]),
                          "-y", "-i", self.source_path,
                          "-loglevel", "error", temp.name]
               use_shell = True if os.name == "nt" else False
               subprocess.check_output(command)
               print(temp.name)
               #subprocess.check_output(command, stdin=open(os.devnull), shell=use_shell)
               read_data = temp.read()
               temp.close()
               os.unlink(temp.name)
               print("read_data :{}".format(read_data))
               print("temp :{}".format(temp.name))

               return read_data

           except KeyboardInterrupt:
               return None

    I expect the output of /var/folders/p1/6ttydjfx2sq9zl4cnmjxgjh40000gp/T/tmpwz5n4fnv.flac but it returns an error

    CalledProcessError at /

    Command '['ffmpeg', '-ss', '[(0.006000000000000005, 1.03), (2.0540000000000003, 4.870000000000003)]', '-t', '[(0.5, 0.5), (0.5, 0.5)]', '-y', '-i', '/var/folders/p1/6ttydjfx2sq9zl4cnmjxgjh40000gp/T/tmpuyi5spat.wav', '-loglevel', 'error', '/var/folders/p1/6ttydjfx2sq9zl4cnmjxgjh40000gp/T/tmp0vdewoyd.flac']' returned non-zero exit status 1.```
  • ffmpeg m4a/m4b/mp4 output file's "Time" value is incorrect when read into iTunes

    2 juin 2019, par PistoletPierre

    I’m using ffmpeg to convert audiobooks to m4a/m4b/mp4. All seems to work until trying to play them in iTunes. It plays in VLC, QuickTime, and MacOS’s Quicklook without issue.

    "So why are you posting here ? This isn’t an iTunes forum."

    I’m hoping this is iTunes being picky about file formats and that I can add some magic argument to my ffmpeg command and have it spit out something that iTunes can read.

    Below is the bash function I’m using to do the conversion. I’ve tried m4a/mp4/m4b as values for TEMP_FILE_EXTENSION and tried opening the intermediate file as well. It’s always the same corrupted "Time" value when you put it in iTunes.

    dedrm_audible () {
     # Check for AtomicParsley, ffmpeg, and 3 args
     if (! type AtomicParsley >/dev/null 2>/dev/null) || (! type ffmpeg >/dev/null 2>/dev/null) || [ ! $# -eq 3 ]; then
       echo "Usage:"
       echo "    dedrm_audible <path to="to"> <activation bytes="bytes"> <path to="to" output="output" file="file">"
       echo "    Note: AtomicParsley and ffmpeg must be in PATH variable"
       return
     fi
     local ORIGINAL_PWD="$(pwd)"
     local TEMP_DIR="/tmp/audible"
     local AUDIOBOOK_FILE="$1"
     local ACTIVATION_BYTES="$2"
     local OUTPUT_FILE="$3"
     local FULL_AUDIOBOOK_PATH="$(realpath "${AUDIOBOOK_FILE}")"
     local OUTPUT_PATH="$(realpath "${OUTPUT_FILE}")"
     local TEMP_FILE_EXTENSION="m4a"

     mkdir -p "${TEMP_DIR}"
     cd "${TEMP_DIR}"

     # Extract the book cover
     ffmpeg -activation_bytes "${ACTIVATION_BYTES}" -i "${FULL_AUDIOBOOK_PATH}" -vcodec copy artwork.png
     # Convert the audio
     ffmpeg -activation_bytes "${ACTIVATION_BYTES}" -i "${FULL_AUDIOBOOK_PATH}" -vn -c:a copy -v debug output.${TEMP_FILE_EXTENSION}
     # Add the cover to the new file
     AtomicParsley output.${TEMP_FILE_EXTENSION} --artwork artwork.png --overWrite

     # Put it where you want it and clean up
     cp output.${TEMP_FILE_EXTENSION} "${OUTPUT_PATH}"
     rm artwork.png
     rm output.${TEMP_FILE_EXTENSION}
     cd "${ORIGINAL_PWD}"
    }
    </path></activation></path>

    It goes off without a hitch. The new file is there waiting for me, with all the metadata including the cover when I do a "Get Info" or "Quick look" on it (I’m on MacOS). But when opening it and trying to play it in iTunes, the "time" field is way off and it immediately skips to the next song/audiobook in the queue.

    Attempts to convert it within iTunes fail immediately - too quickly to see what’s happening. The errors in the console simply say "Assert failure :" (with nothing after the colon).

    edit : Tommy answered the question. Here’s a working bash function :

    dedrm_audible () {
     # Check for AtomicParsley, ffmpeg, and 3 args
     if (! type AtomicParsley >/dev/null 2>/dev/null) || (! type ffmpeg >/dev/null 2>/dev/null) || [ ! $# -eq 3 ]; then
       echo "Usage:"
       echo "    dedrm_audible <path to="to"> <activation bytes="bytes"> <path to="to" output="output" file="file">"
       echo "    Note: AtomicParsley and ffmpeg must be in PATH variable"
       return
     fi
     local ORIGINAL_PWD="$(pwd)"
     local TEMP_DIR="/tmp/audible"
     local AUDIOBOOK_FILE="$1"
     local ACTIVATION_BYTES="$2"
     local OUTPUT_FILE="$3"
     # Alternative to realpath (since I read somewhere that it's not there by default on some systems): OUTPUT_PATH="$( cd "$( dirname "$OUTPUT_FILE" )" &amp;&amp; pwd )"
     local FULL_AUDIOBOOK_PATH="$(realpath "${AUDIOBOOK_FILE}")"
     local AUDIOBOOK_NAME="${$(basename "${FULL_AUDIOBOOK_PATH}")%.aax}.m4a"
     local OUTPUT_PATH="$(realpath "${OUTPUT_FILE}")"
     local TEMP_FILE_EXTENSION="m4a"

     mkdir -p "${TEMP_DIR}"
     cd "${TEMP_DIR}"

     cp "${FULL_AUDIOBOOK_PATH}" "${AUDIOBOOK_NAME}"

     # Extract the book cover
     ffmpeg -activation_bytes "${ACTIVATION_BYTES}" -i "${AUDIOBOOK_NAME}" -vcodec copy artwork.png
     # Convert the audio
     ffmpeg -activation_bytes "${ACTIVATION_BYTES}" -i "${AUDIOBOOK_NAME}" -vn -c:a copy -v debug output.${TEMP_FILE_EXTENSION}
     # Add the cover to the new file
     AtomicParsley output.${TEMP_FILE_EXTENSION} --artwork artwork.png --overWrite

     # Put it where you want it and clean up
     mv output.${TEMP_FILE_EXTENSION} "${OUTPUT_PATH}"
     rm artwork.png
     rm "${AUDIOBOOK_NAME}"
     cd "${ORIGINAL_PWD}"
    }
    </path></activation></path>