LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Video transport stream .ts file format

I would like to know if anyone played with .ts files...

I have an .H264 stream from IP camera and I would like to save it as .ts file.

Tools like VLC, GStreamer, FFMPEG and such are great, but I was wondering if anyone done it directly in LabVIEW.

 

Streaming .H264 format into file directly works, and I can play and re-convert it with program mentioned above, but I would like to check if it can be done in LabVIEW (no 3-rd party) and can be played back with windows media player directly.

 

-Artur

0 Kudos
Message 1 of 5
(3,320 Views)

Hello Artur,

 

TS is not an officially supported file type for NI Vision. You can compress an AVI file, though, as shown by this KB, but it sounds like you specifically need a TS file type. There may be ways to get around the "supported" file types, but I have not personally seen them.

 

-Erik S 

0 Kudos
Message 2 of 5
(3,254 Views)

Its Ok,

I will post solution later, just checking if someone did that (I heard NI has system for video capture with output as .ts, was wondering if it was available) ...

 

Comment on NI Vision:

Stream is already compressed, just need to to be dump into file.

To make frames available for NI Vision, you just need to extract them with H264 decoder (libavcodec, or like) and pass to Vision for analysis. Not for re-compressing, other better tools available for that.

 

-Artur

0 Kudos
Message 3 of 5
(3,219 Views)

hi Artur,

 

Could you please post the solution or link to the solution. I am looking for H264 chunks extraction from MPEG2-TS stream.

 

Thanks in advance,

Ramesh

0 Kudos
Message 4 of 5
(668 Views)

Hi,

 

10 years later :)...

 

No need to use LabVIEW for this task, or at least directly.

I would use FFMPEG scripting -> https://forums.ni.com/t5/Example-Code/FFMPEG-scripting-in-LabVIEW-NET/ta-p/3515713

Plenty of ways to automate FFMPEG, from staring a separate process and use pipes for data exchange, or use Visual Studio with FFMPEG libraries.

 

In your case, you would start FFMPEG and set your MPEG-TS stream as input stream, and if you really need H264 nals (not chunks) you just specify to output back 'rawvideo' and process them on LabVIEW end. Command (from command line) should look like this:

"ffmpeg.exe -i 'your stream' -f image2pipe -c:v rawvideo - "

           For testing you can replace rawvideo with simple BMP/JPG/PNG and see it live in LabVIEW, just reduce output framerate with '-r 1' -> 1 frame per second...  

 

-Artur

0 Kudos
Message 5 of 5
(651 Views)