Recherche avancée

Médias (91)

Autres articles (21)

  • 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

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • D’autres logiciels intéressants

    12 avril 2011, par

    On ne revendique pas d’être les seuls à faire ce que l’on fait ... et on ne revendique surtout pas d’être les meilleurs non plus ... Ce que l’on fait, on essaie juste de le faire bien, et de mieux en mieux...
    La liste suivante correspond à des logiciels qui tendent peu ou prou à faire comme MediaSPIP ou que MediaSPIP tente peu ou prou à faire pareil, peu importe ...
    On ne les connais pas, on ne les a pas essayé, mais vous pouvez peut être y jeter un coup d’oeil.
    Videopress
    Site Internet : (...)

Sur d’autres sites (5598)

  • Trouble with converting webm into mp3 with pydub in python

    15 août 2020, par rc_marty

    so basically I want to convert song what I downloaded from youtube in webm and convert to into mp3

    


    when I wanted export song just with song.export("neco.mp3") it didn't work too

    


    I have in workfolder ffmpeg.exe and ffprobe.exe

    


    here is the code

    


    from pydub import AudioSegment

song = AudioSegment.from_file(downloaded.webm,"webm")
print("Loaded")
song.export("neco.mp3", format="mp3", bitrate="320k")
print("Converted and saved")


    


    here is the output of the console

    


    Loaded&#xA;Traceback (most recent call last):&#xA;  File "e:/martan/projekty/Python/programek na pisnicky/songDownloader.py", line 188, in <module>&#xA;    song.export("neco.mp3", format="mp3", bitrate="320k")&#xA;  File "C:\Users\BIBRAIN\AppData\Local\Programs\Python\Python38\lib\site-packages\pydub\audio_segment.py", line 911, in export&#xA;    raise CouldntEncodeError(&#xA;pydub.exceptions.CouldntEncodeError: Encoding failed. ffmpeg/avlib returned error code: 1&#xA;&#xA;Command:[&#x27;ffmpeg&#x27;, &#x27;-y&#x27;, &#x27;-f&#x27;, &#x27;wav&#x27;, &#x27;-i&#x27;, &#x27;C:\\Users\\BIBRAIN\\AppData\\Local\\Temp\\tmpo20ooz_z&#x27;, &#x27;-b:a&#x27;, &#x27;320k&#x27;, &#x27;-f&#x27;, &#x27;mp3&#x27;, &#x27;C:\\Users\\BIBRAIN\\AppData\\Local\\Temp\\tmpiqpl57g7&#x27;]&#xA;&#xA;Output from ffmpeg/avlib:&#xA;&#xA;ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers&#xA;  built with gcc 10.2.1 (GCC) 20200726&#xA;  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --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-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf&#xA;  libavutil      56. 51.100 / 56. 51.100&#xA;  libavcodec     58. 91.100 / 58. 91.100&#xA;  libavformat    58. 45.100 / 58. 45.100&#xA;  libavdevice    58. 10.100 / 58. 10.100&#xA;  libavfilter     7. 85.100 /  7. 85.100&#xA;  libswscale      5.  7.100 /  5.  7.100&#xA;  libswresample   3.  7.100 /  3.  7.100&#xA;  libpostproc    55.  7.100 / 55.  7.100&#xA;Guessed Channel Layout for Input Stream #0.0 : stereo&#xA;Input #0, wav, from &#x27;C:\Users\BIBRAIN\AppData\Local\Temp\tmpo20ooz_z&#x27;:&#xA;  Duration: 00:03:54.71, bitrate: 3072 kb/s&#xA;    Stream #0:0: Audio: pcm_s32le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32, 3072 kb/s&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (pcm_s32le (native) -> mp3 (mp3_mf))&#xA;Press [q] to stop, [?] for help&#xA;[mp3_mf @ 00000000004686c0] could not find any MFT for the given media type&#xA;[mp3_mf @ 00000000004686c0] could not create MFT&#xA;Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height&#xA;Conversion failed!&#xA;</module>

    &#xA;

    I think it is something with codec but I have no idea what to do

    &#xA;

  • Getting accurate time from FFMPeg with Objective C (Audio Queue Services)

    2 avril 2012, par Winston

    My iPhone app plays an audio file using FFMPeg.

    I'm getting the elapsed time (to show to user) from the playing audio (in minutes and seconds after converting from microseconds, given by FFMPeg) like so :

    AudioTimeStamp currentTimeStamp;
    AudioQueueGetCurrentTime (audioQueue, NULL, &amp;currentTimeStamp, NULL);

    getFFMPEGtime = currentTimeStamp.mSampleTime/self.basicAudioDescription.mSampleRate;

    self.currentAudioTime = [NSString stringWithFormat: @"%02d:%02d",
                               (int) getFFMPEGtime / (int)60000000,
                               (int) ((getFFMPEGtime % 60000000)/1000000)];

    Everything works fine, but when I scrub back or forward to play another portion of the song, the elapsed time will go back to zero, no matter the current position. The timer will always zero out.

    I know I'm suposed to do some math to keep track of the old time and the new time, maybe constructing another clock or so, perhaps implementing another callback function, etc... I'm not sure what way I should go.

    My questions are :

    1) What's the best approach to keep track of the elapsed time when going back/forward in a song, avoiding the clock to always going back to zero ?

    2) Should I look deeply into FFMPeg functions or should I stick with Objective-C and Cocoa Touch for solving this problem ?

    Please, I need some advices/ideas from experienced programmers. I'm stuck. Thanks beforehand !

  • My discord music bot works locally, but not on a server [closed]

    8 décembre 2022, par Asmondya

    I have an issue with my discord music bot that I made with discord.js v14.

    &#xA;

    When I run it locally, it works fine and plays music as it should. But when I put in on a server (here I use Vultr), it doesn't work.

    &#xA;

    I am not sure but it might come from FFmpeg. I am kinda desperate and cant really figure where the issue is from. I think it is FFmpeg because it is what converts the music.

    &#xA;

    What happens :

    &#xA;

    Me: !play a music&#xA;Bot: Now playing a music&#xA;*and right after, without playing the music*&#xA;Bot: Music finished&#xA;

    &#xA;

    What should normally happen is that same thing but the "music finished" should be sent when the queue is finished.

    &#xA;

    The thing is that the bot works perfectly locally, but does this when it is hosted on a server. Also I don't have any error messages or else. It just doesn't play the music like if the music was 0 seconds length.

    &#xA;

    I tried making sure everything is installed on the server, same as making sure ffmpeg was installed globally and I have the good version of it. Here is the answer I have to the "ffmpeg -version" command :enter image description here.

    &#xA;

    Does anyone know what could be the issue or what could cause it ? I can show some code if needed, even tho it works perfectly fine locally.

    &#xA;

    Here's my code :

    &#xA;

    const { DisTube } = require(&#x27;distube&#x27;)&#xA;const Discord = require(&#x27;discord.js&#x27;)&#xA;const { EmbedBuilder } = require(&#x27;discord.js&#x27;)&#xA;const client = new Discord.Client({&#xA;  intents: [&#xA;    Discord.GatewayIntentBits.Guilds,&#xA;    Discord.GatewayIntentBits.GuildMessages,&#xA;    Discord.GatewayIntentBits.GuildVoiceStates,&#xA;    Discord.GatewayIntentBits.MessageContent,&#xA;  ]&#xA;})&#xA;const { ActivityType } = require(&#x27;discord.js&#x27;)&#xA;const fs = require(&#x27;fs&#x27;)&#xA;const dotenv = require("dotenv")&#xA;dotenv.config()&#xA;const { SpotifyPlugin } = require(&#x27;@distube/spotify&#x27;)&#xA;const { SoundCloudPlugin } = require(&#x27;@distube/soundcloud&#x27;)&#xA;const { YtDlpPlugin } = require(&#x27;@distube/yt-dlp&#x27;)&#xA;&#xA;client.distube = new DisTube(client, {&#xA;  leaveOnStop: false,&#xA;  emitNewSongOnly: true,&#xA;  emitAddSongWhenCreatingQueue: false,&#xA;  emitAddListWhenCreatingQueue: false,&#xA;  plugins: [&#xA;    new SpotifyPlugin({&#xA;      emitEventsAfterFetching: true&#xA;    }),&#xA;    new SoundCloudPlugin(),&#xA;    new YtDlpPlugin()&#xA;  ]&#xA;})&#xA;client.commands = new Discord.Collection()&#xA;client.aliases = new Discord.Collection()&#xA;&#xA;fs.readdir(&#x27;./commands/&#x27;, (err, files) => {&#xA;  if (err) return console.log(&#x27;Could not find any commands!&#x27;)&#xA;  const jsFiles = files.filter(f => f.split(&#x27;.&#x27;).pop() === &#x27;js&#x27;)&#xA;  if (jsFiles.length &lt;= 0) return console.log(&#x27;Could not find any commands!&#x27;)&#xA;  jsFiles.forEach(file => {&#xA;    const cmd = require(`./commands/${file}`)&#xA;    console.log(`Loaded ${file}`)&#xA;    client.commands.set(cmd.name, cmd)&#xA;    if (cmd.aliases) cmd.aliases.forEach(alias => client.aliases.set(alias, cmd.name))&#xA;  })&#xA;})&#xA;&#xA;client.on(&#x27;ready&#x27;, () => {&#xA;  console.log(`${client.user.tag} is ready to play music.`)&#xA;})&#xA;&#xA;client.on(&#x27;messageCreate&#x27;, async message => {&#xA;  if (message.author.bot || !message.guild) return&#xA;  const prefix = "!"&#xA;  if (!message.content.startsWith(prefix)) return&#xA;  const args = message.content.slice(prefix.length).trim().split(/ &#x2B;/g)&#xA;  const command = args.shift().toLowerCase()&#xA;  const cmd = client.commands.get(command) || client.commands.get(client.aliases.get(command))&#xA;  if (!cmd) return&#xA;  if (cmd.inVoiceChannel &amp;&amp; !message.member.voice.channel) {&#xA;    return message.channel.send(`You must be in a voice channel!`)&#xA;  }&#xA;  try {&#xA;    cmd.run(client, message, args)&#xA;  } catch (e) {&#xA;    console.error(e)&#xA;    message.channel.send(`Error: \`${e}\``)&#xA;  }&#xA;})&#xA;&#xA;// Add filters to the queue status :&#xA;// | Filter: \`${queue.filters.names.join(&#x27;, &#x27;) || &#x27;Off&#x27;}\` &#xA;&#xA;const status = queue =>&#xA;  `Volume: \`${queue.volume}%\` | Loop: \`${&#xA;    queue.repeatMode ? (queue.repeatMode === 2 ? &#x27;All Queue&#x27; : &#x27;This Song&#x27;) : &#x27;Off&#x27;&#xA;  }\` | Autoplay: \`${queue.autoplay ? &#x27;On&#x27; : &#x27;Off&#x27;}\``&#xA;client.distube&#xA;  .on(&#x27;playSong&#x27;, (queue, song) =>&#xA;    queue.textChannel.send({&#xA;      embeds: [&#xA;        new Discord.EmbedBuilder()&#xA;          .setTitle(&#x27;Now playing&#x27;)&#xA;          .setDescription(`\`${song.name}\` - \`${song.formattedDuration}\`\n${status(queue)}\n\nRequested by: \`${song.user.tag}\``)&#xA;          .setThumbnail(`${song.thumbnail}`)&#xA;      ]&#xA;    })&#xA;  )&#xA;  .on(&#x27;addSong&#x27;, (queue, song) =>&#xA;    queue.textChannel.send({&#xA;      embeds: [&#xA;        new Discord.EmbedBuilder()&#xA;          .setTitle(&#x27;Song added to the queue&#x27;)&#xA;          .setDescription(`${song.name} - \`${song.formattedDuration}\`\n\nRequested by: \`${song.user.tag}\``)&#xA;          .setThumbnail(`${song.thumbnail}`)&#xA;      ]&#xA;    })&#xA;  )&#xA;  .on(&#x27;addList&#x27;, (queue, playlist) =>&#xA;    queue.textChannel.send({&#xA;      embeds: [&#xA;        new Discord.EmbedBuilder()&#xA;          .setTitle(`Playlist added to the queue`)&#xA;          .setDescription(`\`${playlist.name}\` (${&#xA;            playlist.songs.length&#xA;          } songs)\n${status(queue)}\n\nRequested by: \`${song.user.tag}\``)&#xA;          .setThumbnail(`${song.thumbnail}`)&#xA;      ]&#xA;    })&#xA;  )&#xA;  .on(&#x27;error&#x27;, (channel, e) => {&#xA;    if (channel) channel.send(`An error encountered: ${e.toString().slice(0, 1974)}`)&#xA;    else console.error(e)&#xA;  })&#xA;  .on(&#x27;empty&#x27;, channel => channel.send(&#x27;There is no one here. Im alone, again...&#x27;))&#xA;  .on(&#x27;searchNoResult&#x27;, (message, query) =>&#xA;    message.channel.send(`No result found for \`${query}\`!`)&#xA;  )&#xA;  .on(&#x27;finish&#x27;, queue => queue.textChannel.send("https://tenor.com/view/end-thats-all-folks-gif-10601784"))&#xA;&#xA;client.on("ready", () => {&#xA;  client.user.setPresence({&#xA;      activities: [{&#xA;        name: &#x27;AURORA&#x27;,&#xA;        type: ActivityType.Listening&#xA;      }],&#xA;      status: "idle"&#xA;  })&#xA;})&#xA;&#xA;client.login(process.env.TOKEN)&#xA;

    &#xA;

    It does come from my ffpmeg, I need to install one of these packages instead of the npm installation : https://github.com/BtbN/FFmpeg-Builds/releases

    &#xA;

    How do I install it on a server (Vultr) ?

    &#xA;