Recherche avancée

Médias (1)

Mot : - Tags -/net art

Autres articles (54)

  • 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

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

Sur d’autres sites (9672)

  • 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

    


  • Unexpected result from Python re.search for command line output

    23 mai 2020, par Fernando Ortega

    I'm using subprocess.Popen to run an ffmpeg command (in Windows) and then extract the part of the output that has the frame count with a regex expression using re.search. Sometimes, not always, I get the wrong result from search even if the printed command output string clearly shows what I expect.

    



    When I use re.findall I get 2 results, the "wrong" one and the expected one, but in the output string of the command I still only see one option. I'd like to understand why this is happening.

    



    Here's the code I'm running :

    



    import re
import subprocess

# path to video with 300 frames
cmd = r'ffmpeg -i C:\...\300frames_HUD.avi -map 0:v:0 -c copy -f null -'
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output_info = p.communicate()[0]

regex = r'(frame=\s*)([0-9]+)'
search_result = re.search(regex, output_info)
findall_result = re.findall(regex, output_info)
print "SEARCH"
print '0', search_result.group(0)
print '1', search_result.group(1)
print '2', search_result.group(2)

print "FIND ALL"
print findall_result


    



    Here are the results I get :

    



    SEARCH
0 frame=  293
1 frame=  
2 293
FIND ALL
[('frame=  ', '293'), ('frame=  ', '300')]


    



    And here is the printed output_info, the ffmpeg command output I'm searching on :

    



    ffmpeg version git-2020-03-15-c467328 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20200122
  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-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 42.100 / 56. 42.100
  libavcodec     58. 75.100 / 58. 75.100
  libavformat    58. 41.100 / 58. 41.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.100 /  7. 77.100
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, avi, from 'C:\...\300frames_HUD.avi':
  Duration: 00:00:10.00, start: 0.000000, bitrate: 373255 kb/s
    Stream #0:0: Video: rawvideo, bgr24, 960x540, 374496 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
    Metadata:
      title           : V
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf58.41.100
    Stream #0:0: Video: rawvideo, bgr24, 960x540, q=2-31, 374496 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
    Metadata:
      title           : V
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=  300 fps=0.0 q=-1.0 Lsize=N/A time=00:00:10.00 bitrate=N/A speed=19.4x    
video:455625kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown


    



    I'm essentially looking for the 300 number in frame=  300.
I can reproduce this easily when I execute it inside my IDE (pycharm) twice in a row quickly.

    


  • MobileFFMPeg Not converting mkv to Mp4

    7 mai 2020, par Jlee

    I'm currently running the following code on my device in order to convert all mkv files in a directory to an mp4. But for some reason no files are converted. I double checked the dir name and it is correct, is there something wrong with my syntax ?

    



    let path = self.documentsDir()
let url = URL(string: path.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!)
     var rc = MobileFFmpeg.execute("-i jellyfish.mkv -c:v libx264 -preset -slow -crf 22 -c:a copy youroutput.mp4")
          if (rc == RETURN_CODE_SUCCESS) {
               print("Command execution completed successfully.\n");
                } 
          else if (rc == RETURN_CODE_CANCEL) {
                print("Command execution cancelled by user.\n");
                } 
           else {
                print("Command execution failed with rc=%d and output=%@.\n", rc, MobileFFmpegConfig.getLastCommandOutput);
                }


    



    2020-05-07 13:36:02.782150-0400 WebmBrowser[8025:138754] ERROR: /Users/jlee/Library/Developer/CoreSimulator/Devices/8CD81B87-9E27-4F3C-8601-C76945FAD4D8/data/Containers/Data/Application/B7A0D956-3BAB-4203-82EE-5FDBF38B2F13/Documents/jellyfish.mkv: Invalid data found when processing input

Command execution failed with rc=%d and output=%@.