I worked well today.
I have done three things today, one was that I made my tv playing test program play deinterlaced video well, another was I made it play video with a video buffer queue, and the size of queue could be changed by your choice, the third thing was to have made the tv program can play tv in fullscreen mode. All the three things was been done in one day, that was very exciting. I will show the key functions about realizing those functions as follows;
1, To play deinterlaced video
when you decode one frame using avcodec_decocd_video function and img_convert it to YUV420P pixal format, then you can use avpicture_deinteralce the picture to a temporary AVPicture variable, that temporary AVPicture variable is right the deinterlaced frame;
2, To play tv video with a queue
The queue I have used is a cycle queue, and it is a array in a simple word. You start one thread to grab frames from tv card and put it into the queue sequently, and start another thread to read one frame from the queue following previous thread and display it on the screen, that's all. I think you can make it.
3, To play tv video in full screen mode
You can use some functions such as img_resample_init(img_resample_full_init, this functions is more complex than the former), img_resample, img_resample_close to manipulate the frame to be displayed onto the window. It's OK.
I have done three things today, one was that I made my tv playing test program play deinterlaced video well, another was I made it play video with a video buffer queue, and the size of queue could be changed by your choice, the third thing was to have made the tv program can play tv in fullscreen mode. All the three things was been done in one day, that was very exciting. I will show the key functions about realizing those functions as follows;
1, To play deinterlaced video
when you decode one frame using avcodec_decocd_video function and img_convert it to YUV420P pixal format, then you can use avpicture_deinteralce the picture to a temporary AVPicture variable, that temporary AVPicture variable is right the deinterlaced frame;
2, To play tv video with a queue
The queue I have used is a cycle queue, and it is a array in a simple word. You start one thread to grab frames from tv card and put it into the queue sequently, and start another thread to read one frame from the queue following previous thread and display it on the screen, that's all. I think you can make it.
3, To play tv video in full screen mode
You can use some functions such as img_resample_init(img_resample_full_init, this functions is more complex than the former), img_resample, img_resample_close to manipulate the frame to be displayed onto the window. It's OK.

本文分享了一日内完成的三项电视播放功能优化:实现交错视频流畅播放、通过缓冲队列播放电视视频并支持队列大小调整以及全屏模式播放电视节目。文章详细介绍了这些功能的具体实现方法。

1万+

被折叠的 条评论
为什么被折叠?



