Recherche avancée

Médias (0)

Mot : - Tags -/metadatas

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

Autres articles (18)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

Sur d’autres sites (4123)

  • avformat/mov : Rework the AVIF parser to handle multiple items

    28 juillet 2022, par Vignesh Venkatasubramanian
    avformat/mov : Rework the AVIF parser to handle multiple items
    

    Stores the item ids of all the items found in the file and
    processes the primary item at the end of the meta box. This patch
    does not change any behavior. It sets up the code for parsing
    alpha channel (and possibly images with 'grid') in follow up
    patches.

    Reviewed-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
    Signed-off-by : Vignesh Venkatasubramanian <vigneshv@google.com>
    Signed-off-by : James Zern <jzern@google.com>

    • [DH] libavformat/isom.h
    • [DH] libavformat/mov.c
  • Seeking with ffmpeg options fails or causes delayed playback in Discord bot

    29 août 2022, par J Petersen

    My Discord bot allows users to play a song starting from a timestamp.

    &#xA;

    The problem is that playback is delayed and audio plays faster and is jumbled if start times >= 30s are set.

    &#xA;

    Results from testing different start times. Same URL, 30 second duration :

    &#xA;

    &#xA;&#xA;&#xA;&#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;&#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    &#xA;

    Entered Start Time (s) Playback Delay (s) Song Playback Time (s)
    0 3 30
    30 10 22
    60 17 17
    120 31 2
    150 120 <1

    &#xA;

    &#xA;

    I am setting the start time using ffmpeg_options as suggested in this question.

    &#xA;

    Does anyone understand why the audio playback is being delayed/jumbled ? How can I improve playback delay and allow users to start in the middle of a multi-chapter YouTube video ?

    &#xA;

    Code :

    &#xA;

    import discord&#xA;import youtube_dl&#xA;import asyncio&#xA;&#xA;&#xA;# Suppress noise about console usage from errors&#xA;youtube_dl.utils.bug_reports_message = lambda: ""&#xA;&#xA;&#xA;ytdl_format_options = {&#xA;    "format": "bestaudio/best",&#xA;    "outtmpl": "%(extractor)s-%(id)s-%(title)s.%(ext)s",&#xA;    "restrictfilenames": True,&#xA;    "noplaylist": False,&#xA;    "yesplaylist": True,&#xA;    "nocheckcertificate": True,&#xA;    "ignoreerrors": False,&#xA;    "logtostderr": False,&#xA;    "quiet": True,&#xA;    "no_warnings": True,&#xA;    "default_search": "auto",&#xA;    "source_address": "0.0.0.0",  # Bind to ipv4 since ipv6 addresses cause issues at certain times&#xA;}&#xA;&#xA;ytdl = youtube_dl.YoutubeDL(ytdl_format_options)&#xA;&#xA;&#xA;class YTDLSource(discord.PCMVolumeTransformer):&#xA;    def __init__(self, source: discord.AudioSource, *, data: dict, volume: float = 0.5):&#xA;        super().__init__(source, volume)&#xA;&#xA;        self.data = data&#xA;&#xA;        self.title = data.get("title")&#xA;        self.url = data.get("url")&#xA;&#xA;    @classmethod&#xA;    async def from_url(cls, url, *, loop=None, stream=False, timestamp = 0):&#xA;        ffmpeg_options = {&#xA;            "options": f"-vn -ss {timestamp}"}&#xA;&#xA;        loop = loop or asyncio.get_event_loop()&#xA;&#xA;        data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=not stream))&#xA;        if "entries" in data:&#xA;            # Takes the first item from a playlist&#xA;            data = data["entries"][0]&#xA;&#xA;        filename = data["url"] if stream else ytdl.prepare_filename(data)&#xA;        return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_options), data=data)&#xA;&#xA;&#xA;intents = discord.Intents.default()&#xA;&#xA;bot = discord.Bot(intents=intents)&#xA;&#xA;@bot.slash_command()&#xA;async def play(ctx, audio: discord.Option(), seconds: discord.Option(), timestamp: discord.Option()):&#xA;    channel = ctx.author.voice.channel&#xA;    voice = await channel.connect()&#xA;    player = await YTDLSource.from_url(audio, loop=bot.loop, stream=True, timestamp=int(timestamp))&#xA;    voice.play(player)&#xA;    await asyncio.sleep(int(seconds))&#xA;    await voice.disconnect()&#xA;&#xA;token = token value&#xA;bot.run(token)&#xA;

    &#xA;

  • How to handle FFmpeg hardware decoder initialisation failure

    5 décembre 2024, par Bernie

    I'm using the FFmpeg.AutoGen library in my project and found a crash on a video using hardware decoding.&#xA;So I went back to the example and tested it there and found the same result.

    &#xA;

    The example reports the following

    &#xA;

    Current directory: D:\...\Ruslan-B\FFmpeg.AutoGen\FFmpeg.AutoGen.Example\bin\Debug\net6.0&#xA;Running in 64-bit mode.&#xA;FFmpeg binaries found in: D:\...\Ruslan-B\FFmpeg.AutoGen\FFmpeg\bin\x64&#xA;FFmpeg version info: 5.0-full_build-www.gyan.dev&#xA;Use hardware acceleration for decoding?[n]&#xA;y&#xA;Select hardware decoder:&#xA;1. AV_HWDEVICE_TYPE_CUDA&#xA;2. AV_HWDEVICE_TYPE_DXVA2&#xA;3. AV_HWDEVICE_TYPE_QSV&#xA;4. AV_HWDEVICE_TYPE_D3D11VA&#xA;5. AV_HWDEVICE_TYPE_OPENCL&#xA;6. AV_HWDEVICE_TYPE_VULKAN&#xA;Selected [2]&#xA;&#xA;Decoding...&#xA;[mpegts @ 0000012917fced00] parser not found for codec klv, packets or times may be invalid.&#xA;[h264 @ 000001293b424080] Reinit context to 1920x1088, pix_fmt: yuv420p&#xA;[mpegts @ 0000012917fced00] parser not found for codec klv, packets or times may be invalid.&#xA;[AVHWDeviceContext @ 000001293b9a6940] Using D3D9Ex device.&#xA;codec name: h264&#xA;[h264 @ 000001293b8a5040] Decoder GUIDs reported as supported:&#xA;[h264 @ 000001293b8a5040] {ee27417f-5e28-4e65-beea-1d26b508adc9}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {bf22ad00-03ea-4690-8077-473346209b7e}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {e07ec519-e651-4cd6-ac84-1370cceec851}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {bcc5db6d-a2b6-4af0-ace4-adb1f787bc89}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {1b81bea4-a0c7-11d3-b984-00c04f2e73c5}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {1b81be68-a0c7-11d3-b984-00c04f2e73c5}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {d79be8da-0cf1-4c81-b82a-69a4e236f43d}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {f9aaccbb-c2b6-4cfc-8779-5707b1760552}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {705b9d82-76cf-49d6-b7e6-ac8872db013c}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {c528916c-c0af-4645-8cb2-372b6d4adc2a}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {07cfaffb-5a2e-4b99-b62a-e4ca53b6d5aa}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {91cd2d6e-897b-4fa1-b0d7-51dc88010e0a}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {90b899ea-3a62-4705-88b3-8df04b2744e7}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {442b942a-b4d9-4940-bc45-a882e5f919f3}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {8c56eb1e-2b47-466f-8d33-7dbcd63f3df2}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {5b11d51b-2f4c-4452-bcc3-09f2a1160cc0}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {75fc75f7-c589-4a07-a25b-72e03b0383b3}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]  1[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {107af0e0-ef1a-4d19-aba8-67a163073d13}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]  1[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {463707f8-a1d0-4585-876d-83aa6d60b89e}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {a4c749ef-6ecf-48aa-8448-50a7a1165ff7}[h264 @ 000001293b8a5040]  1[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {76988a52-df13-419a-8e64-ffcf4a336cf5}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {80a3a7bd-89d8-4497-a2b8-2126af7e6eb8}[h264 @ 000001293b8a5040]  1[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {a74ccae2-f466-45ae-86f5-ab8be8af8483}[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {1b81be94-a0c7-11d3-b984-00c04f2e73c5}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {1b81bea2-a0c7-11d3-b984-00c04f2e73c5}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] {49761bec-4b63-4349-a5ff-87ffdf088466}[h264 @ 000001293b8a5040]  0[h264 @ 000001293b8a5040]&#xA;[h264 @ 000001293b8a5040] No decoder device for codec found&#xA;[h264 @ 000001293b8a5040] Failed setup for format dxva2_vld: hwaccel initialisation returned error.&#xA;[h264 @ 000001293b8a5040] Reinit context to 1920x1088, pix_fmt: yuv420p&#xA;Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.&#xA;   at FFmpeg.AutoGen.ffmpeg&#x2B;&lt;>c.&lt;.cctor>b__7_466(FFmpeg.AutoGen.AVFrame*, FFmpeg.AutoGen.AVFrame*, Int32)&#xA;   at FFmpeg.AutoGen.ffmpeg.av_hwframe_transfer_data(FFmpeg.AutoGen.AVFrame*, FFmpeg.AutoGen.AVFrame*, Int32)&#xA;   at FFmpeg.AutoGen.Example.VideoStreamDecoder.TryDecodeNextFrame(FFmpeg.AutoGen.AVFrame ByRef)&#xA;   at FFmpeg.AutoGen.Example.Program.DecodeAllFramesToImages(FFmpeg.AutoGen.AVHWDeviceType)&#xA;   at FFmpeg.AutoGen.Example.Program.Main(System.String[])&#xA;

    &#xA;

    The errors/messages

    &#xA;

    ...&#xA;[h264 @ 0000013533bfb040] No decoder device for codec found&#xA;[h264 @ 0000013533bfb040] Failed setup for format dxva2_vld: hwaccel initialisation returned error.&#xA;[h264 @ 0000013533bfb040] Reinit context to 1920x1088, pix_fmt: yuv420p&#xA;

    &#xA;

    are reported in the call to

    &#xA;

    error = ffmpeg.avcodec_receive_frame(_pCodecContext, _pFrame);&#xA;

    &#xA;

    The result (error) of ffmpeg.avcodec_receive_frame is 0. so there's no obvious error.&#xA;But the messages make it obviously that the hardware decoder can't handle the video.

    &#xA;

    The exception is thrown in the call to ffmpeg.av_hwframe_transfer_data()

    &#xA;

    if (_pCodecContext->hw_device_ctx != null)&#xA;{&#xA;    ffmpeg.av_hwframe_transfer_data(_receivedFrame, _pFrame, 0).ThrowExceptionIfError();&#xA;    frame = *_receivedFrame;&#xA;}&#xA;

    &#xA;

    My question is how can I determine this beforehand and not use the hardware decoder ? i.e. fall back to the software decoder.

    &#xA;

    Edit :&#xA;I've found that _pCodecContext->hwaccel is null after the call to ffmpeg.avcodec_receive_frame(_pCodecContext, _pFrame); when for the Truck.ts video but for videos where the hardware decoder is working _pCodecContext->hwaccel is non-null.

    &#xA;

    Updating the code to

    &#xA;

    if (_pCodecContext->hw_device_ctx != null &amp;&amp; _pCodecContext->hwaccel != null)&#xA;{&#xA;    ffmpeg.av_hwframe_transfer_data(_receivedFrame, _pFrame, 0).ThrowExceptionIfError();&#xA;    frame = *_receivedFrame;&#xA;}&#xA;

    &#xA;

    Seems to be enough to catch the error.&#xA;Is the right way to check that the hardware decoder is working or is there a better approach ?

    &#xA;