Recherche avancée

Médias (91)

Autres articles (47)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (9067)

  • FFMPEG recording get an error when camera is turned off

    29 novembre 2019, par Bogdan Rudnytskyi

    I have a video recording service using ffmpeg.
    When the camera is turned off, I don’t get an error and the service freezes.
    Please help me how I can configure recording so that this service crashes with an error ? (and I will use Supervisor).
    Maybe I need to insert some flag ?

    ffmpeg -rtsp_transport tcp -i 'rtsp://...' -reconnect 1 -c:v copy -c:a copy -flags -global_header -hls_time 5 -hls_list_size 0 -strftime 1 -hls_segment_filename '%Y%m%d%H%M%S.ts' archive.m3u8 -nostats

    logs

    ffmpeg started on 2019-11-28 at 10:23:14 Report written to "ffmpeg-20191128-102314.log" Command line: "C:\\ffmpeg\\bin\\ffmpeg.exe" -report -rtsp_transport tcp -i "rtsp://..." -reconnect 1 -c:v copy -c:a copy -flags -global_header
    -hls_time 5 -hls_list_size 0 -strftime 1 -hls_segment_filename "%Y%m%d%H%M%S.ts" archive.m3u8 ffmpeg version N-94150-g231d0c819f Copyright (c) 2000-2019 the FFmpeg developers   built with gcc 9.1.1 (GCC) 20190621   configuration: --enable-gpl --enable-version3
    --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt   libavutil      56. 30.100 / 56. 30.100   libavcodec     58. 53.101 /
    58. 53.101   libavformat    58. 28.101 / 58. 28.101   libavdevice    58.  7.100 / 58.  7.100   libavfilter     7. 55.100 /  7. 55.100   libswscale      5.  4.101 /  5.  4.101   libswresample   3.  4.100 /
    3.  4.100   libpostproc    55.  4.100 / 55.  4.100 Splitting the commandline. Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'. Reading option '-rtsp_transport' ... matched as AVOption 'rtsp_transport' with argument 'tcp'. Reading option '-i' ... matched as input url with argument 'rtsp://...'. Reading option '-reconnect' ... matched as AVOption 'reconnect' with argument '1'. Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'copy'. Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'copy'. Reading option '-flags' ... matched as AVOption 'flags' with argument '-global_header'. Reading option '-hls_time' ... matched as AVOption 'hls_time' with argument '5'. Reading option '-hls_list_size' ... matched as AVOption 'hls_list_size' with argument '0'. Reading option '-strftime' ... matched as AVOption 'strftime' with argument '1'. Reading option '-hls_segment_filename' ... matched as AVOption 'hls_segment_filename' with argument '%Y%m%d%H%M%S.ts'. Reading option 'archive.m3u8' ... matched as output url. Finished splitting the commandline. Parsing a group of options: global . Applying option report (generate a report) with argument 1. Successfully parsed a group of options. Parsing a group of options: input url 'rtsp://...'. Successfully parsed a group of options. Opening an input file: 'rtsp://...'. [tcp @ 0000025972ecd180] No default whitelist set [tcp @ 0000025972ecd180] Original list of addresses: [tcp @ 0000025972ecd180] Address 0.0.0.0 port 999 [tcp @ 0000025972ecd180] Interleaved list of addresses: [tcp @ 0000025972ecd180] Address 0.0.0.0 port 999 [tcp @ 0000025972ecd180] Starting connection attempt to 0.0.0.0 port 999 [tcp @ 0000025972ecd180] Successfully connected to 0.0.0.0 port 999 [rtsp @ 0000025972ecca80] SDP: v=0

    o=- 1574936594324879 1574936594324879 IN IP4 10.10.1.65

    s=Media Presentation

    e=NONE

    b=AS:5050

    t=0 0

    a=control:'rtsp://...'

    m=video 0 RTP/AVP 96

    c=IN IP4 0.0.0.0

    b=AS:5000

    a=recvonly

    a=x-dimensions:1920,1080

    a=control:'rtsp://...'

    a=rtpmap:96 H264/90000

    a=fmtp:96 profile-level-id=420029; packetization-mode=1; sprop-parameter-sets=Z00AKZpkA8ARPy4C3AQEBQAAAwPoAADDUOhgAP84AAP80rvLjQwAH+cAAH+aV3lwoA==,aO48gA==

    a=Media_header:MEDIAINFO=494D4B48010200000400000100000000000000000000000000000000000000000000000000000000;

    a=appversion:1.0


    [rtsp @ 0000025972ecca80] video codec set to: h264 [rtsp @ 0000025972ecca80] RTP Profile IDC: 42 Profile IOP: 0 Level: 29 [rtsp @ 0000025972ecca80] RTP Packetization Mode: 1 [rtsp @ 0000025972ecca80] Extradata set to 0000025972ed0600 (size: 61) [rtsp @ 0000025972ecca80] setting jitter buffer size to 0 [rtsp @ 0000025972ecca80] hello state=0 [h264 @ 0000025972ed0080] nal_unit_type: 7(SPS), nal_ref_idc: 3 [h264 @ 0000025972ed0080] nal_unit_type: 8(PPS), nal_ref_idc: 3 [h264 @ 0000025972ed0080] nal_unit_type: 7(SPS), nal_ref_idc: 3 [h264 @ 0000025972ed0080] nal_unit_type: 8(PPS), nal_ref_idc: 3 [h264 @ 0000025972ed0080] nal_unit_type: 7(SPS), nal_ref_idc: 3 [h264 @ 0000025972ed0080] nal_unit_type: 8(PPS), nal_ref_idc: 3 [h264 @ 0000025972ed0080] nal_unit_type: 5(IDR), nal_ref_idc: 3 [h264 @ 0000025972ed0080] Format yuvj420p chosen by get_format(). [h264 @ 0000025972ed0080] Reinit context to 1920x1088, pix_fmt: yuvj420p [h264 @ 0000025972ed0080] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 3 [h264 @ 0000025972ed0080] nal_unit_type: 7(SPS), nal_ref_idc: 3 [h264 @ 0000025972ed0080] nal_unit_type: 8(PPS), nal_ref_idc: 3 [h264 @ 0000025972ed0080] nal_unit_type: 5(IDR), nal_ref_idc: 3 [h264 @ 0000025972ed0080] nal_unit_type: 7(SPS), nal_ref_idc: 3 [h264 @ 0000025972ed0080] nal_unit_type: 8(PPS), nal_ref_idc: 3 [h264 @ 0000025972ed0080] nal_unit_type: 5(IDR), nal_ref_idc: 3 [h264 @ 0000025972ed0080] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 3 [h264 @ 0000025972ed0080] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 3 [h264 @ 0000025972ed0080] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 3 [rtsp @ 0000025972ecca80] All info found Input #0, rtsp, from 'rtsp://...':   Metadata:
       title           : Media Presentation   Duration: N/A, start: 0.240000, bitrate: N/A
       Stream #0:0, 28, 1/90000: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc Successfully opened the file. Parsing a group of options: output url archive.m3u8. Applying option c:v (codec name) with argument copy. Applying option c:a (codec name) with argument copy. Successfully parsed a group of options. Opening an output file: archive.m3u8. Successfully opened the file. [hls @ 0000025972f977c0] Opening '20191128102316.ts' for writing [file @ 0000025975633ec0] Setting default whitelist 'file,crypto' [mpegts @ 00000259756333c0] muxrate VBR, pcr every 2 pkts, sdt every 2147483647, pat/pmt every 2147483647 pkts Output #0, hls, to 'archive.m3u8':   Metadata:
       title           : Media Presentation
       encoder         : Lavf58.28.101
       Stream #0:0, 0, 1/90000: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 25 tbc Stream mapping:   Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) [hls @ 0000025972f977c0] Non-monotonous DTS in output stream 0:0; previous: 0, current: -18000; changing to 1. This may result in incorrect timestamps in the output file. [hls @ 0000025972f977c0] Non-monotonous DTS in output stream 0:0; previous: 1, current: -14400; changing to 2. This may result in incorrect timestamps in the output file. [hls @ 0000025972f977c0] Non-monotonous DTS in output stream 0:0; previous: 2, current: -10800; changing to 3. This may result in incorrect timestamps in the output file. [hls @ 0000025972f977c0] Non-monotonous DTS in output stream 0:0; previous: 3, current: -7200; changing to 4. This may result in incorrect timestamps in the output file. [hls @ 0000025972f977c0] Non-monotonous DTS in output stream 0:0; previous: 4, current: -3600; changing to 5. This may result in incorrect timestamps in the output file. [hls @ 0000025972f977c0] Non-monotonous DTS in output stream 0:0; previous: 5, current: 0; changing to 6. This may result in incorrect timestamps in the output file. frame=   48 fps=0.0 q=-1.0 size=N/A time=00:00:01.68 bitrate=N/A speed=3.13x     frame=   61 fps= 58 q=-1.0 size=N/A time=00:00:02.20 bitrate=N/A speed= 2.1x     frame=   74 fps= 47 q=-1.0 size=N/A time=00:00:02.72 bitrate=N/A speed=1.74x     frame=   87 fps= 41 q=-1.0 size=N/A time=00:00:03.24 bitrate=N/A speed=1.54x     frame=  100 fps= 38 q=-1.0 size=N/A time=00:00:03.76 bitrate=N/A speed=1.44x   frame=  113 fps= 36 q=-1.0 size=N/A time=00:00:04.27 bitrate=N/A speed=1.37x     frame=  125 fps= 34 q=-1.0 size=N/A time=00:00:04.75 bitrate=N/A speed=1.31x     frame=  138 fps= 33 q=-1.0 size=N/A time=00:00:05.27 bitrate=N/A speed=1.28x     frame=  151 fps= 32 q=-1.0 size=N/A time=00:00:05.79 bitrate=N/A speed=1.24x     [AVIOContext @ 0000025972ecbe80] Statistics: 0 seeks, 15 writeouts [hls @ 0000025972f977c0] Opening '20191128102321.ts' for writing [file @ 0000025972f9ef00] Setting default whitelist 'file,crypto' [hls @ 0000025972f977c0] Opening 'archive.m3u8.tmp' for writing [file @ 000002597562ff40] Setting default whitelist 'file,crypto' EXT-X-MEDIA-SEQUENCE:0 [AVIOContext @ 0000025972ecbfc0] Statistics: 0 seeks, 1 writeouts frame=  165 fps= 32 q=-1.0 size=N/A time=00:00:06.35 bitrate=N/A speed=1.22x     frame=  178 fps= 31 q=-1.0 size=N/A time=00:00:06.87 bitrate=N/A speed= 1.2x     frame=  192 fps= 31 q=-1.0 size=N/A time=00:00:07.43 bitrate=N/A speed=1.18x   frame=  204 fps= 30 q=-1.0 size=N/A time=00:00:07.91 bitrate=N/A speed=1.17x     frame=  218 fps= 30 q=-1.0 size=N/A time=00:00:08.47 bitrate=N/A speed=1.16x     frame=  231 fps= 29 q=-1.0 size=N/A time=00:00:08.99 bitrate=N/A speed=1.15x     frame=  244 fps= 29 q=-1.0 size=N/A time=00:00:09.51 bitrate=N/A speed=1.14x     frame=  255 fps= 29 q=-1.0 size=N/A time=00:00:09.95 bitrate=N/A speed=1.11x   frame=  272 fps= 29 q=-1.0 size=N/A time=00:00:10.63 bitrate=N/A speed=1.12x     frame=  285 fps= 28 q=-1.0 size=N/A time=00:00:11.15 bitrate=N/A speed=1.11x     frame=  299 fps= 28 q=-1.0 size=N/A time=00:00:11.71 bitrate=N/A speed=1.11x     [AVIOContext @ 0000025972ecbe80] Statistics: 0 seeks, 12 writeouts [hls @ 0000025972f977c0] Opening '20191128102327.ts' for writing [file @ 0000025975633ec0] Setting default whitelist 'file,crypto' [hls @ 0000025972f977c0] Opening 'archive.m3u8.tmp' for writing [file @ 0000025975630780] Setting default whitelist 'file,crypto' EXT-X-MEDIA-SEQUENCE:0 [AVIOContext @ 0000025972ecbfc0] Statistics: 0 seeks, 1 writeouts frame=  305 fps= 28 q=-1.0 size=N/A time=00:00:11.95 bitrate=N/A speed=1.08x     frame=  325 fps= 28 q=-1.0 size=N/A time=00:00:12.75 bitrate=N/A speed= 1.1x     frame=  338 fps= 28 q=-1.0 size=N/A time=00:00:13.27 bitrate=N/A speed=1.09x   frame=  351 fps= 28 q=-1.0 size=N/A time=00:00:13.79 bitrate=N/A speed=1.09x     frame=  364 fps= 28 q=-1.0 size=N/A time=00:00:14.31 bitrate=N/A speed=1.09x     frame=  377 fps= 28 q=-1.0 size=N/A time=00:00:14.83 bitrate=N/A speed=1.08x     frame=  390 fps= 27 q=-1.0 size=N/A time=00:00:15.35 bitrate=N/A speed=1.08x     frame=  403 fps= 27 q=-1.0 size=N/A time=00:00:15.87 bitrate=N/A speed=1.08x   [AVIOContext @ 0000025972ecbe80] Statistics: 0 seeks, 8 writeouts [hls @ 0000025972f977c0] Opening '20191128102331.ts' for writing [file @ 0000025975633ec0] Setting default whitelist 'file,crypto' [hls @ 0000025972f977c0] Opening 'archive.m3u8.tmp' for writing [file @ 0000025975630240] Setting default whitelist 'file,crypto' EXT-X-MEDIA-SEQUENCE:0 [AVIOContext @ 0000025972ecbfc0] Statistics: 0 seeks, 1 writeouts frame=  416 fps= 27 q=-1.0 size=N/A time=00:00:16.39 bitrate=N/A speed=1.08x     frame=  428 fps= 27 q=-1.0 size=N/A time=00:00:16.87 bitrate=N/A speed=1.07x     frame=  442 fps= 27 q=-1.0 size=N/A time=00:00:17.43 bitrate=N/A speed=1.07x   frame=  454 fps= 27 q=-1.0 size=N/A time=00:00:17.91 bitrate=N/A speed=1.07x
  • FFMPG Concat two video quality issue

    14 novembre 2019, par Salah Hammouda

    I’m trying to concat two mp4 video files using ffmpg (with the below command), a main video and a secondary one, the main video always have 1080x1920 resolution and the resulting video should have the some resolution.

    val concat = "-i $mainVideoPath -i $secondVideoPath -filter_complex [0:v]scale=1080:1920:force_original_aspect_ratio=decrease,setsar=1:1,pad=1080:1920 :(ow-iw)/2 :(oh-ih)/2[s0] ;[1:v]scale=1080:1920:force_original_aspect_ratio=decrease,setsar=1:1,pad=1080:1920 :(ow-iw)/2 :(oh-ih)/2[s1] ;[s0][s1]concat=n=2:v=1[v] -map [v] $resultVideoPath"

    The concat work fine but the main part of my resulting video always lose quality although the resulting video has the same resolution.

    Any help will be appreciated.

  • When using ffmpeg to compress and create in real time mpeg4 video file from bathc of images getting low quality video how can i improve quality ?

    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.

    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 -vcodec rawvideo -pix_fmt rgb24 -video_size 1920x1080 -i \\.\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();
           }
       }
    }

    The Bitmaps images files on my hard disk each one is 1920x1080 and Bit depth 32.

    The video file is on the hard disk at size 1.24MB

    This is a screenshot i took from the video file when playing it.
    You can see how bad the quality is.

    screenshot from video bad quality

    This is a link for 10 images of the screenshots i’m using creating from the video file. They are Bitmaps.

    Screenshots rar

    Its something with the arguments :
    This line dosen’t work when i run the program the command prompt window close at once. I can’t even see if there is any erorr/s the command prompt window close too fast.

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

    When i’m using this arguments it’s working but making bad quality video :

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