Recherche avancée

Médias (39)

Mot : - Tags -/audio

Autres articles (53)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

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

Sur d’autres sites (8187)

  • Convert Webm to MP4 on the fly using ffmpeg for a Telegram bot using Typescript

    23 novembre 2022, par Hex

    I'm trying to make a very primitive telegram bot that get's a json and uploads the urls that are in the json to telegram.

    


    The problem is that there are urls that point to webm files I tried to see if there is a simple way to do this and I found this : https://www.npmjs.com/package/webm-to-mp4
but it doesn't seem to work sadly, it runs into this error : "

    


    


    


    throw new Error(`Conversion error: ${stderr}`)
                                ^

Error: Conversion error: ffmpeg version n4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with emcc (Emscripten gcc/clang-like replacement) 1.39.11
  configuration: --cc=emcc --ranlib=emranlib --enable-cross-compile --target-os=none --arch=x86 --disable-runtime-cpudetect --disable-asm --disable-fast-unaligned --disable-pthreads --disable-w32threads --disable-os2threads --disable-debug --disable-stripping --disable-safe-bitstream-reader --disable-all --enable-ffmpeg --enable-avcodec --enable-avformat --enable-avfilter --enable-swresample --enable-swscale --disable-network --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vdpau --enable-decoder=vp8 --enable-decoder=h264 --enable-decoder=vorbis --enable-decoder=opus --enable-decoder=mp3 --enable-decoder=aac --enable-decoder=pcm_s16le --enable-decoder=mjpeg --enable-decoder=png --enable-demuxer=matroska --enable-demuxer=ogg --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=wav --enable-demuxer=image2 --enable-demuxer=concat --enable-protocol=file --enable-filter=aresample --enable-filter=scale --enable-filter=crop --enable-filter=overlay --enable-filter=hstack --enable-filter=vstack --disable-bzlib --disable-iconv --disable-libxcb --disable-lzma --disable-sdl2 --disable-securetransport --disable-xlib --enable-zlib --enable-encoder=libx264 --enable-encoder=libmp3lame --enable-encoder=aac --enable-muxer=mp4 --enable-muxer=mp3 --enable-muxer=null --enable-gpl --enable-libmp3lame --enable-libx264 --extra-cflags='-s USE_ZLIB=1 -I../lame/dist/include' --extra-ldflags=-L../lame/dist/lib
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
input.webm: Invalid data found when processing input
exception thrown: Error: Conversion error: ffmpeg version n4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with emcc (Emscripten gcc/clang-like replacement) 1.39.11
  configuration: --cc=emcc --ranlib=emranlib --enable-cross-compile --target-os=none --arch=x86 --disable-runtime-cpudetect --disable-asm --disable-fast-unaligned --disable-pthreads --disable-w32threads --disable-os2threads --disable-debug --disable-stripping --disable-safe-bitstream-reader --disable-all --enable-ffmpeg --enable-avcodec --enable-avformat --enable-avfilter --enable-swresample --enable-swscale --disable-network --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vdpau --enable-decoder=vp8 --enable-decoder=h264 --enable-decoder=vorbis --enable-decoder=opus --enable-decoder=mp3 --enable-decoder=aac --enable-decoder=pcm_s16le --enable-decoder=mjpeg --enable-decoder=png --enable-demuxer=matroska --enable-demuxer=ogg --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=wav --enable-demuxer=image2 --enable-demuxer=concat --enable-protocol=file --enable-filter=aresample --enable-filter=scale --enable-filter=crop --enable-filter=overlay --enable-filter=hstack --enable-filter=vstack --disable-bzlib --disable-iconv --disable-libxcb --disable-lzma --disable-sdl2 --disable-securetransport --disable-xlib --enable-zlib --enable-encoder=libx264 --enable-encoder=libmp3lame --enable-encoder=aac --enable-muxer=mp4 --enable-muxer=mp3 --enable-muxer=null --enable-gpl --enable-libmp3lame --enable-libx264 --extra-cflags='-s USE_ZLIB=1 -I../lame/dist/include' --extra-ldflags=-L../lame/dist/lib
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
input.webm: Invalid data found when processing input
,Error: Conversion error: ffmpeg version n4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with emcc (Emscripten gcc/clang-like replacement) 1.39.11
  configuration: --cc=emcc --ranlib=emranlib --enable-cross-compile --target-os=none --arch=x86 --disable-runtime-cpudetect --disable-asm --disable-fast-unaligned --disable-pthreads --disable-w32threads --disable-os2threads --disable-debug --disable-stripping --disable-safe-bitstream-reader --disable-all --enable-ffmpeg --enable-avcodec --enable-avformat --enable-avfilter --enable-swresample --enable-swscale --disable-network --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vdpau --enable-decoder=vp8 --enable-decoder=h264 --enable-decoder=vorbis --enable-decoder=opus --enable-decoder=mp3 --enable-decoder=aac --enable-decoder=pcm_s16le --enable-decoder=mjpeg --enable-decoder=png --enable-demuxer=matroska --enable-demuxer=ogg --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=wav --enable-demuxer=image2 --enable-demuxer=concat --enable-protocol=file --enable-filter=aresample --enable-filter=scale --enable-filter=crop --enable-filter=overlay --enable-filter=hstack --enable-filter=vstack --disable-bzlib --disable-iconv --disable-libxcb --disable-lzma --disable-sdl2 --disable-securetransport --disable-xlib --enable-zlib --enable-encoder=libx264 --enable-encoder=libmp3lame --enable-encoder=aac --enable-muxer=mp4 --enable-muxer=mp3 --enable-muxer=null --enable-gpl --enable-libmp3lame --enable-libx264 --extra-cflags='-s USE_ZLIB=1 -I../lame/dist/include' --extra-ldflags=-L../lame/dist/lib
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
input.webm: Invalid data found when processing input


    


    I'm not sure what is causing it, my guess is that the webm-to.mp4 package was updated 2 years ago and something broke in the meantime.

    


    Is there a better way to do this then downloading the webm converting it and then sending it up to telegram ? If not how could I do the conversion using just ffmpeg ?

    


    Here is my current code :

    


    import { Telegram, MediaSource, HTML } from 'puregram'
import { HearManager } from '@puregram/hear'
import { createReadStream } from 'fs'
import postsJson from './posts.json';
const { promises: fs } = require("fs");
const webmToMp4 = require("webm-to-mp4");

const telegram = new Telegram({
  token: '********:AAEzriis6zNNjEQuw0BxF9M2RPA9V4lEqLA'
})
const hearManager = new HearManager()

telegram.updates.startPolling()
  .then(() => console.log(`started polling @${telegram.bot.username}`))
  .catch(console.error)

telegram.updates.on('message', hearManager.middleware)

var posts = postsJson;

telegram.updates.on('message', (context) => {
    posts.forEach( async data => {
      console.error(data.ext);
        if(data.ext == "jpg" || data.ext == "png"){
          context.sendPhoto(MediaSource.url(data.image), { caption: data.content  } );
          delay(1000);
        }
        if(data.ext == "gif"){
          context.sendAnimation(MediaSource.url(data.image), { caption: data.content  } );
          delay(1000);
        }
        if(data.ext == "webm"){
          //context.sendDocument(MediaSource.url(data.image), { caption: data.content  } );
          delay(1000);
        }
        delay(1000);
    })
})
fs.writeFile("file.mp4", Buffer.from(webmToMp4( fs.readFile("./file.webm"))));

function delay(ms: number) {
  return new Promise( resolve => setTimeout(resolve, ms) ); //This does not work either
}


    


    I wish everoyne a nice day !

    


  • Duration of short ogg files (Telegram Voice messages) not correct when loaded into Python

    4 août 2018, par Kromme

    I’m trying to read voice messages, sent by Telegram, using Python but for short voice clips (< 10 seconds), it doesn’t work. It shortens the duration for some reason. It looks like it has something to do with OGG codec, but I’m not really sure.

    See here’s my code, the voice clip is about six seconds, however pydub reads my 6 second voiceclip as 0.06 seconds.

    import telegram
    from pydub import AudioSegment

    AudioSegment.ffmpeg = "./dependencies/ffmpeg-20180802-c9118d4-win64-static/bin/ffmpeg"
    AudioSegment.converter = "./dependencies/ffmpeg-20180802-c9118d4-win64-static/bin/ffmpeg"


    bot = telegram.Bot(token=token)
    f = bot.get_file(file_id)
    f.download('output/voiceclips/{}.ogg'.format(file_id))

    myaudio = AudioSegment.from_ogg("output/voiceclips/{}.ogg".format(file_id))
    print('ID: {}, which is {} seconds'.format(file_id, myaudio.duration_seconds))

    >>> ID: ______, which is 0.06 seconds

    When I open the file in VLC-player, it also states that is has 0 seconds. When I try to convert it to WAV-files using FFmpeg it reads the ogg file as 6 seconds, but writes it as 0.05-second WAV file.

    ffmpeg -i infile.ogg outfile.wav
    ffmpeg version N-91549-gc9118d4d64 Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 7.3.1 (GCC) 20180722
     configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
     libavutil      56. 18.102 / 56. 18.102
     libavcodec     58. 22.100 / 58. 22.100
     libavformat    58. 17.101 / 58. 17.101
     libavdevice    58.  4.101 / 58.  4.101
     libavfilter     7. 26.100 /  7. 26.100
     libswscale      5.  2.100 /  5.  2.100
     libswresample   3.  2.100 /  3.  2.100
     libpostproc    55.  2.100 / 55.  2.100
    [ogg @ 0000020dd375ad40] 727 bytes of comment header remain
    Input #0, ogg, from 'infile.ogg':
     Duration: 00:00:06.03, start: 0.000000, bitrate: 20 kb/s
       Stream #0:0: Audio: opus, 48000 Hz, mono, fltp
    Stream mapping:
     Stream #0:0 -> #0:0 (opus (native) -> pcm_s16le (native))
    Press [q] to stop, [?] for help
    Output #0, wav, to 'outfile.wav':
     Metadata:
       ISFT            : Lavf58.17.101
       Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s16, 768 kb/s
       Metadata:
         encoder         : Lavc58.22.100 pcm_s16le
    size=       6kB time=00:00:00.05 bitrate= 873.0kbits/s speed=4.12x
    video:0kB audio:6kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.354167%

    For larger files it does the work !

  • Telegram Build failed on Windows 10 error from ffmpeg

    23 août 2016, par ass3mbl4ge

    Steps to reproduce

    Build Telegram Projects from Visual Studio 2015
    Expected behaviour

    Build : 4 succeeded, 0 failed

    Actual behaviour

    main.cpp
     mainwidget.cpp
     mediaview.cpp
     media_audio.cpp
    SourceFiles\media\media_audio.cpp(1455): error C2039: 'codecpar': is not a member of 'AVStream'
     D:\TBuild\Libraries\ffmpeg\libavformat/avformat.h(846): note: see declaration of 'AVStream'
    SourceFiles\media\media_audio.cpp(1455): error C3861: 'avcodec_parameters_from_context': identifier not found
    SourceFiles\media\media_audio.cpp(1772): error C3861: 'avcodec_send_frame': identifier not found
    SourceFiles\media\media_audio.cpp(1788): error C3861: 'avcodec_send_frame': identifier not found
    SourceFiles\media\media_audio.cpp(1816): error C3861: 'avcodec_receive_packet': identifier not found
     Generating Code...
     Compiling...
     media_audio_ffmpeg_loader.cpp
    SourceFiles\media\media_audio_ffmpeg_loader.cpp(68): error C2039: 'codecpar': is not a member of 'AVStream'
     D:\TBuild\Libraries\ffmpeg\libavformat/avformat.h(846): note: see declaration of 'AVStream'
    SourceFiles\media\media_audio_ffmpeg_loader.cpp(68): error C2227: left of '->sample_rate' must point to class/struct/union/generic type
    SourceFiles\media\media_audio_ffmpeg_loader.cpp(148): error C2039: 'codecpar': is not a member of 'AVStream'
     D:\TBuild\Libraries\ffmpeg\libavformat/avformat.h(846): note: see declaration of 'AVStream'
    SourceFiles\media\media_audio_ffmpeg_loader.cpp(155): error C3536: 'codecParams': cannot be used before it is initialized
    SourceFiles\media\media_audio_ffmpeg_loader.cpp(155): error C3861: 'avcodec_parameters_to_context': identifier not found
    SourceFiles\media\media_audio_ffmpeg_loader.cpp(167): error C2227: left of '->channel_layout' must point to class/struct/union/generic type
     SourceFiles\media\media_audio_ffmpeg_loader.cpp(167): note: type is 'int'
    SourceFiles\media\media_audio_ffmpeg_loader.cpp(248): error C3861: 'avcodec_receive_frame': identifier not found
    SourceFiles\media\media_audio_ffmpeg_loader.cpp(267): error C3861: 'avcodec_send_packet': identifier not found
    SourceFiles\media\media_audio_ffmpeg_loader.cpp(272): error C3861: 'avcodec_send_packet': identifier not found
     media_audio_loader.cpp
     media_audio_loaders.cpp
     media_child_ffmpeg_loader.cpp
    SourceFiles\media\media_child_ffmpeg_loader.cpp(120): error C3861: 'avcodec_receive_frame': identifier not found
    SourceFiles\media\media_child_ffmpeg_loader.cpp(142): error C3861: 'avcodec_send_packet': identifier not found
    SourceFiles\media\media_child_ffmpeg_loader.cpp(146): error C3861: 'avcodec_send_packet': identifier not found
     media_clip_ffmpeg.cpp
    SourceFiles\media\media_clip_ffmpeg.cpp(46): error C3861: 'avcodec_receive_frame': identifier not found
    SourceFiles\media\media_clip_ffmpeg.cpp(90): error C3861: 'avcodec_send_packet': identifier not found
    SourceFiles\media\media_clip_ffmpeg.cpp(98): error C3861: 'avcodec_send_packet': identifier not found
    SourceFiles\media\media_clip_ffmpeg.cpp(294): error C2039: 'codecpar': is not a member of 'AVStream'
     D:\TBuild\Libraries\ffmpeg\libavformat/avformat.h(846): note: see declaration of 'AVStream'
    SourceFiles\media\media_clip_ffmpeg.cpp(294): error C3861: 'avcodec_parameters_to_context': identifier not found
    SourceFiles\media\media_clip_ffmpeg.cpp(331): error C2039: 'codecpar': is not a member of 'AVStream'
     D:\TBuild\Libraries\ffmpeg\libavformat/avformat.h(846): note: see declaration of 'AVStream'
    SourceFiles\media\media_clip_ffmpeg.cpp(331): error C3861: 'avcodec_parameters_to_context': identifier not found
    SourceFiles\media\media_clip_ffmpeg.cpp(346): error C2039: 'codecpar': is not a member of 'AVStream'
     D:\TBuild\Libraries\ffmpeg\libavformat/avformat.h(846): note: see declaration of 'AVStream'
    SourceFiles\media\media_clip_ffmpeg.cpp(346): error C2227: left of '->sample_rate' must point to class/struct/union/generic type
     media_clip_implementation.cpp

    3 succeeded, 1 failed

    Configuration

    Operating system :
    Windows 10 x64
    Version of Telegram Desktop :
    AppVersion 10002