
Recherche avancée
Autres articles (56)
-
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 (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (8165)
-
ffmpeg -var_stream_map Invalid keyval "v:0
22 septembre 2020, par rmrf flythe ffmpeg command is correct,


use ffmpeg command execute at command line is ok,


int windows10 use java exec the command is ok ,


by only in linux when i use java exec the ffmpeg command throw expection


the command :


ffmpeg -i /data/vsftpd/Anchor.mp4 -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" -hls_segment_filename 'file_%v_%03d.ts' out_%v.m3u8





[hls @ 0xd31b5c0] Invalid keyval "v:0
[hls @ 0xd31b5c0] Variant stream info update failed with status ffffffea
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument



jar


<dependency>
 <groupid>org.apache.commons</groupid>
 <artifactid>commons-exec</artifactid>
 <version>1.3</version>
</dependency>



java code


public static int exeCommand(String command, OutputStream out) throws ExecuteException, IOException {
 CommandLine commandLine = CommandLine.parse(command);
 PumpStreamHandler pumpStreamHandler = null;
 if (null == out) {
 pumpStreamHandler = new PumpStreamHandler();
 } else {
 pumpStreamHandler = new PumpStreamHandler(out);
 }

 // time out 10s
 ExecuteWatchdog watchdog = new ExecuteWatchdog(10000);

 DefaultExecutor executor = new DefaultExecutor();
 executor.setStreamHandler(pumpStreamHandler);
 //executor.setWatchdog(watchdog);

 return executor.execute(commandLine);
}



-
Ffmpeg H264_qsv encoder memory leak
12 août 2020, par ExpressingxI'm using
h264_qsv
encoder if available. If its available I'm scaling the frame toNV12


public AVFrame* GetOutputFrame(AVFrame* sourceFrame, AVPixelFormat targePixFmt)
 {
 AVPixelFormat sourcePixFmt = (AVPixelFormat)sourceFrame->format;

 if (_pConvertContext == null)
 {
 _pConvertContext = CreateContext(sourcePixFmt, targePixFmt);
 }

 if (_convertedFrameBufferPtr == IntPtr.Zero)
 {
 int buffSize = ffmpeg.av_image_get_buffer_size(targePixFmt, sourceFrame->width, sourceFrame->height, 1);
 _convertedFrameBufferPtr = Marshal.AllocHGlobal(buffSize);
 ffmpeg.av_image_fill_arrays(ref _dstData, ref _dstLinesize, (byte*)_convertedFrameBufferPtr, targePixFmt, sourceFrame->width, sourceFrame->height, 1);
 }

 return ScaleImage(_pConvertContext, sourceFrame, targePixFmt, _dstData, _dstLinesize);
 }



ScaleImage
. Here if I commend outav_buffer_alloc
I still get memory leak, but a lot less

private AVFrame* ScaleImage(SwsContext* ctx, AVFrame* sourceFrame, AVPixelFormat targePixelFormat, byte_ptrArray4 dstData, int_array4 dstLinesize)
 {
 var outFrame = ffmpeg.av_frame_alloc();

 int ret = ffmpeg.sws_scale(ctx, sourceFrame->data, sourceFrame->linesize, 0, sourceFrame->height, dstData, dstLinesize);

 if (ret < 0)
 //throw;

 var data = new byte_ptrArray8();
 data.UpdateFrom(dstData);
 var linesize = new int_array8();
 linesize.UpdateFrom(dstLinesize);

 outFrame->data = data;
 outFrame->linesize = linesize;
 outFrame->width = sourceFrame->width;
 outFrame->height = sourceFrame->height;
 outFrame->format = (int)targePixelFormat;
 //outFrame->buf[0] = ffmpeg.av_buffer_alloc(
 // ffmpeg.av_image_get_buffer_size(targePixelFormat, sourceFrame->width, sourceFrame->height, 1) + ffmpeg.AV_INPUT_BUFFER_PADDING_SIZE); ;

 return outFrame;
 }



After the frame is ready send to codec


private void EncodeFrameToFile(AVCodecContext* ctx, AVFrame* outFrame, int streamIndex)
 {
 _outPkt->stream_index = streamIndex;

 // let the encoder assume what should be the type
 if (outFrame != null)
 {
 outFrame->pict_type = AVPictureType.AV_PICTURE_TYPE_NONE;
 }

 int ret = ffmpeg.avcodec_send_frame(ctx, outFrame);

 if (ret < 0)
 {
 ffmpeg.av_packet_unref(_outPkt);
 return;
 }

 while (ret >= 0)
 {
 ret = ffmpeg.avcodec_receive_packet(ctx, _outPkt);

 if (ret == ffmpeg.AVERROR(ffmpeg.EAGAIN) || ret == ffmpeg.AVERROR_EOF)
 {
 ffmpeg.av_packet_unref(_outPkt);
 return;
 }

 if (ret < 0)
 {
 ffmpeg.av_packet_unref(_outPkt);
 ffmpeg.av_log(null, ffmpeg.AV_LOG_ERROR, "Error during encoding.");
 break;
 }

 int out_stream_index = _inputContext.GetStreamIndex(_outPkt->stream_index);
 AVStream* out_stream = _outputContext.OutputFormatContext->streams[out_stream_index];

 ffmpeg.av_packet_rescale_ts(_outPkt, ctx->time_base, out_stream->time_base);

 ret = ffmpeg.av_interleaved_write_frame(_outputContext.OutputFormatContext, _outPkt);

 if (ret < 0)
 {
 ffmpeg.av_packet_unref(_outPkt);
 ffmpeg.av_log(null, ffmpeg.AV_LOG_ERROR, "Error muxing packet.");
 break;
 }

 ffmpeg.av_packet_unref(_outPkt);
 }
 }



And when the frame is written to the file


ffmpeg.av_frame_free(&frame);



If I comment


ret = ffmpeg.avcodec_receive_packet(ctx, _outPkt);



The leak is gone. But of course no file. Any suggestions ? I'm using
ffmpeg 4.3.1


-
Discord BOT Music player : plays 3 songs at once
15 août 2020, par LaCalientaI am developing my Discord bot that plays music, I am using DSahrpPlus as a wrapper and got the bot mostly working


Commands get parsed corecly


using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;

using DSharpPlus;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities;
using DSharpPlus.VoiceNext;

using WolfBot.Attributes;
using WolfBot.Commands.Music;

namespace WolfBot.Commands
{
 class MusicCommands : BaseCommandModule
 {
 int SongID = 1;
 MusicPlayer player;
 [Command("join")]
 [RequirePermissionsCustom(Permissions.UseVoice)]
 public async Task Join(CommandContext ctx)
 {
 //Initialize music player
 player = new MusicPlayer(ctx);

 var vnext = ctx.Client.GetVoiceNext();

 var vnc = vnext.GetConnection(ctx.Guild);
 if (vnc != null)
 {
 await ctx.RespondAsync("Already connected in this guild.");
 throw new InvalidOperationException("Already connected in this guild.");
 }

 var chn = ctx.Member?.VoiceState?.Channel;
 if (chn == null)
 {
 await ctx.RespondAsync("You need to be in a voice channel.");
 throw new InvalidOperationException("You need to be in a voice channel.");
 }

 vnc = await vnext.ConnectAsync(chn);
 await ctx.RespondAsync(DiscordEmoji.FromName(ctx.Client, ":ok_hand:")); //-