Recherche avancée

Médias (2)

Mot : - Tags -/kml

Autres articles (99)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • 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és)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

Sur d’autres sites (10134)

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

    


  • java.io.IOException : Error running exec() Working Directory : null Environment : null FFmpeg Android merging mp3 and mp4

    26 mai 2023, par 1234567

    java.io.IOException : Error running exec() Working Directory : null Environment : null FFmpeg Android merging mp3 and mp4

    



    I am trying following code

    



    public class Minact1 extends Activity{
    String  videoFilePath,audioFilePath,outputFilePath;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.mainact);
        videoFilePath = Environment.getExternalStorageDirectory()
                .getAbsolutePath() + "/sample2.mp4";
        audioFilePath = Environment.getExternalStorageDirectory()
                .getAbsolutePath() + "/abc.mp3";
        outputFilePath = Environment.getExternalStorageDirectory()
                .getAbsolutePath() + "/output.mp4";

        try {


            FFmpeg ffmpeg = FFmpeg.getInstance(this);
            String[] cmd =
                    {"-i " + videoFilePath + " -i " + audioFilePath +
                            " -shortest -threads 0 -preset ultrafast -strict -2 " + outputFilePath};

            ffmpeg.execute(cmd, mergeListener);
        } catch (FFmpegCommandAlreadyRunningException e) {
            e.printStackTrace();

            Toast.makeText(Minact1.this, "" +  e, Toast.LENGTH_SHORT).show();
        }
    }

    ExecuteBinaryResponseHandler mergeListener = new ExecuteBinaryResponseHandler() {
        @Override
        public void onStart() {
            //started
            Toast.makeText(Minact1.this, "started", Toast.LENGTH_SHORT).show();
        }

        @Override
        public void onFailure(String message) {
            //failed
            Toast.makeText(Minact1.this, "failed", Toast.LENGTH_SHORT).show();
        }

        @Override
        public void onFinish() {
            File output = new File(outputFilePath);
            //Do whatever with your muxed file

            Toast.makeText(Minact1.this, "onFinish", Toast.LENGTH_SHORT).show();
        }
    };
}


    



    I have used following library for FFmpeg

    



    dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'

    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:design:23.1.1'
    compile 'com.writingminds:FFmpegAndroid:0.3.2'

    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'commons-io:commons-io:2.5'
}


    



    and added following permission in manifest

    



    
    


    



    the files are present at the path used , but output.mp4 is not created

    



    the log says

    



    04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg: Exception while trying to run: [Ljava.lang.String;@3fe418b2
04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg: java.io.IOException: Error running exec(). Command: [/data/data/com.ffmpegtryer/files/ffmpeg, -i /storage/sdcard0/sample2.mp4 -i /storage/sdcard0/abc.mp3 -shortest -threads 0 -preset ultrafast -strict -2 /storage/sdcard0/output.mp4] Working Directory: null Environment: null
04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg:     at java.lang.ProcessManager.exec(ProcessManager.java:211)
04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg:     at java.lang.Runtime.exec(Runtime.java:173)
04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg:     at java.lang.Runtime.exec(Runtime.java:128)
04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg:     at com.github.hiteshsondhi88.libffmpeg.ShellCommand.run(ShellCommand.java:10)
04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg:     at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:38)
04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg:     at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:10)
04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg:     at android.os.AsyncTask$2.call(AsyncTask.java:288)
04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg:     at java.lang.Thread.run(Thread.java:818)
04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg:  Caused by: java.io.IOException: No such file or directory
04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg:     at java.lang.ProcessManager.exec(Native Method)
04-23 10:43:39.278 27191-27216/com.ffmpegtryer E/FFmpeg:     at java.lang.ProcessManager.exec(ProcessManager.java:209)


    



    any help would be useful

    


  • Dynamically created QImage frames to ffmpeg stdin using QThread

    11 mai 2021, par musicamante

    I am trying to create video files with ffmpeg using frames dynamically created on a separate thread.

    


    While I can create those frames and store them on disk/memory, I'd like to avoid that passage since the amount/size of the frames can be high and many "jobs" could be created with different format or options. But, also importantly, I'd like to better understand the logic behind this, as I admit I've not a very deep knowledge on how thread/processing actually works.

    


    Right now I'm trying to create the QProcess in the QThread object, and then run the image creation thread as soon as the process is started, but it doesn't seem to work : no file is created, and I don't even get any output from standard error (but I know I should, since I can get it if I don't use the thread).

    


    Unfortunately, due to my little knowledge on how QProcess deals with threads and piping (and, obviously, all possible ffmpeg options), I really don't understand how can achieve this.

    


    Besides obviously getting the output file created, the expected result is to be able to launch the encoding (and possibly queue more encodings in the meantime) while keeping the UI responding and get notifications of the current processing state.

    


    import re&#xA;from PyQt5 import QtCore, QtGui, QtWidgets&#xA;&#xA;logRegExp = r&#x27;(?:(n:\s&#x2B;)(?P\d&#x2B;)\s).*(?:(pts_time:\s*)(?P<time>\d&#x2B;.\d*))&#x27;&#xA;&#xA;class Encoder(QtCore.QThread):&#xA;    completed = QtCore.pyqtSignal()&#xA;    frameDone = QtCore.pyqtSignal(object)&#xA;    def __init__(self, width=1280, height=720, frameCount=100):&#xA;        super().__init__()&#xA;        self.width = width&#xA;        self.height = height&#xA;        self.frameCount = frameCount&#xA;&#xA;    def start(self):&#xA;        self.currentLog = &#x27;&#x27;&#xA;        self.currentData = bytes()&#xA;        self.process = QtCore.QProcess()&#xA;        self.process.setReadChannel(self.process.StandardError)&#xA;        self.process.finished.connect(self.completed)&#xA;        self.process.readyReadStandardError.connect(self.stderr)&#xA;        self.process.started.connect(super().start)&#xA;        self.process.start(&#x27;ffmpeg&#x27;, [&#xA;            &#x27;-y&#x27;, &#xA;            &#x27;-f&#x27;, &#x27;png_pipe&#x27;, &#xA;            &#x27;-i&#x27;, &#x27;-&#x27;, &#xA;            &#x27;-c:v&#x27;, &#x27;libx264&#x27;, &#xA;            &#x27;-b:v&#x27;, &#x27;800k&#x27;, &#xA;            &#x27;-an&#x27;, &#xA;            &#x27;-vf&#x27;, &#x27;showinfo&#x27;,&#xA;            &#x27;/tmp/test.h264&#x27;, &#xA;        ])&#xA;&#xA;    def stderr(self):&#xA;        self.currentLog &#x2B;= str(self.process.readAllStandardError(), &#x27;utf-8&#x27;)&#xA;        *lines, self.currentLog = self.currentLog.split(&#x27;\n&#x27;)&#xA;        for line in lines:&#xA;            print(&#x27;STDERR: {}&#x27;.format(line))&#xA;            match = re.search(logRegExp, line)&#xA;            if match:&#xA;                data = match.groupdict()&#xA;                self.frameDone.emit(int(data[&#x27;frame&#x27;]))&#xA;&#xA;    def run(self):&#xA;        font = QtGui.QFont()&#xA;        font.setPointSize(80)&#xA;        rect = QtCore.QRect(0, 0, self.width, self.height)&#xA;        for frame in range(1, self.frameCount &#x2B; 1):&#xA;            img = QtGui.QImage(QtCore.QSize(self.width, self.height), QtGui.QImage.Format_ARGB32)&#xA;            img.fill(QtCore.Qt.white)&#xA;            qp = QtGui.QPainter(img)&#xA;            qp.setFont(font)&#xA;            qp.setPen(QtCore.Qt.black)&#xA;            qp.drawText(rect, QtCore.Qt.AlignCenter, &#x27;Frame {}&#x27;.format(frame))&#xA;            qp.end()&#xA;            img.save(self.process, &#x27;PNG&#x27;)&#xA;        print(&#x27;frame creation complete&#x27;)&#xA;&#xA;&#xA;class Test(QtWidgets.QWidget):&#xA;    def __init__(self):&#xA;        super().__init__()&#xA;        layout = QtWidgets.QVBoxLayout(self)&#xA;        self.startButton = QtWidgets.QPushButton(&#x27;Start&#x27;)&#xA;        layout.addWidget(self.startButton)&#xA;&#xA;        self.frameLabel = QtWidgets.QLabel()&#xA;        layout.addWidget(self.frameLabel)&#xA;&#xA;        self.process = Encoder()&#xA;        self.process.completed.connect(lambda: self.startButton.setEnabled(True))&#xA;        self.process.frameDone.connect(self.frameLabel.setNum)&#xA;        self.startButton.clicked.connect(self.create)&#xA;&#xA;    def create(self):&#xA;        self.startButton.setEnabled(False)&#xA;        self.process.start()&#xA;&#xA;&#xA;import sys&#xA;app = QtWidgets.QApplication(sys.argv)&#xA;test = Test()&#xA;test.show()&#xA;sys.exit(app.exec_())&#xA;</time>

    &#xA;

    If I add the following lines at the end of run(), then the file is actually created and I get the stderr output, but I can see that it's processed after the completion of the for cycle, which obviously is not the expected result :

    &#xA;

        self.process.closeWriteChannel()&#xA;    self.process.waitForFinished()&#xA;    self.process.terminate()&#xA;

    &#xA;

    Bonus : I'm on Linux, I don't know if it works differently on Windows (and I suppose it would work similarly on MacOS), but in any case I'd like to know if there are differences and how to possibly deal with them.

    &#xA;