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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

converting video formats

Solved!
Go to solution

I need to convert an AVI file I have created in LabVIEW into somthing more compact. It looks as if I convert it into a MP4 file using a H264-MPEG-4 AVC codec or similar, I can compress the AVI file down to 3-4 % of original size in AVI.

I don't think there are any LabVIEW tools available for the job, but if I could locate an external executable that take some input parameters , so I could run it with the System Exec.vi.

Anybody, anything ?.......

Martin

0 Kudos
Message 1 of 6
(5,623 Views)

Hi MartinP

 

As far as I know there is no way of saving as an MP4 directly from LabVIEW, but I like the idea of using System Exec.vi.

 

FFmpeg might do the trick: it takes command line arguments such as:

ffmpeg -i input.avi -q:v 1 output.mp4

You could even string together a bunch of these commands into a batch file and execute that.

 

[Disclaimer: NI are not responsible for the content of the external link.]

 

Let me know if this is what you are looking for!

 

Best regards,

 

Leah

Message 2 of 6
(5,584 Views)

Leah

Yes, it is something like this I'm looking for. Right now I'm working on testing it out using the libav system (avconv.exe), a solution found under https://libav.org/about/ .

If I get into problems with this one, I'll go back and test FFmpeg, as you suggest.

Thanks for your input.

Martin

 

0 Kudos
Message 3 of 6
(5,578 Views)

I've also used the command line tools of VLC to convert media files.  In the past I could extract the audio from any video that VLC can play (no need to know the codec) and into any audio format.  I assume the video converting tools have similar command line functions.

0 Kudos
Message 4 of 6
(5,568 Views)
Solution
Accepted by topic author MartinP

I can add that the conversion worked very good.

Example; starting with a original BIN file at 15 110 621 KB.

The resulting AVI file was 329 597 KB after converting with the LabVIEW tools..

Then I used the libav system run from SystemExec, and

converted  the AVI file into an MP4 format. This ended up as filesize 14 962 KB. This means a total reduction down to 0.1% of the original, from BIN to MP4. That was a very good result to me.

Martin

0 Kudos
Message 5 of 6
(5,542 Views)

can you please show me the step to doing that? i tried but didnt work correctly.

 

 

Thanks


Day@
Certified LabVIEW Associate Developer
0 Kudos
Message 6 of 6
(4,994 Views)