
Recherche avancée
Autres articles (52)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)
Sur d’autres sites (6315)
-
PHP and ffmpeg - Converting to H.264 on the fly for JW Player
10 mai 2012, par vertigoelectricSo the project I'm working on has tons of MP4 files already on the server that need to be played in an embedded player. Ideally we'd like to use the JW Player which is already set up for most of the videos. Unfortunately, a lot of the older videos are MPEG-4 encoded and require additional plugins to play in the browser.
What I'd like to do is be able to transcode these videos on the fly to a format that JW Player supports, such as H.264. Now, I'm part way there because I can get it to convert the old MP4 files, but I'm having difficulty passing the data directly to the player.
This is my current script doing the converting (this is
media_converted.php
) :<?php
error_reporting(0);
if (!isset($_GET["MediaName"])) {
$_GET["MediaName"] = "GSX238";
}
require_once("php/media_center_functions.php");
$MediaURL = ConstructVideoURLInternap($_GET["MediaName"]);
header("Content-Transfer-Encoding: binary");
//header('Content-type: video/mp4');
//$calculatedFileSize = filesize($MediaURL);
//header("Content-Length: {$calculatedFileSize}");
$cmd = 'ffmpeg -i "'.$MediaURL.'" -vcodec libx264 -acodec copy -f mp4 -moov_size 32000 "_temp/'.time().'_temp.mp4" 2> _temp/media_converter_output.txt';
passthru($cmd);
?>I'm trying to take the above file and pass it to the JW Player as the video source : in the JW Player's variable scripting, like so :
so.addVariable('file','media_converted.php?MediaName=12345');
While I believe this should work, it's just not.
Even when the conversion seems to work and be sending to the player, it's hard to tell because I think the browser is trying to download the entire file before playing anything. Obviously I can't make the user wait like that.
I've looked into qt-faststart, and I was able to use it on my computer to modify the file so that it can start playing while it's being loaded. Unfortunately, this requires two steps. I first have to completely convert the file, then when it's done I have to use qt-faststart.exe on it. Again, this doesn't isn't really an on-the-fly solution. I'm sure there has to be some way to do produce similar results in a single command to be output to the player... right ?
There is more video data on the server than I currently have space for on my hard drive, so to permanently re-encode each video, even in batches, would be troublesome, because I'd have to download some, convert, reupload, download more, etc. If I have to do that, I will, but I would prefer to leave them as is and be able to transcode on the fly.
Any ideas ?
-
Code returns AttributeError : 'VoiceChannel' object has no attribute 'play' when running on Discloud
18 septembre 2023, par Sc4rl3ttfir3So, my code works fine when I run it locally, but even after adapting it to run on Discloud, it returns an error I can't solve.


Code :


@bot.command(name='play', help='To play song')
async def play(ctx, url):
 voice_channel = ctx.author.voice.channel

 if voice_channel is None:
 return await ctx.send('You are not connected to a voice channel.')

 async with ctx.typing():
 filename = await YTDLSource.from_url(url, loop=bot.loop)
 
 if ctx.voice_client is not None:
 ctx.voice_client.stop()

 source = discord.FFmpegPCMAudio(
 executable="ffmpeg",
 source=filename
 )
 
 voice_channel.play(source)

 await ctx.send('**Now playing:** {}'.format(filename))



When it runs on the Discloud server, it returns the following error/traceback message :


Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/discord/ext/commands/core.py", line 235, in wrapped
ret = await coro(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user_686208406444572830/Sc4rl3ttb0t.py", line 357, in play 
voice_channel.play(source)
^^^^^^^^^^^^^^^^^^
AttributeError: 'VoiceChannel' object has no attribute 'play'



Anybody with any idea of what is going wrong would be greatly appreciated for helping out


-
av_hwdevice_iterate_types returns an empty list
9 juillet 2020, par Ruslan AblyazovI used an example https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/hw_decode.c


The av_hwdevice_iterate_types function returns an empty list. What could be the reason ?


And
avcodec_find_decoder_by_name("h264_cuvid")
returns NULL.

FFmpeg version :


ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --enable-gpl --enable-ladspa --enable-libpulse --enable-libsoxr --enable-libspeex --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --enable-libass --enable-libfreetype --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-nonfree --disable-ffplay --enable-libxvid --enable-cuda --enable-cuda-nvcc --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100



The command
ffmpeg -c:v h264_cuvid -i 7.mp4 71.mp4
outputs :

...
Stream mapping:
Stream #0:0 -> #0:0 (h264 (h264_cuvid) -> h264 (libx264))
....



And it works.


The command
ffmpeg-hwaccel cuda-i 7.mp4 71.mp4
outputs :

...
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
....



The command
ffmpeg -codecs
outputs :

...
 DEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_cuvid ) (encoders: libx264 libx264rgb h264_nvenc h264_v4l2m2m nvenc nvenc_h264 )
 D.VIL. hap Vidvox Hap
 DEV.L. hevc H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc hevc_v4l2m2m hevc_cuvid ) (encoders: libx265 nvenc_hevc hevc_nvenc hevc_v4l2m2m )
 ...