Recherche avancée

Médias (1)

Mot : - Tags -/censure

Autres articles (107)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains 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 ;

  • Pas question de marché, de cloud etc...

    10 avril 2011

    Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
    sur le web 2.0 et dans les entreprises qui en vivent.
    Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
    Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
    le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
    Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)

Sur d’autres sites (28133)

  • Is it possible using FFMPEG to replace one ".ts" file in a HLS ts file collection with another ".ts" file ?

    27 juillet 2019, par Vadim

    There is a video, actually an HLS stream (sequence of TS files)
    I would like to take out one TS chunk and replace it with another.
    Another chunk will be encoded using same FFMPEG encoding settings.

    In case you wonder why i need this :
    There is a five hours HLS stream. One of TS has a wrong title on the video. I need to change that TS without re-encoding the whole HLS stream.

    Currently i tried :

    1. Take TS and convet it using FFMPEG into mp4
    2. Edit mp4 video (change title) and save as new mp4
    3. Convert new mp4 into new TS (using FFMPEG, same settings as was used for original video)
    4. Replace original TS with the new TS.

    But it doesn’t work, player shows loading in progress icon. (in the network console i see that this new TS is loaded normally, with status 200)

    As soon as i replace new TS with original one, player plays it normally.

    Both TS files start with I-frame, both have audio. There’s only a slight difference in the sequence of P and B frames.

    old new
    I   I
    P   P
    B   B
    B   B
    P   P
    B   B
    B   B
    B   B
    P   P
    B   B
    B   P
    B   B
    P   B
    P   B
    B   P

    How can i get new TS chunk working in original TS sequence ?

    Update :

    As per szatmary advice (below) i tried to include "-copyts" flag during all ts>mp4>ts conversions. Also tried "-copytb" flag with all 3 options -1, 0, and 1. However result still the same - player doesn’t play HLS TS sequence (m3u8) with new TS chunk.

    Adding "#EXT-X-DISCONTINUITY" tag after replaced TS in the M3U8 list, doesn’t fix the situation.

    Without "#EXT-X-DISCONTINUITY" tag, player gives error :

    VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) There appears to be a playback issue.

    code: 4
    message: "There appears to be a playback issue."

    __proto__:
    MEDIA_ERR_ABORTED: 1
    MEDIA_ERR_CUSTOM: 0
    MEDIA_ERR_DECODE: 3
    MEDIA_ERR_ENCRYPTED: 5
    MEDIA_ERR_NETWORK: 2
    MEDIA_ERR_SRC_NOT_SUPPORTED: 4
    code: 0
    message: ""
    status: null

    With "#EXT-X-DISCONTINUITY" tag, player gives error :

    VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) There appears to be a playback issue.

    code: 3
    message: "error"

    __proto__:
    MEDIA_ERR_ABORTED: 1
    MEDIA_ERR_CUSTOM: 0
    MEDIA_ERR_DECODE: 3
    MEDIA_ERR_ENCRYPTED: 5
    MEDIA_ERR_NETWORK: 2
    MEDIA_ERR_SRC_NOT_SUPPORTED: 4
    code: 0
    message: ""
    status: null

    Both TS files (old one and new one) have video and audio streams.

    Looks like something else should be done. I think solution will be similar to ad insertion.

  • Why i'm getting strange video file when using ffmpeg and pipes to create video file in real time ?

    30 juin 2015, par Brubaker Haim

    The goal here is to create a compressed mp4 video file in real time.
    I’m saving screenshots as bitmaps type on my hard disk.
    And i want to create mp4 file and compress the mp4 video file in real time.

    The problem is the end the video file i get looks very strange.
    This is the result : Strange Video File

    The class that i’m using the ffmpeg with arguments.

    using System;
    using System.Windows.Forms;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Drawing;
    using System.IO.Pipes;
    using System.Runtime.InteropServices;
    using System.Diagnostics;
    using System.IO;
    using DannyGeneral;

    namespace Youtube_Manager
    {
       class Ffmpeg
       {
           NamedPipeServerStream p;
           String pipename = "mytestpipe";
           System.Diagnostics.Process process;
           string ffmpegFileName = "ffmpeg.exe";
           string workingDirectory;

           public Ffmpeg()
           {
               workingDirectory = Path.GetDirectoryName(Application.ExecutablePath);
               Logger.Write("workingDirectory: " + workingDirectory);
               if (!Directory.Exists(workingDirectory))
               {
                   Directory.CreateDirectory(workingDirectory);
               }
               ffmpegFileName = Path.Combine(workingDirectory, ffmpegFileName);
               Logger.Write("FfmpegFilename: " + ffmpegFileName);
           }

           public void Start(string pathFileName, int BitmapRate)
           {
               try
               {

                   string outPath = pathFileName;
                   p = new NamedPipeServerStream(pipename, PipeDirection.Out, 1, PipeTransmissionMode.Byte);

                   ProcessStartInfo psi = new ProcessStartInfo();
                   psi.WindowStyle = ProcessWindowStyle.Hidden;
                   psi.UseShellExecute = false;
                   psi.CreateNoWindow = false;
                   psi.FileName = ffmpegFileName;
                   psi.WorkingDirectory = workingDirectory;
                   psi.Arguments = @"-f rawvideo -pix_fmt yuv420p -video_size 1920x1080 -i \\.\pipe\mytestpipe -map 0 -c:v mpeg4 -r " + BitmapRate + " " + outPath;
                   //psi.Arguments = @"-framerate 1/5 -i -c:v libx264 -r 30 -pix_fmt yuv420p \\.\pipe\mytestpipe -map 0 -c:v mpeg4 -r" + BitmapRate + " " + outPath;
                   process = Process.Start(psi);
                   process.EnableRaisingEvents = false;
                   psi.RedirectStandardError = true;
                   p.WaitForConnection();
               }
               catch (Exception err)
               {
                   Logger.Write("Exception Error: " + err.ToString());
               }
           }

           public void PushFrame(Bitmap bmp)
           {
               try
               {
                   int length;
                   // Lock the bitmap's bits.
                   //bmp = new Bitmap(1920, 1080);
                   Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
                   //Rectangle rect = new Rectangle(0, 0, 1280, 720);
                   System.Drawing.Imaging.BitmapData bmpData =
                       bmp.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadOnly,
                       bmp.PixelFormat);

                   int absStride = Math.Abs(bmpData.Stride);
                   // Get the address of the first line.
                   IntPtr ptr = bmpData.Scan0;

                   // Declare an array to hold the bytes of the bitmap.
                   //length = 3 * bmp.Width * bmp.Height;
                   length = absStride * bmpData.Height;
                   byte[] rgbValues = new byte[length];

                   //Marshal.Copy(ptr, rgbValues, 0, length);
                   int j = bmp.Height - 1;
                   for (int i = 0; i < bmp.Height; i++)
                   {
                       IntPtr pointer = new IntPtr(bmpData.Scan0.ToInt32() + (bmpData.Stride * j));
                       System.Runtime.InteropServices.Marshal.Copy(pointer, rgbValues, absStride * (bmp.Height - i - 1), absStride);
                       j--;
                   }
                   p.Write(rgbValues, 0, length);
                   bmp.UnlockBits(bmpData);
               }
               catch(Exception err)
               {
                   Logger.Write("Error: " + err.ToString());
               }

           }

           public void Close()
           {
               p.Close();
           }
       }
    }

    Then i’m using the method PushFrame here in this class :

    public Bitmap GetScreenShot(string folder, string name)
       {
           _screenShot = new Bitmap(GetScreen());
           System.GC.Collect();
           System.GC.WaitForPendingFinalizers();
           string ingName = folder + name +  images.counter.ToString("D6") + ".bmp";
           _screenShot.Save(ingName,System.Drawing.Imaging.ImageFormat.Bmp);
           fmpeg.PushFrame(_screenShot);
           _screenShot.Dispose();

           return _screenShot;
       }

    The Bitmaps on the hard disk are fine i can edit/open see them.
    When using command prompt and manually type ffmpeg command it does compress and create a mp4 video file.

    But when using the Ffmpeg class i did with the PushFrame method it’s creating this strange video file.

    This is a link for my OneDrive with 10 screenshots images files for testing :

    screenshots rar

    Sample screenshot from the video file when playing the video file :
    Looks very choppy. The Bitmaps on the hard disk each one is 1920x1080 and Bit depth 32

    But it dosen’t look like that in the video file :

    choppy image

    This is the arguments i’m using :

    psi.Arguments = @"-f rawvideo -vcodec rawvideo -pix_fmt rgb24 -video_size 1920x1080 -i \\.\pipe\mytestpipe -map 0 -c:v mpeg4 -r " + BitmapRate + " " + outPath;

    The video size is very small 1.24 MB

  • converting mp4 file to zero KB .png file : FFmpeg

    6 novembre 2017, par muskan

    Used below command for converting 2,981kb of file1.mp4 to file1.png :

    "ffmpeg.exe -i file1.mp4 -ss 00:00:10.00 -s "315"x"210"-f image2 -vframes 1 file1.png"

    using following code to execute the command :

    public int ProcessRun(string filename, string arguments, int waitTimeSeconds)
    {
       if (!System.IO.File.Exists(filename))
       {
           var Message = $"Converter file not found.";
           DialogResult result = DisplayError(Message);
       }
       int returnVal = 0;
       try
       {
           using (Process process = new Process())
           {
               process.StartInfo.FileName = filename;
               process.StartInfo.Arguments = arguments;
               process.StartInfo.UseShellExecute = false;
               process.StartInfo.RedirectStandardOutput = true;
               process.StartInfo.RedirectStandardError = true;

               StringBuilder output = new StringBuilder();
               StringBuilder error = new StringBuilder();

               using (AutoResetEvent outputWaitHandle = new AutoResetEvent(false))
               using (AutoResetEvent errorWaitHandle = new AutoResetEvent(false))
               {
                   process.OutputDataReceived += (sender, e) =>
                   {
                       if (e.Data == null)
                       {
                           outputWaitHandle.Set();
                       }
                       else
                       {
                           output.AppendLine(e.Data);
                       }
                   };
                   process.ErrorDataReceived += (sender, e) =>
                   {
                       if (e.Data == null)
                       {
                           errorWaitHandle.Set();
                       }
                       else
                       {
                           error.AppendLine(e.Data);
                       }
                   };

                   process.Start();

                   process.BeginOutputReadLine();
                   process.BeginErrorReadLine();

                   if (process.WaitForExit((int)TimeSpan.FromSeconds(waitTimeSeconds).TotalMilliseconds) &&
                        outputWaitHandle.WaitOne((int)TimeSpan.FromSeconds(waitTimeSeconds).TotalMilliseconds) &&
                        errorWaitHandle.WaitOne((int)TimeSpan.FromSeconds(waitTimeSeconds).TotalMilliseconds))
                   {
                      returnVal = process.ExitCode;
                   }
                   returnVal = process.ExitCode;
               }
           }
       }
       catch (Exception ex)
       {
           throw ex;
       }
       finally { }
       return returnVal;
    }

    where filename is filepath of my "ffmpeg.exe"
    arguments is "-i file1.mp4 -ss 00:00:10.00 -s "315"x"210"-f image2 -vframes 1 file1.png"
    waittimeseconds 60000

    But this always return me the file1.png of size 0kb.
    Getting following errorlog :

    ffmpeg version N-66289-gb76d613 Copyright (c) 2000-2014 the FFmpeg developers
    built on Sep 15 2014 22:02:10 with gcc 4.8.3 (GCC)
    configuration : —enable-gpl —enable-version3 —disable-w32threads —enable-avisynth —enable-bzlib —enable-fontconfig —enable-frei0r —enable-gnutls —enable-iconv —enable-libass —enable-libbluray —enable-libbs2b —enable-libcaca —enable-libfreetype —enable-libgme —enable-libgsm —enable-libilbc —enable-libmodplug —enable-libmp3lame —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libopenjpeg —enable-libopus —enable-librtmp —enable-libschroedinger —enable-libsoxr —enable-libspeex —enable-libtheora —enable-libtwolame —enable-libvidstab —enable-libvo-aacenc —enable-libvo-amrwbenc —enable-libvorbis —enable-libvpx —enable-libwavpack —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxavs —enable-libxvid —enable-decklink —enable-zlib
    libavutil 54. 7.100 / 54. 7.100
    libavcodec 56. 1.100 / 56. 1.100
    libavformat 56. 4.101 / 56. 4.101
    libavdevice 56. 0.100 / 56. 0.100
    libavfilter 5. 1.100 / 5. 1.100
    libswscale 3. 0.100 / 3. 0.100
    libswresample 1. 1.100 / 1. 1.100
    libpostproc 53. 0.100 / 53. 0.100
    file1.mp4 : Permission denied

    How can I fix it ?