Recherche avancée

Médias (2)

Mot : - Tags -/map

Autres articles (111)

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

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang 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.

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

Sur d’autres sites (10710)

  • error when add arabic text to video ffmpeg c#

    28 décembre 2020, par Fath Bakri

    i want to add Arabic annotation or text to video, i use ffmpeg version 4.3.1 in win 32 bit, here my code in c# :

    


    private string AddVideo_Annotation(string text,int X,int Y)
        {
            try
            {

                string FFmpegPath = Utils.GetEXE_FFmpegPath();
                string path = Utils.GetProgramPath();
                //store outcome of process
                var errors = new StringBuilder();
                var output = new StringBuilder();
                var hadErrors = false;

                Process pdfprocess = new Process();

                
                //pdfprocess.StartInfo.LoadUserProfile = true;
                pdfprocess.StartInfo.RedirectStandardOutput = true;
                pdfprocess.StartInfo.RedirectStandardError = true;
                pdfprocess.StartInfo.UseShellExecute = false;
                
                pdfprocess.StartInfo.FileName = FFmpegPath;
                //text_shaping=1
                pdfprocess.StartInfo.Arguments = "-i \""+filePath+ "\" -vf -enable-libfribidi drawtext=\"text_shaping=1:text=\'" + text+ "\':x=" + X+":y="+Y+ ":fontsize=24:fontcolor=Red\"  -c:a copy \"" + path + "\\out.mp4\"";
               
                //pdfprocess.StartInfo.WorkingDirectory = @"C:\Program Files\LibreOffice\program\";
                pdfprocess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

                pdfprocess.EnableRaisingEvents = true;

                // capture normal output
                pdfprocess.OutputDataReceived += (s, d) => {
                    output.Append(d.Data);
                };

                // Capture error output
                pdfprocess.ErrorDataReceived += (s, d) => {
                    if (!hadErrors)
                    {
                        hadErrors = !String.IsNullOrEmpty(d.Data);
                    }
                    errors.Append(d.Data);
                };
                pdfprocess.Start();
                pdfprocess.BeginErrorReadLine();
                pdfprocess.BeginOutputReadLine();
                try
                {
                    while (pdfprocess.MainWindowHandle == IntPtr.Zero)
                    {
                        // Discard cached information about the process
                        // because MainWindowHandle might be cached.
                        pdfprocess.Refresh();
                        
                        Thread.Sleep(200);

                    }
                }
                catch { }
                Thread.Sleep(2000);
                pdfprocess.WaitForExit();
                while ((Process.GetProcessesByName("ffmpeg").Length > 0))
                {
                    Thread.Sleep(200);
                }


                string stderr = errors.ToString();

                if (pdfprocess.ExitCode != 0)
                {
                    //MessageBox.Show("error:" + stderr);

                    throw new Exception("FFmpeg.exe has exit wit code " + pdfprocess.ExitCode+"\n"+ stderr);
                }
                return path + "\\out"+new FileInfo( filePath).Extension;
            }
            catch(Exception ex)
            {
                TXT_AnnotationText.Text = ex.Message + "\n" + ex.StackTrace.ToString();
                MessageBox.Show(ex.Message + "\n" + ex.StackTrace.ToString());
                throw ex;
            }
        }



    


    i get this error message :

    
FFmpeg.exe has exit wit code 1
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 10.2.1 (GCC) 20200726 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-libsrt —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-libvmaf —enable-libvorbis —enable-libvo-amrwbenc —enable-libmysofa —enable-libspeex —enable-libxvid —enable-libaom —enable-libgsm —disable-w32threads —enable-libmfx —enable-ffnvcodec —enable-cuda-llvm —enable-cuvid —enable-d3d11va —enable-nvenc —enable-nvdec —enable-dxva2 —enable-avisynth —enable-libopenmpt —enable-amf libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc 55. 7.100 / 55. 7.100Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D :\a.mp4' : Metadata : major_brand : mp42 minor_version : 0 compatible_brands : isommp42 creation_time : 2020-12-02T01:57:02.000000Z Duration : 00:01:37.70, start : 0.000000, bitrate : 125 kb/s Stream #0:0(eng) : Video : h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 1280x662 [SAR 1:1 DAR 640:331], 124 kb/s, 30 fps, 30 tbr, 30k tbn, 60 tbc (default) Metadata : creation_time : 2020-12-02T01:57:03.000000Z handler_name : Mainconcept MP4 Video Media Handler encoder : AVC Coding[NULL @ 05d306c0] Unable to find a suitable output format for 'drawtext=text_shaping=1:text='ظٹظ„ظٹظٹظ„ ظٹظ„ظٹط¨ظ„':x=200:y=200:fontsize=24:fontcolor=Red'drawtext=text_shaping=1:text='ظٹظ„ظٹظٹظ„ ظٹظ„ظٹط¨ظ„':x=200:y=200:fontsize=24:fontcolor=Red : Invalid argument
at EasyWhatsappSender.UserControls.UControl_VideoAudioPreview_Annotation.AddVideo_Annotation(String text, Int32 X, Int32 Y) in C :\Users\FathBakri\Documents\Visual Studio 2017\Projects\MediaViewer\UserControls\UControl_VideoAudioPreview_Annotation.cs:line 239

    
the error happen when i use text_shaping=1 , if i omit it and use Arabic text it display in symbols and not correct
how to fix it. Thanks for help

    


  • ffmpeg GPU use cuvid with hwdownload will never finished, Appeared only recently

    28 mai 2020, par tags bt

    ffmpeg :

    



    ffmpeg version N-97331-g10a68cc Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
  configuration: --pkg-config-flags=--static --prefix=/usr/local/ffmpeg --bindir=/usr/local/ffmpeg/bin --extra-cflags='-I /usr/local/ffmpeg/include -I /usr/local/cuda/include/' --extra-ldflags='-L /usr/local/ffmpeg/lib -L /usr/local/cuda/lib64/' --extra-libs=-lpthread --enable-cuda --enable-cuda-nvcc --enable-cuvid --enable-libnpp --enable-gpl --enable-libass --enable-libfdk-aac --enable-vaapi --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-libaom --enable-nvenc


    



    nvidia-msi

    



    +-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.82       Driver Version: 440.82       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1080    Off  | 00000000:02:00.0 Off |                  N/A |
|  0%   51C    P8    13W / 200W |     18MiB /  8119MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0     23224      C   ffmpeg                                         8MiB |
+-----------------------------------------------------------------------------+



    



    if i use this command :

    



    ffmpeg -re -threads 0 -loglevel debug -hwaccel cuvid -hwaccel_output_format cuda -i 1.mp4 -c:v h264_nvenc -c:a aac -ac 2 -b:a 128k -strict -2 -filter_complex "[0:v]scale_npp=1280:-2" ouzz2t.mp4


    



    it will very fast.

    



    but if i use this command :

    



    ffmpeg -re -threads 0 -loglevel debug -vsync 0 -hwaccel cuvid -hwaccel_output_format cuda -hwaccel_device intel -i 1.mp4 -c:v h264_nvenc -c:a aac -ac 2 -b:a 128k -strict -2 -filter_complex "[0:v]scale_npp=1280:-2:format=yuv420p[tmp],[tmp]hwdownload,format=yuv420" ouzz2t.mp4


    



    it will never finished, one 40MB mp4 will transcode 44 minutes and not finished.

    



    as you see

    



    +-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0     23224      C   ffmpeg                                         8MiB |
+-----------------------------------------------------------------------------+


    



    it will only use GPU memory 8mib.

    



    and top will show :
enter image description here

    



    delug log :

    



    [AVHWDeviceContext @ 0x561cfaef92c0] Loaded lib: libcuda.so.1
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuInit
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuDeviceGetCount
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuDeviceGet
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuDeviceGetAttribute
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuDeviceGetName
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuDeviceComputeCapability
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuCtxCreate_v2
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuCtxSetLimit
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuCtxPushCurrent_v2
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuCtxPopCurrent_v2
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuCtxDestroy_v2
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuMemAlloc_v2
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuMemAllocPitch_v2
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuMemsetD8Async
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuMemFree_v2
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuMemcpy2D_v2
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuMemcpy2DAsync_v2
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuGetErrorName
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuGetErrorString
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuCtxGetDevice
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuDevicePrimaryCtxRetain
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuDevicePrimaryCtxRelease
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuDevicePrimaryCtxSetFlags
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuDevicePrimaryCtxGetState
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuDevicePrimaryCtxReset
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuStreamCreate
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuStreamQuery
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuStreamSynchronize
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuStreamDestroy_v2
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuStreamAddCallback
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuEventCreate
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuEventDestroy_v2
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuEventSynchronize
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuEventQuery
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuEventRecord
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuLaunchKernel
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuModuleLoadData
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuModuleUnload
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuModuleGetFunction
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuTexObjectCreate
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuTexObjectDestroy
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuGLGetDevices_v2
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuGraphicsGLRegisterImage
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuGraphicsUnregisterResource
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuGraphicsMapResources
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuGraphicsUnmapResources
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuGraphicsSubResourceGetMappedArray
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuDeviceGetUuid
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuImportExternalMemory
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuDestroyExternalMemory
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuExternalMemoryGetMappedBuffer
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuExternalMemoryGetMappedMipmappedArray
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuMipmappedArrayGetLevel
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuMipmappedArrayDestroy
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuImportExternalSemaphore
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuDestroyExternalSemaphore
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuSignalExternalSemaphoresAsync
[AVHWDeviceContext @ 0x561cfaef92c0] Loaded sym: cuWaitExternalSemaphoresAsync



    



    Stop at Loaded sym : cuWaitExternalSemaphoresAsync, and ffmpeg will always 100% cpu and never finished.

    



    Appeared only recently, last week it work fine, but today it work worse.

    



    somebody know what happen to me ?

    


  • Some videos fail to chromecast with error MEDIA_UNKNOWN

    1er juin 2020, par JonasVautherin

    Using mkchromecast to cast local mp4 files, some videos work, and some don't (as in : the screen hangs on the blue chromecast logo, suggesting that the initial connection worked). I can reproduce exactly the issue described here.

    



    So I decided to go one level lower, with pychromecast, and try to see what actually happens when it hangs on the blue logo. I converted two videos to HLS format, and exposed them through an http server. The video that works with mkchromecast also works with my setup, but the one that fails, well... fails on both. With pychromecast, I don't get much more information than :

    



    


    ERROR, code 100 : MEDIA_UNKNOWN.

    


    



    From the Cast documentation, this error means :

    



    


    The media element encountered an unknown error fired from platform. The media element encountered an error that did not indicate it's one of MediaError.MEDIA_ERR_*. This should be rare.

    


    



    It is not rare for me at all, though. I thought that maybe the failing video was in an unsupported format, as described in the documentation. So I tried to compare both videos with the following command :

    



    ffprobe -v quiet -print_format json -show_streams 


    



    Video that works :

    



    {
    "streams": [
        {
            "index": 0,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "High",
            "codec_type": "video",
            "codec_time_base": "1001/48000",
            "codec_tag_string": "avc1",
            "codec_tag": "0x31637661",
            "width": 1920,
            "height": 1080,
            "coded_width": 1920,
            "coded_height": 1088,
            "has_b_frames": 2,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "16:9",
            "pix_fmt": "yuv420p",
            "level": 50,
            "chroma_location": "left",
            "refs": 1,
            "is_avc": "true",
            "nal_length_size": "4",
            "r_frame_rate": "24000/1001",
            "avg_frame_rate": "24000/1001",
            "time_base": "1/24000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 47127080,
            "duration": "1963.628333",
            "bit_rate": "5527977",
            "bits_per_raw_sample": "8",
            "nb_frames": "47080",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "language": "und",
                "handler_name": "VideoHandler"
            }
        },
        {
            "index": 1,
            "codec_name": "aac",
            "codec_long_name": "AAC (Advanced Audio Coding)",
            "profile": "LC",
            "codec_type": "audio",
            "codec_time_base": "1/48000",
            "codec_tag_string": "mp4a",
            "codec_tag": "0x6134706d",
            "sample_fmt": "fltp",
            "sample_rate": "48000",
            "channels": 2,
            "channel_layout": "stereo",
            "bits_per_sample": 0,
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/48000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 94254528,
            "duration": "1963.636000",
            "bit_rate": "125776",
            "max_bit_rate": "125776",
            "nb_frames": "92048",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "language": "und",
                "handler_name": "SoundHandler"
            }
        }
    ]
}


    



    Video that does NOT work :

    



    {                                               
    "streams": [
        {
            "index": 0,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "High",
            "codec_type": "video",
            "codec_time_base": "125/5994",
            "codec_tag_string": "avc1",
            "codec_tag": "0x31637661",
            "width": 1920,
            "height": 1040,
            "coded_width": 1920,
            "coded_height": 1040,
            "has_b_frames": 2,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "24:13",
            "pix_fmt": "yuv420p",
            "level": 41,
            "chroma_location": "left",
            "refs": 1,
            "is_avc": "true",
            "nal_length_size": "4",
            "r_frame_rate": "2997/125",
            "avg_frame_rate": "2997/125",
            "time_base": "1/11988",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 97032000,
            "duration": "8094.094094",
            "bit_rate": "2499644",
            "bits_per_raw_sample": "8",
            "nb_frames": "194064",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "creation_time": "2020-03-27T09:56:39.000000Z",
                "language": "und",
                "handler_name": "L-SMASH Video Media Handler"
            }
        },
        {
            "index": 1,
            "codec_name": "aac",
            "codec_long_name": "AAC (Advanced Audio Coding)",
            "profile": "LC",
            "codec_type": "audio",
            "codec_time_base": "1/48000",
            "codec_tag_string": "mp4a",
            "codec_tag": "0x6134706d",
            "sample_fmt": "fltp",
            "sample_rate": "48000",
            "channels": 6,
            "channel_layout": "5.1",
            "bits_per_sample": 0,
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/48000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 388516320,
            "duration": "8094.090000",
            "bit_rate": "224000",
            "max_bit_rate": "224000",
            "nb_frames": "379413",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "creation_time": "2020-03-27T09:56:39.000000Z",
                "language": "eng",
                "handler_name": "SoundHandler"
            }
        }
    ]
}


    



    For what I can see, the codecs are the same, and the only difference I can make is in the aspect ratio.

    



    What could be the reason for this "MEDIA_UNKNOWN" error on the chromecast side ? Is there something more I could compare between those two videos ? Could it be that the chromecast fails because of the aspect ratio ?