The presentation timestamp (PTS) is a timestamp metadata field in a video stream.
Questions tagged [pts]
78 questions
29
votes
1 answer
Understanding PTS and DTS in video frames
I had fps issues when transcoding from avi to mp4(x264). Eventually the problem was in PTS and DTS values, so lines 12-15 where added before av_interleaved_write_frame function:
1. AVFormatContext* outContainer = NULL;
2. …

theateist
- 13,879
- 17
- 69
- 109
22
votes
3 answers
Calculate PTS before frame encoding in FFmpeg
How to calculate correct PTS value for frame before encoding in FFmpeg C API?
For encoding I'm using function avcodec_encode_video2 and then writing it by av_interleaved_write_frame.
I found some formulas, but none of them work.
In doxygen example…

Ilya Zharkov
- 319
- 1
- 4
- 11
21
votes
1 answer
What is PTS in reference to video encoding?
Could someone briefly explain what the acronym PTS means in reference to video encoding?

jtrim
- 3,465
- 4
- 31
- 44
16
votes
1 answer
Audio/video synchronization, TS MPEG2;H264/AVC, understanding PTS in Handbrake
Synchronization has always fascinated me, or to be precise: why a .ts can be viewed in sync by media players, while the demuxed audio+video reassembled is out of sync.
So I'm trying to understand this, and what can be done to prevent it.
I've read…

Josh
- 311
- 1
- 3
- 11
13
votes
2 answers
Execute a command in another terminal via /dev/pts
I have a terminal that uses STDIN 3 (/proc/xxxx/fd/0 -> /dev/pts/3)
So if (in another terminal) I do:
echo 'do_something_command' > /dev/pts/3
The command is shown in my first (pts/3) terminal, but the command is not executed. And if (in this…

ton
- 3,827
- 1
- 42
- 40
9
votes
1 answer
ffprobe get pts of last audio/video packet
I have an mov file that I need to get the ending pts for both the audio and video streams. I'm able to do this by doing the following (manually):
ffprobe -show_packets file.mov
Which gives me an output like (with many more packets of…

Vinay
- 6,204
- 6
- 38
- 55
8
votes
3 answers
Can the ffmpeg av libs return an accurate PTS?
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…

hobb0001
- 191
- 1
- 2
- 7
8
votes
2 answers
-serial pty in qemu, how to open?
I am running qemu with
-serial pty
option, and qemu gave this message
char device redirected to /dev/pts/1
however, it doesn't generate new window, I can do cat on pts1 from different window,
but then I can't input any character to it.
Is there…

Isa A
- 1,342
- 13
- 31
7
votes
1 answer
How to read/write to Linux pseudoterminals using separate processes but without forking?
I'd like to write a program that emulates a device on a serial port. I'm trying to use pseudoterminals to accomplish this. I want one distinct process to control the master. This process acts as the serial device emulator. I want another process…

acker9
- 363
- 2
- 11
6
votes
1 answer
Does PTS have to start at 0?
I've seen a number of questions regarding video PTS values not starting at zero, or asking how to make them start at zero. I'm aware that using ffmpeg I can do something like ffmpeg -i

stevendesu
- 15,753
- 22
- 105
- 182
6
votes
0 answers
Stop EPOLLHUP on a closed pseudo-terminal
I am working on a small library for creating a pair of connected pts. I use an epoll fd, in which I register the master fd for two pseudo-terminals for EPOLLIN events. When my example client program starts, the event loop is idle and so it is when…

ncarrier
- 433
- 3
- 14
5
votes
0 answers
How is flv format contained in RTMP?
I'm using wireshark to inspect the packets but I'm confused by how exactly flv format is followed in RTMP streaming. FLV doc specifies the tag to be: tag type, datasize, timestamp, timestampExtended, streamID, VideoTagHeader, but I'm getting
[fmt] …

TurtleTread
- 1,297
- 2
- 12
- 23
5
votes
1 answer
ffmpeg setpts apply uniform offset without re-encoding
I have a series of videos that I'm converting from .mov to .ts and then create an HLS playlist for. I'm able to figure out the ending pts for both the audio and video streams of any given video and am apply that ending (cumulative) offset when…

Vinay
- 6,204
- 6
- 38
- 55
5
votes
0 answers
VLC: "avcodec error: more than 5 seconds of late video"
I'm muxing mpeg4 video to avi container. The video stream is ~4fps, so I set AVCodecContext time_base to 1/4 (formatContext->streams[0]->codec->time_base...) , and then rescal each frame timestamp, because the original time-stamps are in…

Igor R.
- 14,716
- 2
- 49
- 83
5
votes
1 answer
monitoring and logging /dev/pts/1, under linux
I want to monitor and log a pseudo-terminal device /dev/pts/12 (for debugging purposes), i.e. I want to see what gets written to the terminal and I do not want any process using the terminal to notice.
The obvious solution
cat /dev/pts/1
…

John Quilder
- 425
- 4
- 12