03-21-2017 09:04 AM
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
Solved! Go to Solution.
03-22-2017 05:58 AM
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
03-22-2017 07:14 AM
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
03-22-2017 09:23 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
03-29-2017 12:37 AM
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
02-18-2018 10:22 PM - edited 02-18-2018 10:22 PM
can you please show me the step to doing that? i tried but didnt work correctly.
Thanks