
Recherche avancée
Médias (2)
-
Granite de l’Aber Ildut
9 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
Autres articles (99)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 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, parComme 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, parPour 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 DanielI 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 1234567java.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 musicamanteI 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
from PyQt5 import QtCore, QtGui, QtWidgets

logRegExp = r'(?:(n:\s+)(?P\d+)\s).*(?:(pts_time:\s*)(?P<time>\d+.\d*))'

class Encoder(QtCore.QThread):
 completed = QtCore.pyqtSignal()
 frameDone = QtCore.pyqtSignal(object)
 def __init__(self, width=1280, height=720, frameCount=100):
 super().__init__()
 self.width = width
 self.height = height
 self.frameCount = frameCount

 def start(self):
 self.currentLog = ''
 self.currentData = bytes()
 self.process = QtCore.QProcess()
 self.process.setReadChannel(self.process.StandardError)
 self.process.finished.connect(self.completed)
 self.process.readyReadStandardError.connect(self.stderr)
 self.process.started.connect(super().start)
 self.process.start('ffmpeg', [
 '-y', 
 '-f', 'png_pipe', 
 '-i', '-', 
 '-c:v', 'libx264', 
 '-b:v', '800k', 
 '-an', 
 '-vf', 'showinfo',
 '/tmp/test.h264', 
 ])

 def stderr(self):
 self.currentLog += str(self.process.readAllStandardError(), 'utf-8')
 *lines, self.currentLog = self.currentLog.split('\n')
 for line in lines:
 print('STDERR: {}'.format(line))
 match = re.search(logRegExp, line)
 if match:
 data = match.groupdict()
 self.frameDone.emit(int(data['frame']))

 def run(self):
 font = QtGui.QFont()
 font.setPointSize(80)
 rect = QtCore.QRect(0, 0, self.width, self.height)
 for frame in range(1, self.frameCount + 1):
 img = QtGui.QImage(QtCore.QSize(self.width, self.height), QtGui.QImage.Format_ARGB32)
 img.fill(QtCore.Qt.white)
 qp = QtGui.QPainter(img)
 qp.setFont(font)
 qp.setPen(QtCore.Qt.black)
 qp.drawText(rect, QtCore.Qt.AlignCenter, 'Frame {}'.format(frame))
 qp.end()
 img.save(self.process, 'PNG')
 print('frame creation complete')


class Test(QtWidgets.QWidget):
 def __init__(self):
 super().__init__()
 layout = QtWidgets.QVBoxLayout(self)
 self.startButton = QtWidgets.QPushButton('Start')
 layout.addWidget(self.startButton)

 self.frameLabel = QtWidgets.QLabel()
 layout.addWidget(self.frameLabel)

 self.process = Encoder()
 self.process.completed.connect(lambda: self.startButton.setEnabled(True))
 self.process.frameDone.connect(self.frameLabel.setNum)
 self.startButton.clicked.connect(self.create)

 def create(self):
 self.startButton.setEnabled(False)
 self.process.start()


import sys
app = QtWidgets.QApplication(sys.argv)
test = Test()
test.show()
sys.exit(app.exec_())
</time>


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 :

self.process.closeWriteChannel()
 self.process.waitForFinished()
 self.process.terminate()



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.