
Recherche avancée
Médias (91)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
-
avec chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
sans chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
config chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
Autres articles (102)
-
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
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 (...) -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
Sur d’autres sites (9434)
-
Adding a Skip Command to Discord.Net
16 août 2017, par ComedicChimeraI have a music bot for my Discord server, that is running on Discord.Net and I am trying to implement a skip feature for my bot. Because of the way I have my bot setup, all I need to do is end the current stream to skip. The problem is I can’t figure out how to do that without causing an exception or some other error. Here is my code for playing. (create stream returns an ffmpeg process)
var output = CreateStream(url).StandardOutput.BaseStream;
Music.stream = Music.client.CreatePCMStream(AudioApplication.Music);
await output.CopyToAsync(Music.stream);
await Music.stream.FlushAsync().ConfigureAwait(false);And the FFMPEG code :
private Process CreateStream(string path)
{
return Process.Start(new ProcessStartInfo
{
FileName = "ffmpeg.exe",
Arguments = $"-hide_banner -loglevel panic -i \"{path}\" -ac 2 -f s16le -ar 48000 pipe:1",
UseShellExecute = false,
RedirectStandardOutput = true
});
}Music is a public class that just holds a bunch of variables so other methods can access them. (as module base is abstract)
-
FFmpeg not decoding all video with hw_device
29 avril 2021, par AdamFullI am trying to figure out hardware decoding in ffmpeg in c ++. I get about the same errors on any api.
Here is the initialization code :



 AVHWDeviceType devType = av_hwdevice_find_type_by_name(HW_DECODER_NAME);

 for (int i = 0;; i++)
 {
 const AVCodecHWConfig *config = avcodec_get_hw_config(av_codec, i);
 if (!config)
 {
 fprintf(stderr, "Decoder %s does not support device type %s.\n",
 av_codec->name, av_hwdevice_get_type_name(devType));
 return false;
 }

 if (config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX && config->device_type == devType)
 {
 hw_pix_fmt = config->pix_fmt;
 break;
 }
 }

 hw_device_ctx = av_hwdevice_ctx_alloc(devType);

 *av_codec_ctx = avcodec_alloc_context3(av_codec);
 if (!av_codec_ctx)
 {
 printf("Couldn't create AVCodecContext\n");
 return false;
 }

 if (avcodec_parameters_to_context(*av_codec_ctx, av_codec_params) < 0)
 {
 printf("Couldn't initialize AVCodecContext\n");
 return false;
 }

 (*av_codec_ctx)->get_format = get_hw_format;

 //Initialize hardware context
 int err = 0;
 if ((err = av_hwdevice_ctx_create(&hw_device_ctx, devType, NULL, NULL, 0)) < 0)
 {
 fprintf(stderr, "Failed to create specified HW device.\n");
 return false;
 }

 (*av_codec_ctx)->hw_device_ctx = av_buffer_ref(hw_device_ctx);

 if (avcodec_open2(*av_codec_ctx, av_codec, NULL) < 0)
 {
 printf("Couldn't open codec\n");
 return false;
 }

 b_is_initialized = true;




Here is the decoder code :


int response;

 response = avcodec_send_packet(av_codec_ctx, av_packet);
 if (response < 0)
 {
 printf("Couldn't send video frame to decoder.\n");
 print_error(response);
 return false;
 }

 realloc_frame(&av_frame);

 response = avcodec_receive_frame(av_codec_ctx, av_frame);
 if (response == AVERROR(EAGAIN) || response == AVERROR_EOF)
 {
 av_frame_free(&av_frame);
 return false;
 }
 else if (response < 0)
 {
 print_error(response);
 return false;
 }

 if(hwdecoder.is_initialized())
 {
 if(!hwdecoder.decode(av_packet, &av_frame))
 {
 printf("Failed while decoding frame on gpu.\n");
 }
 }

 pts = av_frame->pts;

 // Set up sws scaler
 if (!sws_scaler_ctx)
 {
 auto source_pix_fmt = correct_for_deprecated_pixel_format((AVPixelFormat)av_frame->format);
 //Send here frame params
 sws_scaler_ctx = sws_getContext(width, height, source_pix_fmt,
 width, height, AV_PIX_FMT_RGB0,
 SWS_BICUBIC, NULL, NULL, NULL);



Decoding on the processor works without problems, but when I decode on the gpu, it turns out to decode some part of the video and then during
avcodec_send_packet
I get the Invalid data found when processing the input error. Help please, I have been suffering for the second week.

EDIT


OP forgot about
hwdecoder.decode
method.

int ret = 0; 
realloc_frame(&sw_frame); 
if ((*av_frame)->format == hw_pix_fmt)
{ 
 if ((ret = av_hwframe_transfer_data(sw_frame, *av_frame, 0)) < 0) 
 { 
 fprintf(stderr, "Error transferring the data to system memory\n"); 
 av_frame_free(&sw_frame); 
 return false; 
 } 
} 



Error log :


Couldn't send video frame to decoder.
Invalid data found when processing input
[AVHWFramesContext @ 000001E44F6EC8C0] Static surface pool size exceeded.
[h264 @ 000001E445D60940] get_buffer() failed
[h264 @ 000001E445D60940] thread_get_buffer() failed
[h264 @ 000001E445D60940] decode_slice_header error
[h264 @ 000001E445D60940] no frame!



My code based on this example : https://ffmpeg.org/doxygen/4.0/hw_decode_8c-example.html


On windows i used dxva2 device, configure project with cmake 3.9, and build with MSVC amd64.
On linux i used vdpau device, compiled from source ffmpeg libs, project was configured with cmake 3.9 and build with gcc 10


-
Calling FFmpeg from C# hangs the Process
18 octobre 2019, par Green TrainI’m trying to run ffmpeg command in C# :
processTrim = new Process();
processTrim.StartInfo.FileName = $"{WorkingDirectory}/ffmpeg.exe";
processTrim.StartInfo.WorkingDirectory = WorkingDirectory;
processTrim.StartInfo.Arguments = string.Format(@"-i ""{0}"" -ss 1 -i ""{0}"" -c copy -map 1:0 -map 0 -shortest -f nut - | ffmpeg -f nut -i - -map 0 -map -0:0 -c copy ""{1}""", $"input.mp4", $"trimmed.mp4");
processTrim.StartInfo.CreateNoWindow = false;
processTrim.StartInfo.UseShellExecute = false;
processTrim.EnableRaisingEvents = true;
processTrim.Start();
processTrim.WaitForExit(3000); // hangs here
processTrim.Close();However, the process hangs at
WaitForExit
. This is the output from the process window (doesn’t go beyond handler_name) :When I run the command in Windows command prompt it works, why wouldn’t it work in C# Process ?