Recherche avancée

Médias (91)

Autres articles (3)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Selection of projects using MediaSPIP

    2 mai 2011, par

    The examples below are representative elements of MediaSPIP specific uses for specific projects.
    MediaSPIP farm @ Infini
    The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

Sur d’autres sites (1720)

  • Adding chapters to MP4 files, and being identified on iOS 12 podcast app

    5 avril 2019, par Craig Francis

    I have an MP4 file, where I’ve added chapters via ffmpeg.

    But in the iOS 12 Podcasts app, from Apple, the chapters don’t appear. This should happen, as noted by idownloadblog.com

    Preview of how Chapters should look in iOS

    In comparison, when using QuickLook on MacOS, the list of chapters can be seen by clicking the chapters button (in the bottom right hand side of the window).

    Preview of QuickLook in MacOS

    And opening in QuickTime Player, while there isn’t a list of chapters to view, you can use the "View > Next Chapter" menu item.

    So I’m assuming this is a bug in iOS... but I’m wondering if there is another way to add chapters ? or if I’ve made a mistake ?


    My current process is to create a "ffmetadata" file, as noted in the ffmpeg documentation :

    ;FFMETADATA1
    title=Example

    [CHAPTER]
    TIMEBASE=1/1000
    START=0
    END=221913
    title=Chapter 1

    [CHAPTER]
    TIMEBASE=1/1000
    START=221913
    END=1169241
    title=Chapter 2

    https://ffmpeg.org/ffmpeg-formats.html#Metadata-1

    Then I’ve tried each of the following commands :

    ffmpeg -i 2019-01-02.mp4 -i 2019-01-02.meta -map_metadata 1 -codec copy 2019-01-02-chapters.mp4
    ffmpeg -i 2019-01-02.mp4 -i 2019-01-02.meta -map_metadata 1 2019-01-02-chapters.mp4
    ffmpeg -i 2019-01-02.mp4 -i 2019-01-02.meta -map_metadata 1 2019-01-02-chapters.mp3
    • The first one is from the ffmpeg documentation, where -codec copy means the audio file is not re-encoded.
    • The second one takes longer, while it re-encodes the audio data.
    • The third one requires re-encoding to convert it into an MP3 file (which uses ID3 tags for the chapter data).

    On a slightly unrelated note, the third party app "RSSRadio" does list the chapters, but the feature added in version 4 that allows you to "skip directly to the start of the next chapter", if the next chapter starts within the next 3 minutes, does not seem to work.

  • Need Help Making Java Script Discord Music Bot

    22 octobre 2018, par Gambino

    I have tried to use this code to make a discord music bot but i am getting error telling me i need ffmpeg, but how would I implement it into this code ?

    index.js file

    const Discord = require('discord.js');
    const bot = new Discord.Client();
    const config = require("./config.json");
    const ytdl = require('ytdl-core');

    var youtube = require('./youtube.js');


    var ytAudioQueue = [];
    var dispatcher = null;

    bot.on('message', function(message) {
       var messageParts = message.content.split(' ');
       var command = messageParts[0].toLowerCase();
       var parameters = messageParts.splice(1, messageParts.length);

       switch (command) {

           case "-join" :
           message.reply("Attempting to join channel " + parameters[0]);
           JoinCommand(parameters[0], message);
           break;
       
           case "-play" :
           PlayCommand(parameters.join(" "), message);
           break;

           case "-playqueue":
           PlayQueueCommand(message);
           break;
       }
    });


       function PlayCommand(searchTerm) {
           if(bot.voiceConnections.array().length == 0) {
               var defaultVoiceChannel = bot.channels.find(val => val.type === 'voice').name;
               JoinCommand(defaultVoiceChannel);
           }
           youtube.search(searchTerm, QueueYtAudioStream);
       }

       function PlayQueueCommand(message) {
           var queueString = "";

           for(var x = 0; x < ytAudioQueue.length; x++) {
               queueString += ytAudioQueue[x].videoName + ", ";
           }
           queueString = queueString.substring(0, queueString.length - 2);
           message.reply(queueString);
       }

       function JoinCommand(ChannelName) {
           var voiceChannel = GetChannelByName(ChannelName);

           if (voiceChannel) {
               voiceChannel.join();
               console.log("Joined " + voiceChannel.name);
           }
           
           return voiceChannel;
           
       }

       /* Helper Methods */

       function GetChannelByName(name) {
           var channel = bot.channels.find(val => val.name === name);
           return channel;
       }

     

       function QueueYtAudioStream(videoId, videoName) {
           var streamUrl = youtube.watchVideoUrl + videoId;

           if (!ytAudioQueue.length) {
               ytAudioQueue.push(
                   {
                       'streamUrl' : streamUrl,
                       'videoName' : videoName
                   }
               );
               console.log('Queued audio ' + videoName);
               PlayStream(ytAudioQueue[0].streamUrl);
           }
           else {
               ytAudioQueue.push(
                   {
                       'streamUrl' : streamUrl,
                       'videoName' : videoName
                   }
               );
           }
           console.log("Queued audio " + videoName);
       }

       function PlayStream(streamUrl) {
           const streamOptions = {seek: 0, volume: 1};

           if (streamUrl) {
               const stream = ytdl(streamUrl, {filter: 'audioonly'});

               if (dispatcher == null) {
                   var voiceConnection = bot.voiceConnections.first();

                   if(voiceConnection) {
                       console.log("Now Playing " + ytAudioQueue[0].videoname);
                       dispatcher = bot.voiceConnections.first().playStream(stream, streamOptions);

                       dispatcher.on('end', () => {
                           dispatcher = null;
                           PlayNextStreamInQueue();
                       });

                       dispatcher.on('error', (err) => {
                           console.log(err);
                       });
                   }
               } else {
                   dispatcher = bot.voiceConnections.first().playStream(stream, streamOptions);
               }
               
           }
       }

       function PlayNextStreamInQueue() {
           ytAudioQueue.splice(0, 1);

           if (ytAudioQueue.length != 0) {
               console.log("now Playing " + ytAudioQueue[0].videoName);
               PlayStream(ytAudioQueue[0].streamUrl);
           }
       }


    bot.login(config.token);

    youtube.js file

    var request = require('superagent');

    const API_KEY = "My API KEY";
    const WATCH_VIDEO_URL = "https://www.youtube.com/watch?v=";

    exports.watchVideoUrl = WATCH_VIDEO_URL;

    exports.search = function search(searchKeywords, callback) {
     var requestUrl = 'https://www.googleapis.com/youtube/v3/search' + '?part=snippet&q=' + escape(searchKeywords) + '&key=' + API_KEY;

     request(requestUrl, (error, response) => {
       if (!error && response.statusCode == 200) {

         var body = response.body;
         if (body.items.length == 0) {
           console.log("I Could Not Find Anything!");
           return;
         }
         for (var item of body.items) {
           if (item.id.kind == 'youtube#video') {
             callback(item.id.videoId, item.snippet.title);
             return;
           }
         }
       } else {
         console.log("Unexpected error!");
         return;
       }
     });

     return;

    };

    Error I am getting when I try to run code :

    Joined General

    C :\Discord Bot\node_modules\discord.js\src\client\voice\pcm\FfmpegConverterEngine.

    js:80

    throw new Error(

    ^

    Error : FFMPEG was not found on your system, so audio cannot be played. Please make
    sure FFMPEG is installed and in your PATH.

  • Python Youtube ffmpeg Session Has Been Invalidated

    14 août 2020, par Daniel

    I get the following error while I'm playing YouTube audio with my bot

    



    [tls @ 0000024ef8c4d480] Error in the pull function.
[matroska,webm @ 0000024ef8c4a400] Read error
[tls @ 0000024ef8c4d480] The specified session has been invalidated for some reason.
    Last message repeated 1 times


    



    It seems like YouTube links expire ? I don't really know but I need to fix this issue. This is my code :

    



        class YTDLSource(discord.PCMVolumeTransformer):

        def __init__(self, source, *, data, requester):
            super().__init__(source)
            self.requester = requester

            self.title = data['title']
            self.description = data['description']
            self.uploader = data['uploader']
            self.duration = data['duration']
            self.web_url = data['webpage_url']
            self.thumbnail = data['thumbnail']

        def __getitem__(self, item: str):
            return self.__getattribute__(item)

        @classmethod
        async def create_source(cls, ctx, player, search: str, *, loop, download=True):
            async with ctx.typing():
                loop = loop or asyncio.get_event_loop()
                to_run = partial(ytdl.extract_info, url=search, download=download)
                raw_data = await loop.run_in_executor(None, to_run)

                if 'entries' in raw_data:
                    # take first item from a playlist
                    if len(raw_data['entries']) == 1:
                        data = raw_data['entries'][0]
                    else:
                        data = raw_data['entries']
                        #loops entries to grab each video_url
                        total_duration = 0
                        try:
                            for i in data:
                                webpage = i['webpage_url']
                                title = i['title']
                                description = i['description']
                                uploader = i['uploader']
                                duration = i['duration']
                                thumbnail = i['thumbnail']
                                total_duration += duration

                                if download:
                                    source = ytdl.prepare_filename(i)
                                    source = cls(discord.FFmpegPCMAudio(source), data=i, requester=ctx.author)
                                else:
                                    source = {'webpage_url': webpage, 'requester': ctx.author, 'title': title, 'uploader': uploader, 'description': description, 'duration': duration, 'thumbnail': thumbnail}

                                player.queue.append(source)

                        except Exception as e:
                            print(e)
                            return

                        embed=discord.Embed(title="Playlist", description="Queued", color=0x30a4fb, timestamp=datetime.now(timezone.utc))
                        embed.set_author(name=ctx.author.display_name, icon_url=ctx.author.avatar_url)
                        embed.set_thumbnail(url=data[0]['thumbnail'])
                        embed.add_field(name=raw_data['title'], value=f"{len(data)} videos queued.", inline=True)
                        embed.set_footer(text=raw_data["uploader"] + ' - ' + '{0[0]}m {0[1]}s'.format(divmod(total_duration, 60)))
                        await ctx.send(embed=embed)
                        return

                embed=discord.Embed(title="Playlist", description="Queued", color=0x30a4fb, timestamp=datetime.now(timezone.utc))
                embed.set_author(name=ctx.author.display_name, icon_url=ctx.author.avatar_url)
                embed.set_thumbnail(url=data['thumbnail'])
                embed.add_field(name=data['title'], value=(data["description"][:72] + (data["description"][72:] and '...')), inline=True)
                embed.set_footer(text=data["uploader"] + ' - ' + '{0[0]}m {0[1]}s'.format(divmod(data["duration"], 60)))
                await ctx.send(embed=embed)

                if download:
                    source = ytdl.prepare_filename(data)
                else:
                    source = {'webpage_url': data['webpage_url'], 'requester': ctx.author, 'title': data['title'], 'uploader': data['uploader'], 'description': data['description'], 'duration': data['duration'], 'thumbnail': data['thumbnail']}
                    player.queue.append(source)
                    return

                source = cls(discord.FFmpegPCMAudio(source), data=data, requester=ctx.author)
                player.queue.append(source)


        @classmethod
        async def regather_stream(cls, data, *, loop):
            loop = loop or asyncio.get_event_loop()
            requester = data['requester']

            to_run = partial(ytdl.extract_info, url=data['webpage_url'], download=True)
            data = await loop.run_in_executor(None, to_run)

            return(cls(discord.FFmpegPCMAudio(data['url']), data=data, requester=requester))


    



    I'm using the rewrite branch of discord.py for the bot.
I'm not sure if I need to provide more details ? Please let me know, I really need to get this fixed...