Recherche avancée

Médias (2)

Mot : - Tags -/kml

Autres articles (77)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, 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 (...)

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

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (4188)

  • How to write a unit test class that creates a new process in C#

    12 mars 2023, par IceAge

    I have a question about how to write unit test method that creates a new process.

    


    At the moment I write a normal unit test to create a process, but it's very difficult to setup.

    


    This is my code I want to test.

    


    using System;&#xA;using System.Collections.Generic;&#xA;using System.Diagnostics;&#xA;using System.IO;&#xA;using System.Linq;&#xA;using System.Text;&#xA;using System.Text.RegularExpressions;&#xA;using System.Threading.Tasks;&#xA;&#xA;namespace xxx&#xA;{&#xA;    public class FFmPeg&#xA;    {&#xA;        private Process _process;&#xA;        private string ffmpegPath { get; set; }&#xA;        private Regex _durationRegex;&#xA;&#xA;        public event EventHandler<string> OutputData;&#xA;        public event EventHandler<int> ProgressChange;&#xA;&#xA;        public FFmPeg()&#xA;        {&#xA;            _process = new Process();&#xA;            ffmpegPath = Path.Combine(Directory.GetCurrentDirectory(), "engine", "ffmpeg.exe");&#xA;        }&#xA;&#xA;        public void Run(string Argument)&#xA;        {&#xA;            _process.StartInfo.FileName = ffmpegPath;&#xA;            _process.StartInfo.Arguments = $"{Argument} -y";&#xA;            _process.StartInfo.UseShellExecute = false;&#xA;            _process.StartInfo.RedirectStandardOutput = true;&#xA;            _process.StartInfo.RedirectStandardError = true;&#xA;            _process.StartInfo.StandardOutputEncoding = Encoding.UTF8;&#xA;            _process.StartInfo.CreateNoWindow = true;&#xA;            _process.OutputDataReceived &#x2B;=(o,e) =>&#xA;                     {&#xA;                     };&#xA;            _process.ErrorDataReceived &#x2B;= (o, e) =>&#xA;            {&#xA;                if (string.IsNullOrEmpty(e.Data) == false)&#xA;                {&#xA;                    OnProgressChange(OutputExtractor.GetProgress(e.Data));&#xA;                }//end if.check data is not empty&#xA;            };&#xA;&#xA;            _process.Start();&#xA;            _process.BeginOutputReadLine();&#xA;            _process.BeginErrorReadLine();&#xA;            _process.WaitForExit();&#xA;        } //end method&#xA;&#xA;        protected virtual void OnProgressChange(int progress)&#xA;        {&#xA;            ProgressChange?.Invoke(this,progress);&#xA;        } //end method&#xA;&#xA;        protected virtual void OnOutputData(string data)&#xA;        {&#xA;            OutputData?.Invoke(this, data);&#xA;        }&#xA;    }&#xA;}&#xA;</int></string>

    &#xA;

    Thanks for any helpful answers, and sorry for my English.

    &#xA;

  • Assertion error when encoding video using ffmpeg library on visual studio c++

    18 juin 2015, par Leon Phan

    I have a project, that i need to received data from a rtsp link, decode,resize video, encode it and save to .mp4 file.

    this is my code :

    AVPacket destPacket;
    av_init_packet(&amp;destPacket);
    destPacket.data = NULL;
    destPacket.size = 0;
    while(av_read_frame(i_format_context, &amp;packet)>=0) {
       if(packet.stream_index==video_stream_index) {
           int rest = avcodec_decode_video2(copyInputCodec, pFrame, &amp;frameFinished, &amp;packet);
           if(frameFinished) {
               av_init_packet(&amp;destPacket);
               destPacket.data = NULL;
               destPacket.size = 0;
               av_free_packet(&amp;destPacket);
               //deocde here
               int ret_scale = sws_scale(sws_ctx,pFrame->data,pFrame->linesize,0,copyInputCodec->height,encodeFrame->data,encodeFrame->linesize);
               encodeFrame->pts=i;
               int ret_enc = avcodec_encode_video2(copyOutputCodec,&amp;destPacket,encodeFrame,&amp;encodeFinishsed);//&lt;--- Problem here.
               getchar();
           }
       }
    }

    And this is output error

    [swscaler @ 00607880] Warning : data is not aligned ! This can lead to a
    speedlo ss
    Assertion avctx->codec->encode2 failed at /home/kyle/software/ffmpeg/source/ffmp
    eg-git/libavcodec/utils.c:2134

    I try to run many sample code to encode video, the result is same.

    Thanks for help.

    PS : sorry about my English skill.

  • Windows - FFmpeg - How to map a jpg file to video stream 0:0 and include only audio stream 0:2 and not stream 0:1 and 0:2 together

    21 juin 2020, par slyfox1186

    I am trying to write a batch script that begins by extracting a thumbnail "Cover.jpg" from an mkv video. My end goal is to have this script recursively loop a folder full of videos to encode them all in one go.

    &#xA;&#xA;

    :: create cover art jpg&#xA;for %%G in (*.mkv) do (&#xA;%FF% -hide_banner -ss 30 -y -i "%%G" -vframes 1 -an Cover.jpg&#xA;)&#xA;

    &#xA;&#xA;

    Then I am trying to encode the 4K mkv video that I got the jpg thumbnail from to 1920x1080 resolution instead of it's native 4K to make it easier to play back on my home plex server.

    &#xA;&#xA;

    I have surround sound 6 channel speaker system so I want to take audio stream 0:2 which is Dolby DTS 6 channel and save some HDD space by converting it to -c:a ac3 -b:a 640k -ac 6.

    &#xA;&#xA;

    I have gotten stuck because I can achieve everything I want except I keep encoding 2 of the 4 audio streams available in the end. I only want to keep 1 audio stream to maximize my space savings.

    &#xA;&#xA;

    Here is the entire script so far.

    &#xA;&#xA;

    @echo off&#xA;setlocal enabledelayedexpansion&#xA;prompt $g&#xA;color 0a&#xA;&#xA;pushd "%~dp0"&#xA;&#xA;set FF=C:\MAB\local64\bin-video\ffmpeg.exe&#xA;set TITLE=MOVIETITLE&#xA;&#xA;:: create cover art jpg file&#xA;for %%G in (*.mkv) do (&#xA;%FF% -hide_banner -ss 30 -y -i "%%G" -vframes 1 -an Cover.jpg&#xA;)&#xA;&#xA;:: run ffmpeg x265&#xA;for %%I in (*.mkv) do (&#xA;set fname="%%~nxI"&#xA;set fout="%%~nI-temp.mkv"&#xA;call :runff !fname! !fout!&#xA;del /s /q *.jpg&#xA;pause&#xA;goto:eof&#xA;)&#xA;&#xA;:runff&#xA;%FF% -ss 0 ^&#xA;-y ^&#xA;-i "%~1" ^&#xA;-attach "Cover.jpg" ^&#xA;-map_metadata 0 ^&#xA;-map_chapters 0 ^&#xA;-metadata title="%TITLE%" ^&#xA;-map 0:0 -metadata:s:v:0 language=eng ^&#xA;-map 0:2 -metadata:s:a:0 language=eng -metadata:s:a:0 title="Surround 5.1 (DTS)" ^&#xA;-map 0:3 -metadata:s:s:0 language=eng -metadata:s:s:0 title="English" -metadata:s:t:0 filename="Cover.jpg" -metadata:s:t:0 mimetype="image/jpeg" ^&#xA;-c:v libx265 -preset medium ^&#xA;-x265-params crf=18:qcomp=0.8:aq-mode=1:aq_strength=1.0:qg-size=16:psy-rd=0.7:psy-rdoq=5.0:rdoq-level=1:merange=44 ^&#xA;-c:a ac3 -b:a 640k -ac 6 ^&#xA;-t 3 ^&#xA;"%~2"&#xA;exit /b&#xA;

    &#xA;&#xA;

    Here are the output logs. https://pastebin.com/hVMy3VJW

    &#xA;&#xA;

    You can see towards the bottom that it is encoding both audio streams.

    &#xA;&#xA;

    Any ideas guys ?

    &#xA;