Several Issues about VLC playing m3u8 files based on HLS Protocol

Source: Internet
Author: User

I have been busy recently. I just took over a live video and on-demand video broadcast project. The video stream on the server is based on the HLS protocol. I will not introduce the HLS protocol here. Please refer to the official website of apple. When I took over the project, I tried several open-source players, such as mplayer, VLC, and ffplayer. The effects were not very good. When playing m3u8 list, there were more or less problems. After consideration, I chose VLC, read the VLC source code for about a week, and have some knowledge about the VLC source code architecture. I focused on the main process of playing m3u8, parsing m3u8 files in VLC is in modules \ stream_filter \ httplive. c file.

After a playback test, it is found that there is no problem in VLC playing live streams, but it can also be understood as live streaming. However, its m3u8 file tag is somewhat different from Vod, I don't know why different tags are generated when the server is split. After analysis, it is found that VLC does not support HLS protocol well and does not support HLS protocol labels. After two days of modification, the problem of VOD and playback was solved.

However, this problem occurs again. The current playback time and video length are not realistic during VOD and playback. After investigation, we found that httplive. C does not have this part at all.CodeAfter a day of hard work, add this part of code to solve this problem.

When calculating the video length, it is related to the HLS Protocol version number ....... If the version number is smaller than 3, it is obtained as an integer. Otherwise, it is a floating point type. The integer is different from the actual video length ......

If you need to solve this problem, contact me ...... RMB

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.