Recherche avancée

Médias (91)

Autres articles (41)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (7860)

  • avcodec/cbs_h266 : check subpicture slices number

    23 novembre 2024, par Nuo Mi
    avcodec/cbs_h266 : check subpicture slices number
    

    According to section 6.3.3, 'Spatial or component-wise partitionings,'
    Subpictures must cover the entire picture.
    Therefore, the total number of subpicture slices should equal the number of picture slices

    Co-authored-by : Frank Plowman <post@frankplowman.com>

    • [DH] libavcodec/cbs_h266_syntax_template.c
  • lavc/vvc : Check slice structure

    10 janvier, par Frank Plowman
    lavc/vvc : Check slice structure
    

    The criteria for slice structure validity is similar to that of
    subpicture structure validity that we saw not too long ago [1].
    The relationship between tiles and slices must satisfy the following
    properties :

    * Exhaustivity. All tiles in a picture must belong to a slice. The
    tiles cover the picture, so this implies the slices must cover the
    picture.
    * Mutual exclusivity. No tile may belong to more than one slice, i.e.
    slices may not overlap.

    In most cases these properties are guaranteed by the syntax. There is
    one noticable exception however : when pps_tile_idx_delta_present_flag is
    equal to one, each slice is associated with a syntax element
    pps_tile_idx_delta_val[i] which "specifies the difference between the
    tile index of the tile containing the first CTU in the ( i + 1 )-th
    rectangular slice and the tile index of the tile containing the first
    CTU in the i-th rectangular slice" [2]. When these syntax elements are
    present, the i-th slice can begin anywhere and the usual guarantees
    provided by the syntax are lost.

    The patch detects slice structures which violate either of the two
    properties above, and are therefore invalid, while building the
    slice map. Should the slice map be determined to be invalid, an
    AVERROR_INVALIDDATA is returned. This prevents issues including
    segmentation faults when trying to decode, invalid bitstreams.

    [1] : https://ffmpeg.org//pipermail/ffmpeg-devel/2024-October/334470.html
    [2] : H.266 (V3) Section 7.4.3.5, Picture parameter set RBSP semantics

    Signed-off-by : Frank Plowman <post@frankplowman.com>

    • [DH] libavcodec/vvc/ps.c
  • Why doesn't seem to be able to send an audio file with FRONT_COVER on the Pytelegrambotapi

    27 décembre 2024, par exorik

    In general the problem is that the audio file is sent to a file without a picture. I first thought that the problem is that the picture is installed on the wrong version of id3, and tried four methods of installation

    &#xA;

      &#xA;
    1. via the ffmpeg command = [ “ffmpeg”, “-i”, file_path, “-i”, cover_path, “-map”, “0”, “-map”, “1”, “-c:a”, “copy”, “-c:v”, “mjpeg”, “-id3v2_version”, “3“,”-y”, output_file, ]subprocess.run(command, check=True)

      &#xA;

    2. &#xA;

    3. via eyed3, audiofile.tag.images.set(&#xA;eyed3.id3.frames.ImageFrame.FRONT_COVER,&#xA;cover_data,&#xA;“` image/jpeg,&#xA;)

      &#xA;

    4. &#xA;

    5. through the mutagen library, tried setting audio.add(&#xA;APIC(&#xA;encoding=3,&#xA;mime=“image/jpeg”,&#xA;type=3,&#xA;desc=“Cover”,&#xA;data=open(saved_photo, “rb”).read(),&#xA;)&#xA;)&#xA;At this stage I realized that the problem is not in the correct id3 tag setting, but in the method through which the audio file is sent. because if I opened it manually and sent it, the cover was there.&#xA;But I also tried installing the tag. second version. through the eyed3 library, but that also didn't result in the audio file with the cover art being sent to telegram.

      &#xA;

    6. &#xA;

    &#xA;

    audiofile w/ out cover

    &#xA;

    and the exact same audio file, only with the cover art. (it hasn't been altered in any way)

    &#xA;

    &#xA;&#xA;&#xA;user_states = {}&#xA;&#xA;&#xA;&#xA;&#xA;def save_audio(message):&#xA;    file_info = bot.get_file(message.audio.file_id)&#xA;    downloaded_file = bot.download_file(file_info.file_path)&#xA;&#xA;    user_dir = os.path.join("TEMP", str(message.chat.id), "albums")&#xA;    os.makedirs(user_dir, exist_ok=True)&#xA;&#xA;    original_file_name = (&#xA;        message.audio.file_name&#xA;        if message.audio.file_name&#xA;        else f"{message.audio.file_id}.mp3"&#xA;    )&#xA;&#xA;    file_path = os.path.join(user_dir, original_file_name)&#xA;&#xA;    if message.chat.id not in user_states:&#xA;        user_states[message.chat.id] = {"files": [], "stage": None}&#xA;&#xA;    with open(file_path, "wb") as f:&#xA;        f.write(downloaded_file)&#xA;&#xA;    user_states[message.chat.id]["files"].append(file_path)&#xA;&#xA;    return file_path&#xA;&#xA;&#xA;def clear_metadata_for_file(file_path, user_id):&#xA;    clear_metadata = settings.get(str(user_id), {}).get("clear", True)&#xA;&#xA;    if clear_metadata:&#xA;        temp_file_path = f"{file_path}.temp.mp3"&#xA;        command = [&#xA;            "ffmpeg",&#xA;            "-i",&#xA;            file_path,&#xA;            "-map_metadata",&#xA;            "-1",&#xA;            "-c:a",&#xA;            "copy",&#xA;            "-y",&#xA;            temp_file_path,&#xA;        ]&#xA;        subprocess.run(command, check=True)&#xA;        os.replace(temp_file_path, file_path)&#xA;&#xA;        audio_file = eyed3.load(file_path)&#xA;        if audio_file.tag is not None:&#xA;            audio_file.tag.clear()&#xA;        audio_file.tag.save()&#xA;&#xA;    else:&#xA;        return file_path&#xA;&#xA;&#xA;def send_files(message):&#xA;    chat_id = message.chat.id&#xA;    if chat_id not in user_states or "files" not in user_states[chat_id]:&#xA;        return "No files found"&#xA;&#xA;    for file_path in user_states[chat_id]["files"]:&#xA;        try:&#xA;            with open(file_path, "rb") as f:&#xA;                bot.send_audio(chat_id, f)&#xA;        except Exception as e:&#xA;            return e&#xA;&#xA;&#xA;&#xA;@bot.message_handler(content_types=["photo"])&#xA;def handle_cover(message):&#xA;&#xA;    if message.content_type == "photo":&#xA;        try:&#xA;&#xA;            saved_photo = save_photo(message)&#xA;&#xA;&#xA;            for file_path in user_states[message.chat.id]["files"]:&#xA;&#xA;                audio = ID3(file_path)&#xA;                audio.add(&#xA;                    APIC(&#xA;                        encoding=3,&#xA;                        mime="image/jpeg",&#xA;                        type=3,&#xA;                        desc="Cover",&#xA;                        data=open(saved_photo, "rb").read(),&#xA;                    )&#xA;                )&#xA;                audio.save(file_path)&#xA;                with open(saved_photo, "rb") as image_file:&#xA;                    image_data = image_file.read()&#xA;&#xA;                audiofile = eyed3.load(file_path)&#xA;&#xA;                if audiofile.tag is None:&#xA;                    audiofile.initTag(version=(2, 3, 0))&#xA;&#xA;                audiofile.tag.images.set(&#xA;                    3, image_data, "image/jpeg", description="Cover"&#xA;                )&#xA;                audiofile.tag.save(version=(2, 3, 0))&#xA;&#xA;            send_files(message)&#xA;&#xA;        except Exception as e:&#xA;            return&#xA;&#xA;bot.infinity_polling()&#xA;&#xA;

    &#xA;

    I was hoping to get some audio files with cover art, and I'm sure there's no problem with that. But for some reason, the file itself is sent visually without the cover art. I'd really appreciate it if you could help me out with this.

    &#xA;