Recherche avancée

Médias (1)

Mot : - Tags -/publicité

Autres articles (53)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • 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

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

Sur d’autres sites (9219)

  • 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>
  • OpusError while using ffmpeg library in discord.py

    18 avril 2021, par The Assignment Nerd

    While playing a local file or youtube audio, I get OpusError: invalid argument error

    &#xA;

    The play command looks like :

    &#xA;

    # bot.py&#xA;import os&#xA;import discord&#xA;from discord.ext import commands&#xA;from dotenv import load_dotenv&#xA;from models import *&#xA;from discord.voice_client import VoiceClient&#xA;import logging&#xA;from config import *&#xA;import youtube_dl&#xA;from youtube_dl import YoutubeDL&#xA;&#xA;@bot.command()&#xA;async def play(ctx):&#xA;    user=ctx.author&#xA;    voice_channel=user.voice.channel&#xA;    channel=None&#xA;    # only play music if user is in a voice channel&#xA;    if voice_channel:&#xA;        # grab user&#x27;s voice channel&#xA;        channel=voice_channel.name&#xA;        await ctx.send(&#x27;User is in channel: &#x27;&#x2B; channel)&#xA;        # create StreamPlayer&#xA;        vc = await voice_channel.connect()&#xA;        url="https://www.youtube.com/watch?v=AOeY-nDp7hI"&#xA;        YDL_OPTIONS = {&#x27;format&#x27;: &#x27;bestaudio&#x27;, &#x27;noplaylist&#x27;:&#x27;True&#x27;}&#xA;        FFMPEG_OPTIONS = {&#x27;before_options&#x27;: &#x27;-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5&#x27;, &#x27;options&#x27;: &#x27;-vn&#x27;}&#xA;        voice = discord.utils.get(bot.voice_clients, guild=ctx.guild)&#xA;        print(0)&#xA;        if not voice.is_playing():&#xA;            print("1")&#xA;            with YoutubeDL(YDL_OPTIONS) as ydl:&#xA;                info = ydl.extract_info(url, download=False)&#xA;                print(2)&#xA;            URL = info[&#x27;formats&#x27;][0][&#x27;url&#x27;]&#xA;            print(3)&#xA;            voice.play(discord.FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))&#xA;            print(4)&#xA;            voice.is_playing()&#xA;            print("Strated playing")&#xA;        else:&#xA;            await ctx.send("Already playing song")&#xA;            return&#xA;    else:&#xA;        await ctx.send(&#x27;User is not in a channel.&#x27;)&#xA;

    &#xA;

    My error :

    &#xA;

    0&#xA;1&#xA;[youtube] AOeY-nDp7hI: Downloading webpage&#xA;[youtube] Downloading just video AOeY-nDp7hI because of --no-playlist&#xA;2&#xA;3&#xA;Ignoring exception in command play:&#xA;Traceback (most recent call last):&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped&#xA;    ret = await coro(*args, **kwargs)&#xA;  File "/Users/mohit/programming/discord/area-51-helper/main.py", line 115, in play&#xA;    voice.play(discord.FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/discord/voice_client.py", line 564, in play&#xA;    self.encoder = opus.Encoder()&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 291, in __init__&#xA;    self.set_fec(True)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 326, in set_fec&#xA;    _lib.opus_encoder_ctl(self._state, CTL_SET_FEC, 1 if enabled else 0)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 92, in _err_lt&#xA;    raise OpusError(result)&#xA;discord.opus.OpusError: invalid argument&#xA;&#xA;The above exception was the direct cause of the following exception:&#xA;&#xA;Traceback (most recent call last):&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 939, in invoke&#xA;    await ctx.command.invoke(ctx)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 863, in invoke&#xA;    await injected(*ctx.args, **ctx.kwargs)&#xA;  File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 94, in wrapped&#xA;    raise CommandInvokeError(exc) from exc&#xA;discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OpusError: invalid argument&#xA;

    &#xA;

    I'm using these version

    &#xA;

    discord.py==1.0.1&#xA;ffmpeg==4.3.2&#xA;youtube_dl==2021.4.17&#xA;

    &#xA;

  • Non-monotonous DTS in output stream when concat videos using ffmpeg

    8 février 2018, par no name

    I have three videos which I want to concat together the problem it works fine for some videos but when I test a specific video it gives me an error and cause the resulting video to show in a strange way and everything is moving very fast in the video like I was forward up the video
    this the code I used to add the video together from a file this the out.txt

    file 'D:/Build/start.mp4'
    file 'D:/Build/a.mp4'
    file 'D:/Build/Song &amp; Lyrics/2f.mp4'

    the command i used with ffmpeg

    ffmpeg -f concat -safe 0 -i out.txt -c copy -y go.mp4

    i faced this error

       [mov,mp4,m4a,3gp,3g2,mj2 @ 05c0dbc0] Auto-inserting h264_mp4toannexb bitstream filter
    Input #0, concat, from 'out.txt':
     Duration: N/A, start: 0.000000, bitrate: 280 kb/s
       Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 155 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
       Metadata:
         creation_time   : 2018-02-08T13:25:49.000000Z
         handler_name    : ISO Media file produced by Google Inc. Created on: 02/08/2018.
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s
       Metadata:
         creation_time   : 2018-02-08T13:25:49.000000Z
         handler_name    : ISO Media file produced by Google Inc. Created on: 02/08/2018.
    Output #0, mp4, to 'go.mp4':
     Metadata:
       encoder         : Lavf58.7.100
       Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 155 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc
       Metadata:
         creation_time   : 2018-02-08T13:25:49.000000Z
         handler_name    : ISO Media file produced by Google Inc. Created on: 02/08/2018.
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s
       Metadata:
         creation_time   : 2018-02-08T13:25:49.000000Z
         handler_name    : ISO Media file produced by Google Inc. Created on: 02/08/2018.
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    [mov,mp4,m4a,3gp,3g2,mj2 @ 05c38840] Auto-inserting h264_mp4toannexb bitstream filter
    [mp4 @ 061b8f00] Non-monotonous DTS in output stream 0:0; previous: 624624, current: 88735; changing to 624625. This may result in incorrect timestamps in the output file.
    [mp4 @ 061b8f00] Non-monotonous DTS in output stream 0:0; previous: 624625, current: 89247; changing to 624626. This may result in incorrect timestamps in the output file.
    [mp4 @ 061b8f00] Non-monotonous DTS in output stream 0:0; previous: 624626, current: 89759; changing to 624627. This may result in incorrect timestamps in the output file.
    .....

    [mov,mp4,m4a,3gp,3g2,mj2 @ 05c38840] Auto-inserting h264_mp4toannexb   bitstream filtereed=69.7x
    frame= 8991 fps=2903 q=-1.0 Lsize=    8378kB time=00:05:58.22 bitrate= 191.6kbits/s speed= 116x
    video:2469kB audio:5625kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.500685%

    so what the problem make this error. the problem appear when i use this new start.mp4 to be merge with my videos i tried on other ones and it worked fine.
    Update
    i tested to convert the videos to MTS formate then concate them as an answer to similar problem but the problem is when i convert the mp4 videos to this formate the size of the file be too large from 6 MB to 42 MB !! so if there is a better answer. or a way to make the file still same size or less
    the linke of the answer is here but it worked fine
    Thanks in advance