"Ffmpeg basics" Chinese version - 24. The video network

24. A network video

Note: There is no relationship between this and FFmpeg itself, mainly about how to add a Flash or HTML5 audio and video, as well as some video sharing sites, and paying for uploading video and other information. Such as HTML5 familiar, skim what you can, while HTML5 as a deeper understanding and learning, please go out and right away, look yourself.

Because the Internet is everywhere, so it is a show we use FFmpeg to create or edit video media to complete the best way. In addition to upload videos to popular video sharing sites, such as YouTobe, Vimeo addition, we should also know how to add media files at one glance. If you want to make sure that users use different browsers have different media and support you can listen to and watch audio and video, it would be best provided in the form of HTML5 your media file, the next alternative is to use Adobe Flash Player .

Note: Adobe Flash Player is outdated, Microsoft has announced that Flash is no longer updating and maintaining the.

Browser support for HTML5

Add a media file is relatively simple, equipment HTML5 browsers will naturally support, this device will not be Flash Player, therefore is very useful to know what the media formats supported by various browsers on the page using HTML5. FFmpeg your audio and video can be converted to any desired format. OGG container file using the Theora video codec and Vorbis audio codec, which is free, can also be used in commercial projects. WebM format is also free to use. Note: FFmpeg using the FLAC codec to encode audio in default, and the browser does not support this encoding, plus -acodec libvorbis option must therefore be used.

Here Insert Picture Description

IE browser support for HTML5 version 9 is started, the previous version can be installed such as 6,7,8 a Google browser plug-in, download address:

https://developers.google.com/chrome/chrome-frame

The website has an online test can help you to view the current using a browser that supports HTML5 certain specific characteristics:

http://html5test.com

Add audio in HTML5

Want to barge in on the major browsers send audio, the most common format is MP3, which can be used in addition to any mainstream Firefox browser, and in the Firefox browser we can use OGG or WAV format . We use the HTML5 audio tag to add audio:

Here Insert Picture Description

Since we want to specify at least two different audio file formats, then the time in the audio tab, we do not apply src attribute (because it can only specify a file) but in the <audio> and </ audio> of inter add multiple source tags. The browser will scan the added media files, then select the first one of its supported formats to play.

Here Insert Picture Description

The following is an example of an add audio HTML5, only the relevant part of the audio is taken:

<audio controls='controls' loop='loop'>
	<source src='music.mp3' type='audio/mpeg' />
	<source src='music.ogg' type='audio/ogg' />
</audio>

If you want to automatically start playing, you can add the attribute autoplay = 'autoplay'.

Here Insert Picture Description

Add video in HTML5

In HTML5, we use the video tab to add video, in which only one value autoplay, controls, loop and mute properties that they own the name itself, but most browsers will ignore their values, as long as these properties appear is equivalent to set this property, it does not appear to be set.

Here Insert Picture Description

You want to play video in all major browsers, we must provide at least 2 different formats, and the best option is to MP4 WEBM. Therefore, the above audio and similar, should not use the src attribute, try to use the source label. In this case, the browser will scan video format, which find the first supported playback formats.

Add a simple example of the video:

Here Insert Picture Description

Add video using Flash Player

While the overall trend of Flash from bad to worse, but do not support HTML5 browsers, we then need to make it to play video. At this point we can use the video object tags and labels to play a SWF video format. If the object contains a param tag and embed tags, then the browser will not support video (English version here object, feels wrong) Tags:

Here Insert Picture Description

Video sharing sites

After the successful launch of YouTube video sharing service, many English-speaking countries or other countries have followed suit languages ​​such sites. YouTube remains by far the most popular, but some other service website also provides some additional features. Almost all video sharing site supports the following media formats: 3gp, avi, asf, flv, mkv, mp4, mpegps, mov, ogg, wmv and so on. The most popular video sharing sites are listed below:

Here Insert Picture Description

Support for video processing network services

Because ffmpeg and popular network sharing site, some websites provide video processing functionality, their actual processing is done using ffmpeg in the server, it consumes more CPU resources than a traditional website. The following table lists several related websites, as well as some of the parameters they provide:

Here Insert Picture Description

Upload video monetization

Note: The Web site is for the original video or other video paid, and FFmpeg nothing to do ah, no translation, see the original.

Here Insert Picture Description

H&A
Released seven original articles · won praise 4 · Views 878

Guess you like

Origin blog.csdn.net/qq_34305316/article/details/103938706