Recherche avancée

Médias (1)

Mot : - Tags -/net art

Autres articles (73)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (11250)

  • 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

    


    The play command looks like :

    


    # bot.py
import os
import discord
from discord.ext import commands
from dotenv import load_dotenv
from models import *
from discord.voice_client import VoiceClient
import logging
from config import *
import youtube_dl
from youtube_dl import YoutubeDL

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


    


    My error :

    


    0
1
[youtube] AOeY-nDp7hI: Downloading webpage
[youtube] Downloading just video AOeY-nDp7hI because of --no-playlist
2
3
Ignoring exception in command play:
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/Users/mohit/programming/discord/area-51-helper/main.py", line 115, in play
    voice.play(discord.FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))
  File "/opt/homebrew/lib/python3.9/site-packages/discord/voice_client.py", line 564, in play
    self.encoder = opus.Encoder()
  File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 291, in __init__
    self.set_fec(True)
  File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 326, in set_fec
    _lib.opus_encoder_ctl(self._state, CTL_SET_FEC, 1 if enabled else 0)
  File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 92, in _err_lt
    raise OpusError(result)
discord.opus.OpusError: invalid argument

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OpusError: invalid argument


    


    I'm using these version

    


    discord.py==1.0.1
ffmpeg==4.3.2
youtube_dl==2021.4.17


    


  • 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 & 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

  • Dealing with problems in FLAC audio files with ffmpeg

    15 janvier 2020, par Seamus

    I have gotten a set of FLAC (audio) files from a friend. I copied them to my Sonos music library, and got set to enjoy a nice album. Unfortunately, Sonos would not play the files. As a result I have been getting to know ffmpeg.

    Sonos’ complaint with the FLAC files was that it was "encoded at an unsupported sample rate". With rolling eyes and shaking head, I note that the free VLC media player happily plays these files, but the product I’ve paid for (Sonos) - does not. But I digress...

    ffprobe revealed that the FLAC files contain both an Audio channel and a Video channel :

    $ ffprobe -hide_banner  -show_streams "/path/to/Myaudio.flac"


       Duration: 00:02:23.17, start: 0.000000, bitrate: 6176 kb/s  
       Stream #0:0: Audio: flac, 176400 Hz, stereo, s32 (24 bit)  
       Stream #0:1: Video: mjpeg (Progressive), yuvj444p(pc, bt470bg/unknown/unknown), 450x446 [SAR 72:72 DAR 225:223], 90k tbr, 90k tbn, 90k tbc (attached pic)  
       Metadata:  
         comment         : Cover (front)  

    Cool ! I guess this is how some audio players are able to display the ’album artwork’ when they play a song ? Note also that the Audio stream is reported at 176400 Hz ! Apparently I’m out of touch ; I thought that 44.1khz sampling rate effectively removed all of the ’sampling artifacts’ we could hear. Anyway, I learned that Sonos would support a max of 48kHz sampling rate, and this (the 176.4kHz rate) is what Sonos was unhappy about. I used ffmpeg to ’dumb it down’ for them :

    $ ffmpeg -i "/path/to/Myaudio.flac" -sample_fmt s32 -ar 48000 "/path/to/Myaudio48K.flac"

    This seemed to work - at least I got a FLAC file that Sonos would play. However, I also got what looks like a warning of some sort :

    [swscaler @ 0x108e0d000] deprecated pixel format used, make sure you did set range correctly
    [flac @ 0x7feefd812a00] Frame rate very high for a muxer not efficiently supporting it.
    Please consider specifying a lower framerate, a different muxer or -vsync 2

    A bit more research turned up this answer which I don’t quite understand, and then in a comment says, "not to worry" - at least wrt the swscaler part of the warning.

    And that (finally) brings me to my questions :

    1.a. What framerate, muxer & other specifications make a graphic compatible with a majority of programs that use the graphic ?

    1.b. How should I use ffmpeg to modify the Video channel to set these specifications (ref. Q 1.a.) ?

    2.a. How do I remove the Video channel from the .flac audio file ?

    2.b. How do I add a Video channel into a .flac file ?

    EDIT :

    I asked the above (4) questions after failing to accomplish a ’direct’ conversion (a single ffmpeg command) from FLAC at 176.4 kHz to ALAC (.m4a) at 48 kHz (max supported by Sonos). I reasoned that an ’incremental’ approach through a series of conversions might get me there. With the advantage of hindsight, I now see I should have posted my original failed direct conversion incantation... we live and learn.

    That said, the accepted answer below meets my final objective to convert a FLAC file encoded at 176.4kHz to an ALAC (.m4a) at 48kHz, and preserve the cover art/video channel.