kierank / libmpegts Goto Github PK
View Code? Open in Web Editor NEWTransport Stream Muxer which is spec compliant. Part of the Open Broadcast Encoder project
Home Page: http://www.ob-encoder.com/
License: GNU General Public License v2.0
Transport Stream Muxer which is spec compliant. Part of the Open Broadcast Encoder project
Home Page: http://www.ob-encoder.com/
License: GNU General Public License v2.0
Hi,
thank you for the great effort to create this library. I am trying to use it in my own project, however, I am getting garbled output in the mpeg-ts with AVC.
I have tried the following versions (2013/07/13)
libmpegts-master
libmpegts-obe-master
libmpegts-20130401-STABLE
I have used the following compilers:
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9), Target: x86_64-linux-gnu
gcc version 4.7.3 (rev1, Built by MinGW-builds project), Target: i686-w64-mingw32
gcc version 4.7.3 (rev1, Built by MinGW-builds project), Target: x86_64-w64-mingw32
The generated MPEG-TS is fine, e.g. tsreport (of tstools) as well as code.google.com/p/tsdemuxer can handle it without complaints. However, the demuxed set of NAL units is garbled. When I do a binary diff with the original bytestream, I can observe that there are a couple of bytes missing and some are inserted. The extracted h264 bitstream is also shorter than the original.
As I am using 32bit and 64 bit compilers on both Win and Linux and the problem persists, this seems to be a problem of compiling the libmpegts objects. Can you give me any hints on why this is happening and how to avoid it?
Here's the code for initialization of libmpegts
ts_program_t tsprog = {0};
tsprog.num_streams = 1;
tsprog.pcr_pid = 110;
tsprog.pmt_pid = 120;
tsprog.program_num = 1;
tsprog.sdt.provider_name = provider_name;
tsprog.sdt.service_name = service_name;
tsprog.sdt.service_type = 0x19;
tsprog.streams = (ts_stream_t_) calloc( tsprog.num_streams, sizeof(_tsprog.streams) );
if( !tsprog.streams ) {
fprintf( stderr, "malloc failed\n" );
return 1;
}
tsprog.streams[0].pid = 130;
tsprog.streams[0].stream_format = LIBMPEGTS_VIDEO_AVC;
tsprog.streams[0].hdmv_video_format = LIBMPEGTS_HDMV_1080P;
tsprog.streams[0].hdmv_frame_rate = 25;
tsprog.streams[0].hdmv_aspect_ratio = LIBMPEGTS_HDMV_AR_16_9;
tsprog.streams[0].stream_id = 224;
ts_main_t tsmain = {0};
tsmain.muxrate = 200000000;
tsmain.num_programs = 1;
tsmain.pat_period = 50;
tsmain.pcr_period = 40;
tsmain.programs = &tsprog;
tsmain.sdt_period = 1000;
tsmain.ts_id = 1;
tsmain.ts_type = TS_TYPE_GENERIC;
tswriter = ts_create_writer();
int tsts_ret = ts_setup_transport_stream(tswriter,&tsmain);
if(tsts_ret < 0)
return 0;
int tsvideo_ret = ts_setup_mpegvideo_stream(tswriter,130,30,AVC_MAIN,0,0,0);
if (tsvideo_ret < 0)
return 0;
...
When a NAL unit is ready, the following code is executed
ts_frame_t coded_frames[1];
coded_frames[0].cpb_final_arrival_time = cbp_fat;
coded_frames[0].cpb_initial_arrival_time = cbp_iat;
coded_frames[0].pts = pts;
coded_frames[0].dts = dts;
coded_frames[0].frame_type = type;
coded_frames[0].data = data;
coded_frames[0].size = data_len;
coded_frames[0].pid = 130;
uint8_t *output;
int len;
int64_t *pcrlist;
int ret = ts_write_frames(tswriter,&coded_frames[0],1,&output,&len,&pcrlist);
if(len) write...
I'd like to use libmpegts for a project requiring to mux 7 streams 3 video, 3 audio and 1 teletext.
Not sure OBE can as it stands?
Hi ,
How to rectify this problem i am getting this error when ever i played ts file by VLC Player , this means exactly what and how to rectify it.THis messages shows some TS file only no video yet to be played only black screen , this messges continues.If i played by mplayer , than it plays continuously , this happens after muxing it but source input for muxer is played by vlc without any error.
Important : This Video can able to play in all player like mplayer, ffplay or ffmpeg , Classic media player.Dont Tell me to post in mail list , i am doing this for past 1 year no response.I have checked PCR , OPCR , PTS , DTS its all accurate.For more info i can able to send file and reports.
my mail id : sakthisam(at)gmail(dot)com
main warning: received buffer in the future
main warning: received buffer in the future
main warning: early picture skipped
main warning: early picture skipped
main warning: received buffer in the future
main warning: received buffer in the future
main warning: received buffer in the future
main warning: early picture skipped
main warning: received buffer in the future
main warning: received buffer in the future
main warning: early picture skipped
main warning: received buffer in the future
main warning: received buffer in the future
main warning: early picture skipped
main warning: received buffer in the future
main warning: early picture skipped
main warning: received buffer in the future
main warning: received buffer in the future
main warning: early picture skipped
Hi ,
This is for Person who dare to do!!
How to rectify this problem i am getting this error when ever i played ts file by VLC Player , this means exactly what and how to rectify it.THis messages shows some TS file only no video yet to be played only black screen , this messges continues.If i played by mplayer , than it plays continuously , this happens after muxing it but source input for muxer is played by vlc without any error.
main warning: received buffer in the future
main warning: received buffer in the future
main warning: early picture skipped
main warning: early picture skipped
main warning: received buffer in the future
main warning: received buffer in the future
main warning: received buffer in the future
main warning: early picture skipped
main warning: received buffer in the future
main warning: received buffer in the future
main warning: early picture skipped
main warning: received buffer in the future
main warning: received buffer in the future
main warning: early picture skipped
main warning: received buffer in the future
main warning: early picture skipped
main warning: received buffer in the future
main warning: received buffer in the future
main warning: early picture skipped
Important : This Video can able to play in all player like mplayer, ffplay or ffmpeg , Classic media player.Dont Tell me to post in mail list , i am doing this for past 1 year no response.I have checked PCR , OPCR , PTS , DTS its all accurate.For more info i can able to send file and reports
If a PMT section does not fit within one TS-packet then it gets corrupted. Programs like VLC and libdvbpsi/dvbinfo complain about CRC32 being invalid.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.