Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP 0.2

Autres articles (80)

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

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • 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

Sur d’autres sites (15193)

  • Youtube Dlp returns with error code of 400 [closed]

    10 mars 2024, par nikita goncharov

    I have a python discord bot that can play music and uses discord.py https://discordpy.readthedocs.io/en/stable/. To play get the music I use yt_dlp or youtube_dl. But when requesting a video it returns with a 400 error code.

    


    This is the error with yt_dlp :

    


    WARNING: [youtube] YouTube said: ERROR - Precondition check failed.

    


    WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (1/3)...

    


    WARNING: [youtube] YouTube said: ERROR - Precondition check failed.

    


    WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (2/3)...

    


    WARNING: [youtube] YouTube said: ERROR - Precondition check failed.

    


    WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (3/3)...

    


    WARNING: [youtube] YouTube said: ERROR - Precondition check failed.

    


    WARNING: [youtube] Unable to download API page: HTTP Error 400: Bad Request (caused by <httperror>)</httperror>

    &#xA;

    I will leave some of the code that I use for my bot... The youtube setup settings :

    &#xA;

    import youtube_dl

    &#xA;

    or

    &#xA;

    import yt_dlp as youtube_dl

    &#xA;

    youtube_dl.utils.bug_reports_message = lambda: &#x27;&#x27;&#xA;&#xA;&#xA;ytdl_format_options = {&#xA;    &#x27;format&#x27;: &#x27;bestaudio/best&#x27;,&#xA;    &#x27;outtmpl&#x27;: &#x27;%(extractor)s-%(id)s-%(title)s.%(ext)s&#x27;,&#xA;    &#x27;restrictfilenames&#x27;: True,&#xA;    &#x27;noplaylist&#x27;: True,&#xA;    &#x27;nocheckcertificate&#x27;: True,&#xA;    &#x27;ignoreerrors&#x27;: False,&#xA;    &#x27;logtostderr&#x27;: False,&#xA;    &#x27;quiet&#x27;: True,&#xA;    &#x27;no_warnings&#x27;: True,&#xA;    &#x27;default_search&#x27;: &#x27;auto&#x27;,&#xA;    &#x27;source_address&#x27;: &#x27;0.0.0.0&#x27;,  # bind to ipv4 since ipv6 addresses cause issues sometimes&#xA;}&#xA;&#xA;ffmpeg_options = {&#xA;    &#x27;options&#x27;: &#x27;-vn&#x27;,&#xA;}&#xA;&#xA;ytdl = youtube_dl.YoutubeDL(ytdl_format_options)&#xA;&#xA;&#xA;class YTDLSource(discord.PCMVolumeTransformer):&#xA;    def __init__(self, source, *, data, volume=0.5):&#xA;        super().__init__(source, volume)&#xA;&#xA;        self.data = data&#xA;&#xA;        self.title = data.get(&#x27;title&#x27;)&#xA;        self.url = data.get(&#x27;url&#x27;)&#xA;        self.duration = data.get(&#x27;duration&#x27;)&#xA;        self.image = data.get("thumbnails")[0]["url"]&#xA;    @classmethod&#xA;    async def from_url(cls, url, *, loop=None, stream=False):&#xA;        loop = loop or asyncio.get_event_loop()&#xA;        data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=not stream))&#xA;        #print(data)&#xA;&#xA;        if &#x27;entries&#x27; in data:&#xA;            # take first item from a playlist&#xA;            data = data[&#x27;entries&#x27;][0]&#xA;        #print(data["thumbnails"][0]["url"])&#xA;        #print(data["duration"])&#xA;        filename = data[&#x27;url&#x27;] if stream else ytdl.prepare_filename(data)&#xA;        return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_options), data=data)&#xA;

    &#xA;

    Approximately the command to run the audio (from my bot) :

    &#xA;

    sessionChanel = message.author.voice.channel await sessionChannel.connect() url = matched.group(1) player = await YTDLSource.from_url(url, loop=client.loop, stream=True) sessionChannel.guild.voice_client.play(player, after=lambda e: print(                                        f&#x27;Player error: {e}&#x27;) if e else None) &#xA;

    &#xA;

    I searched for posts with the same error and they where either old or didn't solve my problem.

    &#xA;

    I tried importing instead of yt_dlp, I tried importing youtube_dl. But when I make the request it does not answer, no exception and no warning it just does not answer, as if the funcion is empty

    &#xA;

    I will link my other post that I asked. It might be usefull : Error : Unable to extract uploader id - Youtube, Discord.py

    &#xA;

  • FFmpegMediaMetadataRetriever returns setDataSource failed : status = > 0xFFFFFFFF

    26 août 2015, par Alireza

    This is a weird error ! because it sometimes works but sometimes doesn’t work. I’m using FFmpegMediaMetadataRetriever to get the thumbnail from a video using an URL path. retriever.setDataSource(((Video) obj).getVideoAddress()); return following error :

    java.lang.IllegalArgumentException : setDataSource failed : status =
    0xFFFFFFFF

    This is my code :

    FFmpegMediaMetadataRetriever retriever = new FFmpegMediaMetadataRetriever();
               Bitmap bmp;

               retriever.setDataSource(((Video) obj).getVideoAddress
                       ());

               bmp = retriever.getFrameAtTime();

    Note : I checked the INTERNET permission and it exists. The problem is exists with some videos but with the same format ! I mean the only difference between videos is bit rates, length, size and others like this but not the file format.

  • avcodec_find_encoder(AV_CODEC_ID_H264) returns null

    25 mai, par Monjura Rumi

    I am building an android application which will encode image captured from camera preview and later decode it. I am using ffmpeg library to encode and decode. To build static library with x264 I have used this tutorial. http://dl.dropbox.com/u/22605641/ffmpeg_android/main.html. As a source code of ffmpeg if I use the one downloaded from the link given in tutorial I can built it but can't build library if i use source code downloaded from here git clone git ://source.ffmpeg.org/ffmpeg.git ffmpeg. I have built library in ubuntu and using it in windows 7 in Eclipse. As I need only h264 encoder and decoder I have used following code for ffmpeg, slightly modified from tutorial.

    &#xA;&#xA;

    #!/bin/bash&#xA;&#xA;NDK=~/Documents/android-ndk-r8e&#xA;PLATFORM=$NDK/platforms/android-8/arch-arm&#xA;PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86&#xA;PREFIX=/home/android-ffmpeg&#xA;&#xA;function build_one&#xA;{&#xA;    ./configure --target-os=linux --prefix=$PREFIX \&#xA;    --enable-cross-compile \&#xA;    --enable-runtime-cpudetect \&#xA;    --disable-asm \&#xA;    --arch=arm \&#xA;    --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \&#xA;    --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \&#xA;    --disable-stripping \&#xA;    --nm=$PREBUILT/bin/arm-linux-androideabi-nm \&#xA;    --sysroot=$PLATFORM \&#xA;    --enable-nonfree \&#xA;    --enable-version3 \&#xA;    --disable-everything \&#xA;    --enable-gpl \&#xA;    --disable-doc \&#xA;    --enable-avresample \&#xA;    --disable-ffplay \&#xA;    --disable-ffserver \&#xA;    --enable-ffmpeg \&#xA;    --disable-ffprobe \&#xA;    --enable-avcodec \&#xA;    --enable-libx264 \&#xA;    --enable-encoder=libx264 \&#xA;    --enable-encoder=libx264rgb \&#xA;    --enable-decoder=h263 \&#xA;    --enable-decoder=h264 \&#xA;    --enable-decoder=svq3 \   &#xA;    --enable-zlib \&#xA;    --enable-gpl \&#xA;    --enable-pic \&#xA;    --disable-devices \&#xA;    --disable-avdevice \&#xA;    --extra-cflags="-I/home/android-ffmpeg/include -fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=armv7-a" \&#xA;    --extra-ldflags="-L/home/android-ffmpeg/lib"&#xA;make -j4 install&#xA;$PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o&#xA;$PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -L$PREFIX/lib  -soname libffmpeg.so -shared -nostdlib  -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavfilter/libavfilter.a libavresample/libavresample.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog -lx264 --warn-once --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a&#xA;}&#xA;&#xA;build_one&#xA;

    &#xA;&#xA;

    After building library I have been able to build android ndk. A little part of my JNI code is here.

    &#xA;&#xA;

    JNIEXPORT jint JNICALL Java_com_example_testjava_TestjniActivity_initencoder(JNIEnv* env,jobject obj){&#xA;&#xA;    av_register_all();&#xA;    avcodec_register_all();&#xA;    codec = avcodec_find_encoder(AV_CODEC_ID_H264);&#xA;    if (!codec) {&#xA;      __android_log_write(ANDROID_LOG_INFO, "debug", "not found");                &#xA;       return -1;&#xA;    }&#xA;.&#xA;.&#xA;.&#xA;}&#xA;

    &#xA;&#xA;

    When I run my java source code that calls initencoder() I get -1 as return value and logcat prints "not found". That means avcodec_find_encoder() returns null and if condition is being ok. I don't know what's wrong. Why this function is returning null ? I have searched a lot but did not find any solution that could guide me to right direction. some says to use avcodec_init(). But ndk-build command fails and shows error saying undefined reference to 'avcodec_init()'. I have started with library build because I thought may be I am doing wrong from the first stage. Did I make any mistake in library building like not enabling things that I should ? Please help me here. This is kind of urgent for me.

    &#xA;