Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (83)

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

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

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

Sur d’autres sites (10753)

  • Debugging in Visual Studio without Pdb files (C++ Access Voilation)

    2 décembre 2016, par Prakash M

    I built OpenCV binaries(.dll) using Cmake & visual studio which generated .pdb file which helped me to find the issue in code (Partially !)

    How this Crash is being caused. .
    I’m using a software with which we can set internet download speed limit (transfer rate) for any particular program.

    Now if i connect IP camera to the code below, i noticed that my app needs around 100Kb/s of internet usage (transfer rate) - only then i can watch live stream seamlessly.
    Lets say i cut down (set) my application internet usage to 10Kb/s [This is the reason behind crash]
    in this case, i should be able to see a new frame once in 4+ seconds.

    I’m getting access violation error probably because (cap>>img;) cap is trying to reach a location in ram & get the frame but there is no frame YET because its still being downloaded due to low internet speed.
    Clearly the pointer is reaching some location in ram to grab a frame which is not yet present.

    Some interesting behaviour . . .

    Void OpenCamera()
    {
       VideoCapture cap("http://192.168.1.3:8080/video?x.xmjpeg");
       Mat img;
       while(true)
       {
         try
         {
           if(cap.isOpened()) //also tried grab + retrieve, crashes at grab
           cap>>img; //code crashes here
         }
         catch(...)
         {
           cout<<"Camera Disconnected"<code>

    If i use the entire code in same class (within same header file), there is no problem at all(new frame is displayed after 4+ seconds without crashing the program) but if i put the code into a separate class(different header file), then call the function to open camera from a class object, then it crashes if internet speed is cut down.
    weird behavior - if i debug step by step, it never crashes !

    when i build opencv library with ffmpeg , i get .pdb file only for opencv (opencv_world310.pdb)- so no issue debugging using call stack
    but i do not get pdb for ffmpeg (because Opencv_ffmpeg.dll is precompiled and that is where its crashing)

    hence its getting hard to debug, building ffmpeg doesn’t produce pdb file cause its built using MSYS
    so is it possible to debug with what we have ?

    I’m including snapshot from visual studio debugging,
    some of the variables that will help in understanding :

    typedef int (*CvGrabFrame_Plugin)( void* capture_handle );      [cap_ffmpeg_api.cpp]
    protected: void* ffmpegCapture;                                 [cap_ffmpeg.cpp]
    static CvGrabFrame_Plugin icvGrabFrame_FFMPEG_p = 0;            [cap_ffmpeg.cpp]

    enter image description here

    Exception thrown at 0x0A0AF6F0 (opencv_ffmpeg310.dll) in Sample.exe :
    0xC0000005 : Access violation reading location 0x00000020. If there is
    a handler for this exception, the program may be safely continued.

    in source code i included below line & compiled & used it in project - didn’t work, crashed again !
    if(ffmpegCapture) - null pointer check

    can we make some changes at line 214 in [cap_ffmpeg.cpp] to avoid crash ?
    other header files are just one folder up.

    Update : I noticed that program crashes immediately when i limit internet consumption speed. I’m using C++/Cli(winforms, target dot net Framework = 4.6), i have CameraClass (in separate header file) & main function in (separate header file)
    Main function has below code

    CameraClass ^CC = gcnew CameraClass();
    CC->OpenCamera();

    Some clash between .net memory handling & C++ memory handling ?

  • C# FFMPEG Process and Multiple files

    3 novembre 2016, par wesman

    I am working on a C# Form tool that will help me convert all of my phone and DSLR video to HEVC, currently, i have a program that uploads the photos and videos to different directories in my home server each time i connect to the WiFi. Once a month or so, i manually convert all the videos, but thought I would automate the process.. I have the Form working perfectly for processing 1 file. but get into trouble when processing a Directory (with possible sub-directories) all at once..

    Sorry, this is long, just want to be thorough. here is the button calls

    private void processFile_Click(object sender, EventArgs e)
       {
           OpenFileDialog file = new OpenFileDialog();
           file.InitialDirectory = baseMediaDirectory;
           if (file.ShowDialog() == DialogResult.OK)
           {
               ProcessSinlgeFile(file.FileName);
           }
       }

    (above)for one file and (below) for a directory

    private void processDirectory_Click(object sender, EventArgs e)
    {
       FolderBrowserDialog file = new FolderBrowserDialog();
       file.SelectedPath = baseMediaDirectory;
       if(file.ShowDialog() == DialogResult.OK)
       {
          ProcessDirectoryOfFiles(file.SelectedPath);
       }
    }

    private void ProcessDirectoryOfFiles(string selectedPath)
       {
           List<string> listOfFiles = GetAllFiles(selectedPath);
           foreach (string s in listOfFiles)
           {
               ProcessSinlgeFile(s);
           }
       }
    </string>

    both ultimately call this method, to do some checks and setup

    private void ProcessSinlgeFile(string fileName)
       {

           if (IsAcceptableMediaFile(fileName))
           {
               outputWindow.AppendText("File to Process: " + fileName);
               processMediaFile =
                   new MediaFileWrapper(this.outputWindow, new MediaFile(fileName), new NReco.VideoInfo.FFProbe());
               if (processMediaFile.OkToProcess)
               {
                   int initialCRFValue = 15;
                   //ultrafast superfast veryfast faster fast medium slow slower veryslow placebo
                   string intialSpeed = "veryfast";
                   try {

                       ConvertToMPEG(processMediaFile.getFFMPEGCommand(initialCRFValue, intialSpeed), processMediaFile);
                   }
                   catch
                   {
                       // at somepoint, we'll catch a bad file size (or compression)
                       // then change the CRF value and/or compression speed
                   }
               }
           }
       }

    ultimately I get to this Method and run into trouble.

       private async void ConvertToMPEG(string arguments, MediaFileWrapper processMediaFile)
       {
           startTime = DateTime.Now;
           watch = new Stopwatch();
           watch.Start();
           progressBar1.Minimum = 0;
           progressBar1.Maximum = processMediaFile.GetTotalMilliseconds();

           // Start the child process.
           p = new Process();

           //Setup filename and arguments
           outputWindow.AppendText("ffmpeg " + arguments);
           p.StartInfo.Arguments = arguments;
           p.StartInfo.FileName = "ffmpeg.exe";
           p.StartInfo.UseShellExecute = false;

           // Redirect the output stream of the child process.
           p.StartInfo.RedirectStandardOutput = true;
           p.StartInfo.RedirectStandardError = true;
           p.StartInfo.RedirectStandardInput = true;

           // capture the date for stdout and std error
           // note FFMPEG uses Stderr exclusively
           p.ErrorDataReceived += new DataReceivedEventHandler(ErrorDataReceived);
           p.OutputDataReceived += new DataReceivedEventHandler(OutputDataReceived);

           // Hide Console Window
           p.StartInfo.CreateNoWindow = true;
           p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

           p.Start();
           p.BeginErrorReadLine();
           p.BeginOutputReadLine();
           await p.WaitForExitAsync();
       }

    and WaitForExitAsync is in another class because in can not be in here with a Form

       public static Task WaitForExitAsync(this Process process,
           CancellationToken cancellationToken = default(CancellationToken))
       {
           var tcs = new TaskCompletionSource();
           process.EnableRaisingEvents = true;
           process.Exited += (sender, args) => tcs.TrySetResult(null);
           if (cancellationToken != default(CancellationToken))
               cancellationToken.Register(tcs.SetCanceled);

           return tcs.Task;
       }

    however, single files work fine, when I call a directory through, it continuously starts processes for each file, trying to run them all at the same time. You can see I tried implementing this
    process.WaitForExit() asynchronously
    with no luck.

  • Unusual results extracting VP9 pkt_size with ffprobe as compared to H.264

    26 novembre 2016, par Jeff S.

    I’m trying to graph the bitrate over time for H.264 and VP9 videos by extracting the frame size with ffprobe, but many of the VP9 videos are showing significantly lower bitrate and total size than both the file size would indicate and that ffprobe reports.

    Can someone point me in the right direction for finding the missing bytes ?

    For example :

    # The extracted values and the ffprobe values are very close for mp4
    Video Codec: h264
    Video Bitrate: 0.668869
    Frame Bitrate: 0.665552571931
    Video Size: 6381536.0
    Frame Total Size: 6349891

    # The extracted values and the ffprobe values are very different for some vp9 videos
    Video Codec: vp9
    Video Bitrate: 0.600966
    Frame Bitrate: 0.375144984531
    Video Size: 5730519.0
    Frame Total Size: 3577195

    Below is what I’m using for validation. Note that the sample videos do not contain audio.

    import subprocess
    import json

    def export_video_info(video_id):
       proc = subprocess.Popen(['ffprobe',
           '-v', 'quiet', '-print_format',
           'json', '-show_format',
           '-show_streams', '-show_frames',
           video_id
           ],
           stdout=subprocess.PIPE,
       )
       return proc.communicate()[0]

    # Example video:  https://www.youtube.com/watch?v=g_OdgCrnzYo
    # youtube-dl --id -f 135 https://www.youtube.com/watch?v=g_OdgCrnzYo
    # youtube-dl --id -f 244 https://www.youtube.com/watch?v=g_OdgCrnzYo
    video_list = ['g_OdgCrnzYo.mp4', 'g_OdgCrnzYo.webm']

    '''
    Format for every frame:

       {
           "media_type": "video",
           "key_frame": 0,
           "pkt_pts": 84484,
           "pkt_pts_time": "84.484000",
           "pkt_dts": 84484,
           "pkt_dts_time": "84.484000",
           "best_effort_timestamp": 84484,
           "best_effort_timestamp_time": "84.484000",
           "pkt_duration": 33,
           "pkt_duration_time": "0.033000",
           "pkt_pos": "7103361",
           "pkt_size": "28",
           "width": 854,
           "height": 480,
           "pix_fmt": "yuv420p",
           "sample_aspect_ratio": "1:1",
           "pict_type": "P",
           "coded_picture_number": 0,
           "display_picture_number": 0,
           "interlaced_frame": 0,
           "top_field_first": 0,
           "repeat_pict": 0
       },
    '''


    # NOTE: videos do not include audio
    for video in video_list:
       output = json.loads(export_video_info(video))
       ff_bitrate = float(output['format']['bit_rate']) / 10**6
       ff_duration = float(output['format']['duration'])
       ff_codec = output['streams'][0]['codec_name']
       ff_size = float(output['format']['size'])
       frame_size_sum = 0
       for val, items in enumerate(output['frames']):
           if output['frames'][val]['media_type'] == 'video':
               frame_size_sum += int(output['frames'][val]['pkt_size'])

       frame_bitrate = frame_size_sum / ff_duration * 8 / 10**6
       print('Video Codec: {}\nVideo Bitrate: {}\nFrame Bitrate: {}\nVideo Size: {}\nFrame Total Size: {}\n\n'.format(ff_codec, ff_bitrate, frame_bitrate, ff_size, frame_size_sum))