From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

FFMPEG Video Reader (Read MP4, and all codecs supported by FFMPEG)

Code and Documents

Attachment

Overview

Use Windows Pipes to read video frames encoded with any codec supported by FFMPEG

Description

Early stages of a FFMPEG reader for Labview.  Hoping to add writing capabilities soon.

Steps to Implement or Execute Code

  1. Read the readme file included

Requirements

Software

Labview 64 bit, Vision Tool Kit

Hardware

Multi Core Computer

Additional Images or Video


Provided

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
dirtyb15
Member
Member
on

Having trouble getting the write to work so far,  i get an output file but then ffmpeg hangs after it receives the last frame to write and file is corrupt.  I can post what i have if anyone has any ideas....

Kookmin
Member
Member
on

Could you save as Labview version 2011 please. Besides, I want to ask is this possible to count how many image frames of one .mp4 video?

Thank you!

Trang Nguyen
mtedaldi
Member
Member
on

Thank you very much. Despite a few glitches it works.

I'm working on improving the performance with the big video. I'm still looking for the cause of the slowdown.

It seems, ffmpeg is finished with decoding really fast but LabVIEW is struggling with getting the data from stdout of ffmpeg at the desired speed (I take memory consumption and the profiling tool as a guide).

So far I've mainly cleaned up the code and made a few optimizions.

LV_ffmpeg.PNG

This is the receiver/display loop after cleaning up with the part in the subVI looking like this:

LS_ffmpeg_rgb2image.PNG

This is considerably faster than using the "RGBtoColor" on every single pixel but does not really solve the issue.

Did you make any progress on performance there?

--
Marco Tedaldi, University of Zurich, CLAD
dirtyb15
Member
Member
on

Unfortunately i have started on a different project and this has been put on the back burner although i would love to get it working a little better. (I thought about trying to use a dll instead of pipes, but again, no time lately.)  Please let me know if you get anywhere with it.  Feel free to upload your changes as well, anyone should be able to edit the document.

thanks!

GriffinRU
Member
Member
on

Hi,

You might find some of performance solutions in my FFmpeg version:

https://decibel.ni.com/content/docs/DOC-43009

-Artur

Contributors