What is DTS/PTS in (conversion) video streams;

Source: Internet
Author: User
Translated: Q:
Hi, this may be a mental retardation, but when I use bbmeg1.24beta17 encoding, I always encounter this underflow problem. The only revelation I get from the log file is that I should change the MUX rate... However, the help documentation says that setting the MUX rate to 0 can force the value to be calculated by the encoder. Does anyone know what value I should set? Can someone accurately describe what is pts/DTS? I have been playing with a sigmadesigns ns2000 card, but I have not seen my video effect yet...

###
Input information
Video:
Width: 720, height: 480
First frame: 1, number of frames: 300000
Audio:
Sample Rate: 48.0 kHz
Channels: stereo
Bits per sample: 16
Output MPEG Information
Video: C:/winnt/profiles/jstarkey/desktop/videoout. m2v, deleted if multiplexed
MPEG-2, 720x480 @ 29.97 FPS, variable bitrate, quant value = 1
Audio: C:/winnt/profiles/jstarkey/desktop/videoout. MP2, deleted if multiplexed
Layer 2, 64 Kbps, 48.0 kHz, stereo
Multiplexing: video and one audio stream
Program Stream type: MPEG-2 with pulldown auto-detection
Video file: C:/winnt/profiles/jstarkey/desktop/videoout. m2v
Audio 1 file: C:/winnt/profiles/jstarkey/desktop/videoout. MP2
Program file: C:/winnt/profiles/jstarkey/desktop/videoout
Encoding video:
Video Encoding finished at frame #1228.
Min bitrate of any one frame = 2773 bits
Max bitrate of any one frame = 339049 bits
Min bitrate over any one second = 1486741 BPS
AVG bitrate over any one second = 2706791 BPS
Max bitrate over any one second = 3040605 BPS
Total time: 1658 seconds (00:27:38), 0.74 frames/sec, 1.350 SEC/frame.
Encoding audio:
AVG slots/frame = 192.000; B/SMP = 1.33; BR = 64.000 kbps.
Multiplexing video and audio:
Scanning video stream for a sequence header and pulldown type...
No pulldown detected...
Scanning video stream for pictures...
Found 1242 picture headers.
Video Stream Information
Streamlength: 15621086
Total time (seconds): 41
Sequence start: 83
Sequence end: 1
No. Pictures: 1242
No. Groups: 83
No. I frames: 82 avg. Size 21925 bytes
No. P frames: 332 avg. Size 16821 bytes
No. B frames: 828 avg. Size 9958 bytes
No. D frames: 0 avg. Size 0 bytes
Horizontal size: 720
Vertical size: 480
Aspect Ratio: 0.6735
Picture rate: 29.970 frames/sec
Bit Rate: 375000 Bytes/sec (3000000 bits/sec)
Computed AVG rate: 377500 Bytes/sec (3020000 bits/sec)
Computed Max rate: 1798000 Bytes/sec (14384000 bits/sec)
Vbv buffer size: 194560 bytes
CSPF: 0
Scanning audio stream for access units Information
Found 1710 audio frame headers.
MPEG audio stream information
Streamlength: 328320
Syncwords: 1710
Frames: 1710 size 192 bytes
Frames: 0 size 193 bytes
Layer: 2
CRC checksums: No
Bit Rate: 8000 bytes/sec (64 kbit/sec)
Frequency: 48.0 kHz
Mode: 0 stereo
Mode Extension: 0
Copyright bit: 0 no copyright
Original/copy: 0 copy
Emphasis: 0 none
Multiplexing Information
Video Stream Data Rate: 1798000 Bytes/sec (14384000 bits/sec)
Audio Stream 1 data rate: 8000 bytes/sec (64000 bits/sec)
Overhead data rate: 32350 Bytes/sec (258800 bits/sec)
Total data rate: 1838350 Bytes/sec (14706800 bits/sec)
Multiplexing file C:/winnt/profiles/jstarkey/desktop/videoout
Video PTS (41287.73 ms) underflow at pack 7288 by 35.57 Ms
Video PTS (41321.10 ms) underflow at pack 7351 by 72.43 Ms
Video DTS (41354.47 ms) underflow at pack 7416 by 111.53 Ms
Video PTS (41387.83 ms) underflow at pack 7506 by 178.50 Ms
Video PTS (41421.20 ms) underflow at pack 7572 by 218.71 Ms
Video DTS (41454.57 ms) underflow at pack 7635 by 255.58 Ms
Video PTS (41487.93 ms) underflow at pack 7725 by 322.55 Ms
Video PTS (41521.30 ms) underflow at pack 7783 by 353.84 Ms
Video DTS (41554.67 ms) underflow at pack 7843 by 387.36 Ms
9 video underflows (Scr> = PTS or DTS)
Note: The resulting file may not play back correctly.
Try increasing the MUX rate.
Finished multiplexing C:/winnt/profiles/jstarkey/desktop/videoout
###
A: From: Beyeler
To: jamuels
DTS (Decoding timestamp) and PTS (displaying timestamp) are the time stamps relative to the SCR (system reference) when the decoder decodes and displays frames. SCR can be understood as the time when the decoder should start reading data from the disk.
Each packet in the mpeg file has an SCR timestamp, which is the system time when the data packet is read. Generally, the decoder starts the system clock when it starts reading the mpeg stream (the initial value of the system clock is the SCR value of the first data packet, it is usually 0, but it can also not start from 0 ).
The DTS timestamp determines that the decoder performs decoding when the SCR time is equal to the DTs time. The PTS timestamp is similar. Generally, the DTS/PTS timestamp indicates a time later than the SCR time in the audio/video package. For example, if the SCR of a video packet is 100 ms (meaning this packet is read from the disk after playing for 200/280 ms), the DTS/PTS value is about Ms, this indicates that when SCR reaches ms, the video data should be decoded and displayed after 80 ms (the video data is stored in a buffer until decoding starts)
Downstream Overflow usually occurs when the MUX rate related to the video data stream is too high. If the MUX rate is 1000000 bits/sec (meaning that the decoder needs to read files at 1000000 bits/sec ), however, the video speed is 2000000 bits/sec (meaning that video data needs to be displayed at a rate of 2000000 bits/sec ), when reading video data from a disk, the speed is not fast enough to prevent reading enough video data within one second.
. In this case, the DTS/PTS timestamp indicates that the video is decoded or displayed before it is read from the hard disk (the DTS/PTS timestamp is earlier than the SCR time in the packets containing them ).
Nowadays, relying on decoder is basically not a problem (although the mpeg file should not be full and not fully compliant with the MPEG standard ). Some decoders (many well-known PC-based players) read files as quickly as possible to display videos. If possible, they directly ignore SCR.
Note that in the list you provide, the average video stream speed is ~ 3 Mbps (3000000 bits/sec) but its peak value reaches 14 Mbps (relatively large, with a DVD limit of Mbps ). This means that the MUX rate needs to be adjusted to be large enough to process the 14 Mbps portion. The MUX rate calculated by bbmpeg is sometimes too low, leading to underflow.
Are you planning to make the video stream speed so high? This has exceeded the description of the DVD, and it is likely that it cannot be played in most independent playback. If this is not the case, I will increase the mquant value from 1 and set the maximum bitstream to 9 Mbps in the video settings to keep a smaller bitstream.
If you really want to make the video bit rate so high, you need to increase the MUX rate. From the provided list, we can see that bbmpeg uses 14706800 bits/sec or 1838350 Bytes/sec MUX rate (the total data rate is 1838350 Bytes/sec (14706800 bits/sec) rows ). The value you set in the Force MUX rate field should be in bytes/sec units and be divisible by 50. So I will start from 36767 (1838350/50) and keep increasing until there will be no overflow errors;


From: jamuels Mar-2 pm
To: All (1 of 3)
329.1
Hi,
This is probably a dumb question, but I'm 've been experiencing underflow errors on some
Material that I 've encoded with bbmeg 1.24 beta 17. The only thing I can deduce from
Log File is that I shocould change the MUX rate... but the Help file says that setting the MUX Rate
To "0" will force it to be computed by the encoder. Any ideas as to what value I shocould try?
Wocould someone mind describing what exactly pts/DTS are and how underflows can impact
The final program (or point me to a relevant source of info )? I 've been playing back with
Sigma designs ns2000 card and haven't seen my video affected per se ..
BTW, I 've enclosed my log file for reference.
Tia and regards,
JPS
###
Input information
Video:
Width: 720, height: 480
First frame: 1, number of frames: 300000
Audio:
Sample Rate: 48.0 kHz
Channels: stereo
Bits per sample: 16
Output MPEG Information
Video: C:/winnt/profiles/jstarkey/desktop/videoout. m2v, deleted if multiplexed
MPEG-2, 720x480 @ 29.97 FPS, variable bitrate, quant value = 1
Audio: C:/winnt/profiles/jstarkey/desktop/videoout. MP2, deleted if multiplexed
Layer 2, 64 Kbps, 48.0 kHz, stereo
Multiplexing: video and one audio stream
Program Stream type: MPEG-2 with pulldown auto-detection
Video file: C:/winnt/profiles/jstarkey/desktop/videoout. m2v
Audio 1 file: C:/winnt/profiles/jstarkey/desktop/videoout. MP2
Program file: C:/winnt/profiles/jstarkey/desktop/videoout
Encoding video:
Video Encoding finished at frame #1228.
Min bitrate of any one frame = 2773 bits
Max bitrate of any one frame = 339049 bits
Min bitrate over any one second = 1486741 BPS
AVG bitrate over any one second = 2706791 BPS
Max bitrate over any one second = 3040605 BPS
Total time: 1658 seconds (00:27:38), 0.74 frames/sec, 1.350 SEC/frame.
Encoding audio:
AVG slots/frame = 192.000; B/SMP = 1.33; BR = 64.000 kbps.
Multiplexing video and audio:
Scanning video stream for a sequence header and pulldown type...
No pulldown detected...
Scanning video stream for pictures...
Found 1242 picture headers.
Video Stream Information
Streamlength: 15621086
Total time (seconds): 41
Sequence start: 83
Sequence end: 1
No. Pictures: 1242
No. Groups: 83
No. I frames: 82 avg. Size 21925 bytes
No. P frames: 332 avg. Size 16821 bytes
No. B frames: 828 avg. Size 9958 bytes
No. D frames: 0 avg. Size 0 bytes
Horizontal size: 720
Vertical size: 480
Aspect Ratio: 0.6735
Picture rate: 29.970 frames/sec
Bit Rate: 375000 Bytes/sec (3000000 bits/sec)
Computed AVG rate: 377500 Bytes/sec (3020000 bits/sec)
Computed Max rate: 1798000 Bytes/sec (14384000 bits/sec)
Vbv buffer size: 194560 bytes
CSPF: 0
Scanning audio stream for access units Information
Found 1710 audio frame headers.
MPEG audio stream information
Streamlength: 328320
Syncwords: 1710
Frames: 1710 size 192 bytes
Frames: 0 size 193 bytes
Layer: 2
CRC checksums: No
Bit Rate: 8000 bytes/sec (64 kbit/sec)
Frequency: 48.0 kHz
Mode: 0 stereo
Mode Extension: 0
Copyright bit: 0 no copyright
Original/copy: 0 copy
Emphasis: 0 none
Multiplexing Information
Video Stream Data Rate: 1798000 Bytes/sec (14384000 bits/sec)
Audio Stream 1 data rate: 8000 bytes/sec (64000 bits/sec)
Overhead data rate: 32350 Bytes/sec (258800 bits/sec)
Total data rate: 1838350 Bytes/sec (14706800 bits/sec)
Multiplexing file C:/winnt/profiles/jstarkey/desktop/videoout
Video PTS (41287.73 ms) underflow at pack 7288 by 35.57 Ms
Video PTS (41321.10 ms) underflow at pack 7351 by 72.43 Ms
Video DTS (41354.47 ms) underflow at pack 7416 by 111.53 Ms
Video PTS (41387.83 ms) underflow at pack 7506 by 178.50 Ms
Video PTS (41421.20 ms) underflow at pack 7572 by 218.71 Ms
Video DTS (41454.57 ms) underflow at pack 7635 by 255.58 Ms
Video PTS (41487.93 ms) underflow at pack 7725 by 322.55 Ms
Video PTS (41521.30 ms) underflow at pack 7783 by 353.84 Ms
Video DTS (41554.67 ms) underflow at pack 7843 by 387.36 Ms
9 video underflows (Scr> = PTS or DTS)
Note: The resulting file may not play back correctly.
Try increasing the MUX rate.
Finished multiplexing C:/winnt/profiles/jstarkey/desktop/videoout
Options reply
From: Beyeler Mar-5 pm
To: jamuels (2 of 3)
329.2 in reply to 329.1.
The DTS (Decoding time stamp) and PTS (Presentation Time Stamp) timestamps are when
The decoder is supposed to decode and display the frame relative to the SCR (system clock
Reference) timestamp. the SCR can be thought of as the time the decoder is supposed to read
The data from the disk.
Every packet of data in the mpeg file has an SCR Timestamp and this timestamp is the value
The system clock shoshould be at when the packet is read. Usually, a decoder will start the system
Clock when it starts reading an MPEG stream (the initial value of the system clock is the SCR
From the first packet of data, usually zero but it does not have to start at zero ).
The DTS timestamp tells the decoder to decode the frame when the SCR time reaches
DTS time, likewise for the PTS timestamp. Usually, the DTS/PTS timestamps indicate a time
Later than the SCR of the packet the video/audio appear in. For example, if the SCR of
Packet of video data is 100 ms (meaning it is read from the disk 100 ms after the start
Playback), the DTS/PTS values wocould be something like 200/280 ms, meaning when the SCR
Reaches 200 ms this video data is supposed to be decoded and then 80 ms later it is to be
Displayed (the video data is held in a buffer until decoding time ).
Underflows usually occur when the video data rate is too high with respect to the muxing rate.
If the muxing rate is 1000000 bits/sec (meaning the decoder will read 1000000 bits/sec from
The file), but the video bitrate is 2000000 bits/sec (meaning 2000000 bits/sec are needed
Display a seconds worth of video data), the video data is not being read off the disk fast
Enough to read all the video bits needed for one second. In this case the DTS/PTS timestamps
Will indicate the video was to be decoded/displayed before it is read from the disk (
DTS/PTS timestamps are earlier in time than the SCR timestamps of the packet they are
Contained in ).
Now depending on the decoder, this can be a problem or not (although the mpeg file is not
MPEG compliant as there shoshould be no underflows !). Some decoders (most notably PC based
Players) read the file as fast as needed to display the video, ignoring the SCR as needed.
Note that in the listing you provide, the average video bitrate is ~ 3 Mbit/s (3000000 bits/sec)
But that it peaks as high as 14 Mbps (rather large, DVD is limited to 9.8 Mbps). This means
MUX rate needs to be large enough to handle the 14 Mbps part and bbmpeg's calculated MUX
Rate is sometimes too low leading to underflows.
Are you intending the video bitrate to be so high? This is beyond DVD specifications and
Probably not playable on most standalone players. If not, I wocould either increase the mquant
Value from 1 or enter a maximum bitrate of 9 Mbps on the video settings page to keep
Bitrate down a bit.
If you do want the video bitrate to be that high, you will need to increase the MUX rate. From
The listing provided, bbmpeg determined the MUX rate to be 14706800 bits/sec or 1838350
Bytes/sec (the total data rate: 1838350 Bytes/sec (14706800 bits/sec) Line). The value you
Wocould enter in the Force MUX Rate Field wocould be the bytes/sec value divided by 50. So I
Wocould start with 36767 (1838350/50) and increase the value from there until you get rid
The underflow messages. From: http://blog.csdn.net/baymoon/article/details/1419184

What is DTS/PTS in (conversion) video streams;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.