Some formats, like MPEG, use what they call "B" frames (B stands for "bidirectional"). To understand these two values, you need to know about the way movies are stored. Instead, packets from the stream might have what is called a decoding time stamp (DTS) and a presentation time stamp (PTS). However, if we simply synced the video by just counting frames and multiplying by frame rate, there is a chance that it will go out of sync with the audio. Audio streams have a sample rate, and the video streams have a frames per second value. So what do we do?įortunately, both the audio and video streams have the information about how fast and when you are supposed to play them inside of them. It plays the video, yeah, and it plays the audio, yeah, but it's not quite yet what we would call a movie. So this whole time, we've had an essentially useless movie player. While this code still works, it doesn't look good, and there are many more improvements that this tutorial could use. Today, it is a totally different program, and improvements in the ffmpeg libraries (and in ffplay.c itself) have caused some strategies to change. When I first made this tutorial, all of my syncing code was pulled from ffplay.c. Text version Tutorial 05: Synching Video Code: tutorial05.c CAVEAT
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |