mpeg

Using Python to extract the first 188-byte packet from MPEG Transport Stream but do not see the sync byte

橙三吉。 提交于 2020-01-16 11:12:11
问题 I have the following code in Python: with open("my_transport_stream_file.ts", "rb") as f: data = f.read(188) print(data) In my mind, I believe I am extracting the first 188 bytes from the file i.e the first transport stream packet. Here's what I get: b'G@\x00\x10\x00\x00\xb0\r\x00\x01\xc1\x00\x00\x00\n\xe0e\x8d,\xa3\xec\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff

Maximum value of PCR

谁说胖子不能爱 提交于 2019-12-30 06:50:11
问题 What is the maximum value of Program Clock Reference(PCR) in MPEG? I understand that it is derived from a 27MHz clock,periodically loaded into a 42bit register. PCR(i)=PCR_Base(i) * 300 + PCR_Ext(i) where, PCR_Base is loaded into a 33 bits register PCR_Ext is loaded into a 9 bit register. So, maximum value of PCR w.r.t 27MHz clock is: PCR = (2^33 - 1)*300 + (2^9 - 1) = 2,576,980,374,811. => (2,576,980,374,811/27,000,000) = 95443.7s = 1590.7 min = 26.5 hours The register overflow happens after

Maximum value of PCR

你。 提交于 2019-12-30 06:49:41
问题 What is the maximum value of Program Clock Reference(PCR) in MPEG? I understand that it is derived from a 27MHz clock,periodically loaded into a 42bit register. PCR(i)=PCR_Base(i) * 300 + PCR_Ext(i) where, PCR_Base is loaded into a 33 bits register PCR_Ext is loaded into a 9 bit register. So, maximum value of PCR w.r.t 27MHz clock is: PCR = (2^33 - 1)*300 + (2^9 - 1) = 2,576,980,374,811. => (2,576,980,374,811/27,000,000) = 95443.7s = 1590.7 min = 26.5 hours The register overflow happens after

MPEG-TS Segments HTTP Live Streaming

拈花ヽ惹草 提交于 2019-12-30 05:29:05
问题 I'm trying to interleave MPEG-TS segments but failing. One set of segments was actually captured using the built in camera in the laptop, then encoded using FFMPEG with the following command: ffmpeg -er 4 -y -f video4linux2 -s 640x480 -r 30 -i %s -isync -f mpegts -acodec libmp3lame -ar 48000 -ab 64k -s 640x480 -vcodec libx264 -fflags +genpts -b 386k -coder 0 -me_range 16 -keyint_min 25 -i_qfactor 0.71 -bt 386k -maxrate 386k -bufsize 386k -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -aspect 640:480

Can the ffmpeg av libs return an accurate PTS?

一笑奈何 提交于 2019-12-30 01:33:26
问题 I'm working with an mpeg stream that uses a IBBP... GOP sequence. The (DTS,PTS) values returned for the first 4 AVPackets are as follows: I=(0,3) B=(1,1) B=(2,2) P=(3,6) The PTS on the I frame looks like it is legit, but then the PTS on the B frames cannot be right, since the B frames shouldn't be displayed before the I frame as their PTS values indicate. I've also tried decoding the packets and using the pts value in the resulting AVFrame, put that PTS is always set to zero. Is there any way

How to generate timestamps from PCR in Hex

不想你离开。 提交于 2019-12-24 19:50:13
问题 When inspecting a transport stream using tsduck, I can see that some packets contains a PCR value in Hex. I am not sure how to convert these into timestamps. For example, in the packet below the PCR value is 0x000002014CE * Packet 179 ---- TS Header ---- PID: 481 (0x01E1), header size: 25, sync: 0x47 Error: 0, unit start: 1, priority: 0 Scrambling: 0, continuity counter: 4 Adaptation field: yes (21 bytes), payload: yes (163 bytes) Discontinuity: 0, random access: 0, ES priority: 0 PCR:

Audio equivalent of SPS and PPS when muxing Annex B MPEG-TS? What is “DecoderInfo”?

亡梦爱人 提交于 2019-12-24 15:33:04
问题 I'm using the Bento4 library to mux an Annex B TS (MPEG-2 transport stream) file with my h264 video and AAC audio streams that are being generated from VideoToolbox and AVFoundation respectively, as source data for a HLS (HTTP Live Streaming) stream. This question is not necessarily Bento4-specific: I'm trying to understand the underlying concepts so that I can accomplish the task, preferably by using Apple libs. So far, I've figured out how to create an AP4_AvcSampleDescription by getting

validate MPD file - using MPEG-DASH

谁说胖子不能爱 提交于 2019-12-24 06:07:17
问题 I have just started using MPEG-DASH (from the client side), following the c057623_ISO_IEC_23009-1_2012 spec. Does anyone know if there is a public lib or open source to validate MPD file I receive? I have no problem in processing the xml. Any help will be appreciated. 回答1: You may want to check this MPEG-DASH MPD Validator The DASH Industry Forum provides great software resources for all things MPEG DASH. 回答2: Here another MPD Validator from dashif: DASHIF Validator. In respect to the error

pts & pcr values limit in mpegts?

社会主义新天地 提交于 2019-12-23 17:59:55
问题 As I know PCR stored in 42bits and PTS stored in 33bits in mpegts container So, Max value for PCR is 2^42 = 4398046511104 Max value for PTS is 2^33 = 8589934592 PCR (sec) = 4398046511104 / 27 000 000 Hz = 162890,6 seconds (45 hours) PTS (sec) = 8589934592 / 90 000 Hz = 95443,7 seconds (26,5 hours) So, what I must to do, if PTS or PCR reach one of this max values ? This can be happening in iptv for continuous stream 回答1: Just let it overflow and continue to write the low 33 bits. The demuxer

Playing .mpg videos in Flash/Actionscript

狂风中的少年 提交于 2019-12-18 09:45:13
问题 Is it possible to load .mpg file and play it through actionscript/flash ? The code works well with mp4 video files. If not possible to play mpg files, the one way to make it work is converting these files? package { import flash.net.NetConnection; import flash.net.NetStream; import flash.events.AsyncErrorEvent; import flash.media.Video; import se.svt.caspar.template.CasparTemplate; public class data extends CasparTemplate { var nc:NetConnection; var ns:NetStream; var vid:Video; var textfield