[Libav-user] How to get TS packets directly in to my program from FFmpeg

Zach Swena zcybercomputing at gmail.com
Fri Nov 14 17:00:23 CET 2014


I am developing a software for managing an ATSC TV broadcast and would like
to use FFmpeg as the encoding engine.  The structure of my program requires
that it be fed 188 byte mpeg 2 TS packets.  Could someone point me toward
the best way to utilize FFmpeg such that I can control the start/stop and
acquire the TS packets in my program directly without writing to hard drive
or broadcasting them over the network?  I need to be ready to encode at the
close of a relay so I do not miss the first few seconds of the emergency
alerts and also add black padding on either end.  The solution I think I am
going to need is to continuously encode with FFmpeg and implement a
circular buffer in my program to capture the moments just prior to a relay
closure.  My program can then process and send the packets.  I haven't
linked to FFmpeg before, so any pointers would be appreciated.  I am using
Qt Creator and c++ and mingw32 for my development environment.  I need to
be able to process the packets in my program to add splice flags, and other
things, so outputting directly from FFmpeg isn't desirable.  Is FFmpeg
stable enough to run in this manner 24/7 assuming my code is also?

 This project will be hosted at:



PS: I may have some more questions or comments once I finish analyzing the
FFmpeg stream for PCR compliance.  I currently have to re-stamp PCR using
libvlc, but FFmpeg has DTS, so I can't test that until I update the
re-stamping code or finish writing a PCR analyzer.  Course PCR causes
stutter with decode on TV sets.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20141114/14d95995/attachment.html>

More information about the Libav-user mailing list