Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (23)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • 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 (4864)

  • Discord Bot can't play audio from YouTube all of a sudden

    22 mars 2023, par Aidan Tweedy

    Last night my Discord bot stopped working out of the blue. The bot had been working perfectly for months until this point - no code changes occurred and it was running in a Docker container on my home server. Then last night, my !play <url></url> command stopped working. The bot would join the voice channel, but not actually play anything. Then it would need to be manually disconnected from the voice channel in order for it to do anything again. After the first play fails, and I try again I get this error message :

    &#xA;

     [youtube] crOZk88eCcg: Downloading webpage&#xA; [youtube] crOZk88eCcg: Downloading android player API JSON&#xA; [youtube] Extracting URL: https://www.youtube.com/watch?v=crOZk88eCcg&amp;ab_channel=0foofighter0&#xA; [youtube] crOZk88eCcg: Downloading webpage&#xA; [youtube] crOZk88eCcg: Downloading android player API JSON&#xA; [2023-03-22 00:27:59] [ERROR   ] discord.ext.commands.bot: Ignoring exception in command play&#xA; Traceback (most recent call last):&#xA;   File "/usr/local/lib/python3.10/dist-packages/discord/ext/commands/core.py", line 190, in wrapped&#xA;     ret = await coro(*args, **kwargs)&#xA;   File "/usr/src/app/./main.py", line 180, in play&#xA;     voice.play(player, after=lambda e: print(f&#x27;Player error: {e}&#x27;) if e else None)&#xA;   File "/usr/local/lib/python3.10/dist-packages/discord/voice_client.py", line 600, in play&#xA;     raise ClientException(&#x27;Not connected to voice.&#x27;)&#xA; discord.errors.ClientException: Not connected to voice.&#xA; &#xA; The above exception was the direct cause of the following exception:&#xA; &#xA; Traceback (most recent call last):&#xA;   File "/usr/local/lib/python3.10/dist-packages/discord/ext/commands/bot.py", line 1347, in invoke&#xA;     await ctx.command.invoke(ctx)&#xA;   File "/usr/local/lib/python3.10/dist-packages/discord/ext/commands/core.py", line 986, in invoke&#xA;     await injected(*ctx.args, **ctx.kwargs)  # type: ignore&#xA;   File "/usr/local/lib/python3.10/dist-packages/discord/ext/commands/core.py", line 199, in wrapped&#xA;     raise CommandInvokeError(exc) from exc&#xA; discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: Not connected to voice.&#xA; [2023-03-22 00:27:59] [INFO    ] discord.player: ffmpeg process 12 has not terminated. Waiting to terminate...&#xA; [2023-03-22 00:27:59] [INFO    ] discord.player: ffmpeg process 12 should have terminated with a return code of -9.&#xA;

    &#xA;

    My first instinct was that ffmpeg was borking somehow, since it has been difficult to get working in the past. However I'm not sure how ffmpeg could've stopped working, since the bot never went down between working and not working. That leads me to believe it could be a change on Youtube/Discord's side ?

    &#xA;

    For context, here is a snippet of my !play code :

    &#xA;

    @client.command(pass_context = True)&#xA;async def play(ctx):&#xA;    url = ctx.message.content.split("!play ",1)[1]&#xA;    voice = discord.utils.get(client.voice_clients)&#xA;    if (ctx.author.voice):&#xA;        if voice == None:&#xA;            channel = ctx.message.author.voice.channel&#xA;            voice = await channel.connect()&#xA;&#xA;        # Youtube Magic&#xA;        ydl_opts = {&#xA;        &#x27;format&#x27;: &#x27;worstaudio/worst&#x27;,&#xA;        &#x27;postprocessors&#x27;: [{&#xA;            &#x27;key&#x27;: &#x27;FFmpegExtractAudio&#x27;,&#xA;            &#x27;preferredcodec&#x27;: &#x27;mp3&#x27;,&#xA;            &#x27;preferredquality&#x27;: &#x27;192&#x27;,&#xA;        }],&#xA;        }&#xA;&#xA;        if "http" not in url:&#xA;            yt = YoutubeSearch(url, max_results=1).to_json()&#xA;            print(yt)&#xA;            yt_id = str(json.loads(yt)[&#x27;videos&#x27;][0][&#x27;id&#x27;])&#xA;            yt_channel = str(json.loads(yt)[&#x27;videos&#x27;][0][&#x27;channel&#x27;]).strip().replace(" ", "")&#xA;            url = &#x27;https://www.youtube.com/watch?v=&#x27;&#x2B;yt_id&#x2B;"&amp;ab_channel="&#x2B;yt_channel&#xA;&#xA;        with yt_dlp.YoutubeDL(ydl_opts) as ydl:&#xA;            song_info=ydl.extract_info(url, download=False)&#xA;        for file in os.listdir("./"):&#xA;            if file.endswith(".mp3"):&#xA;                os.rename(file, "song.mp3")&#xA;&#xA;        voice.stop()&#xA;&#xA;        embed_trk = discord.Embed(&#xA;                title="Now playing",&#xA;                color=ctx.author.color,&#xA;        )&#xA;        video_title = song_info.get(&#x27;title&#x27;, None)&#xA;        video_channel = song_info.get(&#x27;uploader&#x27;, None)&#xA;        embed_trk.add_field(name="Track title", value=video_title, inline=False)&#xA;        embed_trk.add_field(name="Channel", value=video_channel, inline=False)&#xA;&#xA;        await ctx.send(embed=embed_trk)&#xA;        player = await YTDLSource.from_url(url, loop=client.loop, stream=True)&#xA;        voice.play(player, after=lambda e: print(f&#x27;Player error: {e}&#x27;) if e else None)&#xA;        while voice.is_playing():&#xA;            await asyncio.sleep(1)&#xA;        &#xA;        await request_record(ctx, video_title)&#xA;&#xA;    else:&#xA;        await ctx.send("You must be in a voice channel to run this command")&#xA;

    &#xA;

  • How can I combine a screenshot and two video files with ffmpeg ?

    26 novembre 2023, par lukascbossert

    I have a folder with video files. Some are .mov, some are .mp4. As a first step I am converting the .mov-files into .mp4 with :

    &#xA;

    while read mov; do&#xA;   mp4=$(echo "$mov"|sed -e &#x27;s|\.mov$|.mp4|i&#x27;)&#xA;   if [ "$mov" == "$mp4" ]; then&#xA;     echo "Failed to generate unique MP4 filename for file $mov"&#xA;   fi&#xA;   ffmpeg -i "$mov" -c:v libx264 -f mp4 "$mp4"&#xA; done &lt; &lt;(find . -type f -iname &#x27;*.mov&#x27;)&#xA;

    &#xA;

    This works technically fine.

    &#xA;

    As a second step I need to merge two video files : the first one is always the same (intro.mp4 with audio), the second file is the either converted .mov or the .mp4 from the folder (also with audio).&#xA;Additionally I need a screenshot of the first frame from the second video, which shall be the very first frame and visible for e.g. half a second (for e.g. youtube-shorts to differentiate the videos).

    &#xA;

    I create the screenshot with

    &#xA;

    ffmpeg -i ${fzbVideo} -ss 1 -vframes 1 ${cover}"_%01d.jpg"&#xA;

    &#xA;

    which works perfectly fine.

    &#xA;

    As far as I could I followed the example shown here and the documentation of ffmpeg&#xA;and created a loop for all the videos and the steps of merge screenshot and videos :

    &#xA;

    for fzbVideo in *.mp4; do&#xA;    # intro should be at the beginning of each video&#xA;    intro="intro/fzb-intro.mp4"&#xA;    # getting a cover imge&#xA;    cover="$(basename ${fzbVideo} .mp4)_cover"&#xA;    # naming the output file&#xA;    fzbVideoOutput="$(basename ${fzbVideo} .mp4)_output.mp4"&#xA;    #   create a cover image from the first frame of the video&#xA;    ffmpeg -i ${fzbVideo} -ss 1 -vframes 1 ${cover}"_%01d.jpg"&#xA;    # combine the cover image with the intro and the actual video file&#xA;    ffmpeg \&#xA;-loop 1 -framerate 1 -t 1 -i ${cover}"_1.jpg" \&#xA;-i ${intro} \&#xA;-i ${fzbVideo} \&#xA;-f lavfi -t 0.1 -i anullsrc=channel_layout=stereo:sample_rate=44100 \&#xA;-filter_complex &#x27;[0:v:0][0:a:0][1:v:0][1:a:0][2:a:0][2:a:0]concat=n=3:v=1:a=1&#x27; ${fzbVideoOutput}&#xA;done&#xA;

    &#xA;

    But this creates the error :

    &#xA;

    Stream specifier &#x27;:a:0&#x27; in filtergraph description [0:v:0][0:a:0][1:v:0][1:a:0][2:a:0][2:a:0]concat=n=3:v=1:a=1 matches no streams.&#xA;

    &#xA;

    What do I need to change ?&#xA;Additionally, is there a way to combine the converstion from .mov to .mp4 also in the loop (if necessary) ?

    &#xA;


    &#xA;

    Edit : content from the CLI, in case this is important information :

    &#xA;

    ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with Apple clang version 14.0.3 (clang-1403.0.22.14.1)&#xA;  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.0_1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon&#xA;  libavutil      58.  2.100 / 58.  2.100&#xA;  libavcodec     60.  3.100 / 60.  3.100&#xA;  libavformat    60.  3.100 / 60.  3.100&#xA;  libavdevice    60.  1.100 / 60.  1.100&#xA;  libavfilter     9.  3.100 /  9.  3.100&#xA;  libswscale      7.  1.100 /  7.  1.100&#xA;  libswresample   4. 10.100 /  4. 10.100&#xA;  libpostproc    57.  1.100 / 57.  1.100&#xA;Input #0, image2, from &#x27;IMG_5546_cover_1.jpg&#x27;:&#xA;  Duration: 00:00:01.00, start: 0.000000, bitrate: 836 kb/s&#xA;  Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1080x1920, 1 fps, 1 tbr, 1 tbn&#xA;Input #1, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;intro/fzb-intro.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 1&#xA;    compatible_brands: isommp41mp42&#xA;    creation_time   : 2023-11-24T21:59:10.000000Z&#xA;  Duration: 00:00:00.83, start: 0.000000, bitrate: 1247 kb/s&#xA;  Stream #1:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 602x1070, 1191 kb/s, 30 fps, 30 tbr, 600 tbn (default)&#xA;    Metadata:&#xA;      creation_time   : 2023-11-24T21:59:10.000000Z&#xA;      handler_name    : Core Media Video&#xA;      vendor_id       : [0][0][0][0]&#xA;  Stream #1:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 38 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2023-11-24T21:59:10.000000Z&#xA;      handler_name    : Core Media Audio&#xA;      vendor_id       : [0][0][0][0]&#xA;Input #2, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;IMG_5546.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf60.3.100&#xA;  Duration: 00:00:28.37, start: 0.000000, bitrate: 3126 kb/s&#xA;  Stream #2:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1080x1920, 2989 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)&#xA;    Metadata:&#xA;      handler_name    : Core Media Video&#xA;      vendor_id       : [0][0][0][0]&#xA;      encoder         : Lavc60.3.100 libx264&#xA;  Stream #2:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)&#xA;    Metadata:&#xA;      handler_name    : Core Media Audio&#xA;      vendor_id       : [0][0][0][0]&#xA;Stream specifier &#x27;:a&#x27; in filtergraph description [0:v] [0:a] [1:v] [1:a] [2:v] [2:a] concat=n=3:v=1:a=1 [v] [a] matches no streams.&#xA;

    &#xA;

  • Layout Video Recording Like Instgram/ Ticktok Feature

    21 mars 2023, par Amarchand K

    I'm try to do record video inn different layouts like Instagram in Flutter. For this feature I used ffmpeg_kit_flutter package. I refers this solution to do this. but output video is blank, any one helps me to solve this.&#xA;the video input and output path is valid, also show the bellow error while printing,

    &#xA;

    `ffmpeg version n5.1.2 Copyright (c) 2000-2022 the FFmpeg developers&#xA;    built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)&#xA;    configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --target-os=android --enable-neon --enable-asm --enable-inline-asm --ar=aarch64-linux-android-ar --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang&#x2B;&#x2B; --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs=&#x27;-L/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/cpu-features/lib -lndk_compat&#x27; --disable-autodetect --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-static --enable-shared --enable-pthreads --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-gmp --enable-gnutls --enable-iconv --disable-sdl2 --disable-openssl --enable-zlib --enable-mediacodec&#xA;    libavutil      57. 28.100 / 57. 28.100&#xA;    libavcodec     59. 37.100 / 59. 37.100&#xA;    libavformat    59. 27.100 / 59. 27.100&#xA;    libavdevice    59.  7.100 / 59.  7.100&#xA;    libavfilter     8. 44.100 /  8. 44.100&#xA;    libswscale      6.  7.100 /  6.  7.100&#xA;    libswresample   4.  7.100 /  4.  7.100&#xA;  -vsync is deprecated. Use -fps_mode&#xA;  Passing a number to -vsync is deprecated, use a string argument as described in the manual.&#xA;  Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;/data/user/0/com.example.tuki_taki/cache/REC1453994379216336834.mp4&#x27;:&#xA;    Metadata:&#xA;      major_brand     : mp42&#xA;      minor_version   : 0&#xA;      compatible_brands: isommp42&#xA;      creation_time   : 2023-03-21T07:15:58.000000Z&#xA;      com.android.version: 12&#xA;    Duration: 00:00:03.77, start: 0.000000, bitrate: 2204 kb/s&#xA;    Stream #0:0[0x1](eng): Video: h264, 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt470bg/smpte170m/bt709, progressive, left), 640x480, 2199 kb/s, 29.61 fps, 29.58 tbr, 90k tbn (default)&#xA;      Metadata:&#xA;        creation_time   : 2023-03-21T07:15:58.000000Z&#xA;        handler_name    : VideoHandle&#xA;        vendor_id       : [0][0][0][0]&#xA;      Side data:&#xA;        displaymatrix: rotation of -90.00 degrees&#xA;    Stream #0:1[0x2](eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 128 kb/s (default)&#xA;      Metadata:&#xA;        creation_time   : 2023-03-21T07:15:58.000000Z&#xA;        handler_name    : SoundHandle&#xA;        vendor_id       : [0][0][0][0]&#xA;  Input #1, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;/data/user/0/com.example.tuki_taki/cache/REC5972384708251368209.mp4&#x27;:&#xA;    Metadata:&#xA;      major_brand     : mp42&#xA;      minor_version   : 0&#xA;      compatible_brands: isommp42&#xA;      creation_time   : 2023-03-21T07:16:05.000000Z&#xA;      com.android.version: 12&#xA;    Duration: 00:00:02.84, start: 0.000000, bitrate: 2703 kb/s&#xA;    Stream #1:0[0x1](eng): Video: h264, 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt470bg/smpte170m/bt709, progressive, left), 640x480, 2801 kb/s, 29.61 fps, 29.58 tbr, 90k tbn (default)&#xA;      Metadata:&#xA;        creation_time   : 2023-03-21T07:16:05.000000Z&#xA;        handler_name    : VideoHandle&#xA;        vendor_id       : [0][0][0][0]&#xA;      Side data:&#xA;        displaymatrix: rotation of -90.00 degrees&#xA;    Stream #1:1[0x2](eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 128 kb/s (default)&#xA;      Metadata:&#xA;        creation_time   : 2023-03-21T07:16:05.000000Z&#xA;        handler_name    : SoundHandle&#xA;        vendor_id       : [0][0][0][0]&#xA;  Stream mapping:&#xA;    Stream #0:0 (h264) -> scale:default&#xA;    Stream #0:1 (aac) -> amix&#xA;    Stream #1:0 (h264) -> scale:default&#xA;    Stream #1:1 (aac) -> amix&#xA;    hstack:default -> Stream #0:0 (mpeg4)&#xA;    amix:default -> Stream #0:1 (aac)&#xA;  Press [q] to stop, [?] for help&#xA;  Output #0, mp4, to &#x27;/data/user/0/com.example.tuki_taki/cache/output.mp4&#x27;:&#xA;    Metadata:&#xA;      major_brand     : mp42&#xA;      minor_version   : 0&#xA;      compatible_brands: isommp42&#xA;      com.android.version: 12&#xA;      encoder         : Lavf59.27.100&#xA;    Stream #0:0: Video: mpeg4, 1 reference frame (mp4v / 0x7634706D), yuv420p(progressive), 960x640 (0x0) [SAR 1:1 DAR 3:2], q=2-31, 200 kb/s, 29.58 fps, 11360 tbn&#xA;      Metadata:&#xA;        encoder         : Lavc59.37.100 mpeg4&#xA;      Side data:&#xA;        cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A&#xA;    Stream #0:1: Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, delay 1024, 69 kb/s&#xA;      Metadata:&#xA;        encoder         : Lavc59.37.100 aac&#xA;  frame=    1 fps=0.0 q=4.3 size=       0kB time=00:00:00.23 bitrate=   1.5kbits/s speed=3.49x    &#xA;

    &#xA;

    [mpeg4 @ 0xb400007122ebac50] Invalid pts (8) <= last (8)&#xA;Error submitting video frame to the encoder&#xA;[aac @ 0xb4000071232208c0] Qavg : 9911.349&#xA;[aac @ 0xb4000071232208c0] 2 frames left in the queue on closing&#xA;Conversion failed`

    &#xA;

    I'm tried

    &#xA;

      `Future<void> onLayoutDone() async {&#xA;try {&#xA;  final String outputPath = await _getTempPath();   &#xA;  const String filter =&#xA;      "[0:v]scale=480:640,setsar=1[l];[1:v]scale=480:640,setsar=1[r];[l][r]hstack;[0][1]amix -vsync 0 ";    &#xA;  log("left path: ${layoutVideoPathList[0]} right : ${layoutVideoPathList[1]} $outputPath");     &#xA;  final String command =" -y -i ${layoutVideoPathList[0]} -i ${layoutVideoPathList[1]} -filter_complex$filter$outputPath -loglevel verbose"; `these paths are valid`    &#xA;     &#xA;  await FFmpegKit.execute(command).then((value) async {      &#xA;    String? error = await value.getAllLogsAsString();    &#xA;    log(error!);    &#xA;    final ReturnCode? returnCode = await value.getReturnCode();    &#xA;    if (returnCode != null) {&#xA;      setVideo(videoPath: outputPath);    &#xA;      layoutVideoPathList.clear();    &#xA;    }&#xA;  });&#xA;} catch (e) {&#xA;  log("error while  combine -========-=-=-=-=-=-=-=-=- $e");    &#xA;}`&#xA;</void>

    &#xA;