Recherche avancée

Médias (1)

Mot : - Tags -/biographie

Autres articles (35)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

Sur d’autres sites (3640)

  • 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

    


      

    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)

      


    2. 


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

      


    4. 


    5. through the mutagen library, tried setting audio.add(
APIC(
encoding=3,
mime=“image/jpeg”,
type=3,
desc=“Cover”,
data=open(saved_photo, “rb”).read(),
)
)
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.
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.

      


    6. 


    


    audiofile w/ out cover

    


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

    


    


user_states = {}




def save_audio(message):
    file_info = bot.get_file(message.audio.file_id)
    downloaded_file = bot.download_file(file_info.file_path)

    user_dir = os.path.join("TEMP", str(message.chat.id), "albums")
    os.makedirs(user_dir, exist_ok=True)

    original_file_name = (
        message.audio.file_name
        if message.audio.file_name
        else f"{message.audio.file_id}.mp3"
    )

    file_path = os.path.join(user_dir, original_file_name)

    if message.chat.id not in user_states:
        user_states[message.chat.id] = {"files": [], "stage": None}

    with open(file_path, "wb") as f:
        f.write(downloaded_file)

    user_states[message.chat.id]["files"].append(file_path)

    return file_path


def clear_metadata_for_file(file_path, user_id):
    clear_metadata = settings.get(str(user_id), {}).get("clear", True)

    if clear_metadata:
        temp_file_path = f"{file_path}.temp.mp3"
        command = [
            "ffmpeg",
            "-i",
            file_path,
            "-map_metadata",
            "-1",
            "-c:a",
            "copy",
            "-y",
            temp_file_path,
        ]
        subprocess.run(command, check=True)
        os.replace(temp_file_path, file_path)

        audio_file = eyed3.load(file_path)
        if audio_file.tag is not None:
            audio_file.tag.clear()
        audio_file.tag.save()

    else:
        return file_path


def send_files(message):
    chat_id = message.chat.id
    if chat_id not in user_states or "files" not in user_states[chat_id]:
        return "No files found"

    for file_path in user_states[chat_id]["files"]:
        try:
            with open(file_path, "rb") as f:
                bot.send_audio(chat_id, f)
        except Exception as e:
            return e



@bot.message_handler(content_types=["photo"])
def handle_cover(message):

    if message.content_type == "photo":
        try:

            saved_photo = save_photo(message)


            for file_path in user_states[message.chat.id]["files"]:

                audio = ID3(file_path)
                audio.add(
                    APIC(
                        encoding=3,
                        mime="image/jpeg",
                        type=3,
                        desc="Cover",
                        data=open(saved_photo, "rb").read(),
                    )
                )
                audio.save(file_path)
                with open(saved_photo, "rb") as image_file:
                    image_data = image_file.read()

                audiofile = eyed3.load(file_path)

                if audiofile.tag is None:
                    audiofile.initTag(version=(2, 3, 0))

                audiofile.tag.images.set(
                    3, image_data, "image/jpeg", description="Cover"
                )
                audiofile.tag.save(version=(2, 3, 0))

            send_files(message)

        except Exception as e:
            return

bot.infinity_polling()



    


    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.

    


  • Revision b527c4dbb7 : Segment mode coding bug. There are now more than 16 possible modes so 5 bits re

    14 novembre 2012, par Paul Wilkins

    Changed Paths : Modify /vp9/common/seg_common.c Segment mode coding bug. There are now more than 16 possible modes so 5 bits required for segment mode feature. Note that it is likely that the mode feature and how it is coded will change but for now the 4 bits was a bug. Change-Id : (...)

  • Transmux video to .mp4 using FFmpeg (dref) ?

    30 octobre 2012, par vale4674

    There is a cool tool called MP4Box which uses FFmpeg.
    It has a nice feature to transmux .avi file to .mp4 drefed.

    .avi file size is 500MB

    .mp4 file size is 200kb

    In that .mp4 file are only indexes/timestamps which reference that .avi file.

    So the question is :

    Is this possible with only FFmpeg or this is a MP4Box specific feature ?