Gstreamer Video Subtitles

Source: Internet
Author: User
Tags gstreamer

First, Process brief:

1, the first involves the plug-in type Textoverlay, the plug-in will detect whether the streaming media contains subtitles, if there is a subtitle will be called Pango and Cairo Library, the subtitle string into a picture, Compositon for processing unit and video buffer along with the pass down.

2. On the Vaapisink side, the Vaassociate () will be called and the caption picture will be fused together with the video frame to display.


Second, performance improvement:

Modified on the basis of the principle design, the previous design creates a subpicture in the video memory when each frame is displayed, which causes a large amount of data to be copied from the system memory to the video memory. As long as subtitles appear, the CPU occupancy rate will increase a lot, so it will consume a lot of resources.

Improvement: In every video surface, as long as you find subtitles are not the same will be to create subpicture, or directly return, so the same title created by the number of video surface is equal to the number, greatly improved before each frame will be to create efficiency.

Two caption Stream commands are displayed:

gst-launch-0.10 filesrc Location=/root/video_test/darkshadows_2ch_6ch_figs_17tracks.mp4! \

Qtdemux name=dmx \

Multiqueue name=mq \

Textoverlay name=tone \

Textoverlay Name=ttwo valignment=2 \

Dmx.video_00! Mq.sink0 MQ.SRC0! Vaapidecode! Tone.video_sink \

Dmx.audio_00! MQ.SINK1 MQ.SRC1! Queue! Faad! Alsasink \

Dmx.subtitle_00! MQ.SINK2 MQ.SRC2! Tone.text_sink \

Dmx.subtitle_01! Mq.sink3 MQ.SRC3! Ttwo.text_sink \

Tone.src! Ttwo.video_sink TTWO.SRC! Vaapisink


Gstreamer Video Subtitles

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.