Playing Uploaded Videos or embed youtube videos - html

I'm creating a Content Management System that allows the content manager to upload videos to the server. There will be a list of pages and each one will have a video on it. Each video should then be able to be played by the content observer.
Problem: I can get some videos to play, but I cannot get all of them to play and I don't know why. How do I force the content manager to upload only videos that work or convert videos that do not work? I've used embed, object, iframes, and videos tags, but I can't to get any of them to work all the time. This link is what I have tried. http://ww.w3schools.com/html/html_videos.asp
Alternative Solution: Just make the content manager upload videos to youtube, then put the embed code in the database and call for it when you need it. This works but the code does not validate when you do this which is bad for SEO. Also, if the content manager does not do it correctly he could be advertising for the competition because the video can show links to other videos when it is done.

It is hard. In our CMS you need verify the content, probably in a async procedure, and reject the video if there is something wrong. The most important is choose a good set of formats and codecs (and other characteristics like Frames Per Second, Audio Bitrate, etc) and make this "contract" something very explicit. ffmpeg with -i option can identify the video, extension, codec, length, aspect-ratio, etc.
You also try to convert from any format to one good format like mp4 h264 with 360p.

Related

Source of YouTube video can't be find on HTML

I just wondering how youtube displays the Video on their web app without the tag?
I also want to implement that kind of technique from my other future web apps.
TL;DR
It's because the video is streamed asynchronously, and not loaded at once. In HTML you will only find a player-container, which is a placeholder for the frames to be fed into it.
A bit more
When you click on a video, the metadata of the video loads first (title, description, etc.), then the stream flows through a socket, depending on the settings you have.
If there were a a fixed source in the HTML for which the video is loaded, changing the settings (playback speed, resolution, etc.) would have resulted in a page refresh!
In addition, YouTube prevents un-permissioned video downloads for a while now, another reason why not to provide a direct source to the video blob.

Embed code html to play rtmp stream with additional attributes?

does any one know the way to play, rtmp stream with attributes embded on a website?
Also if i have:
rtmp://$OPT:rtmp-raw=rtmp://xx.xx.xx.xx/live?idp=4050/rer_835660 playpath=rofl swfUrl=http://www.somewww.com/tv/swf/player.swf?file=redtofile&autostart=true&/2/3 live=1 pageUrl=http://www.somewww.com/tv/get_file.php
the real rtmp link is:
rtmp://xx.xx.xx.xx/live?idp=4050/rer_835660/rofl
some of rtmp will play if there is no token for swf player protection. That is why i need swfUrl and pageUrl added and sometimes Decrypt option.
Is it even possible? I know that vlc have some issues with playing such as url's.
//edit:
I know that my link does play in SimpleTV but i have to get it every time it changes. I have written php script so it fetches actual link for me as soon as I open my webpage. So i know its correct.
Just need to find way to play it, with anything, except SimpleTV.
Preferably Embed code for website, normal rtmp links i play via vlc plugin, but it does not support such as long rtmp links, example shown above. I might be wrong? That might be me could phase or construct correctly rtmp link.

uploaded video only audio is displayed

I am trying to upload an MP4 file. But with this specefic file only the sound content is displayed.
With all my other videos there is no problem only with this specefic one.
i found the following SO question:
HTML5 video of type video/mp4 playing audio only
Where he suggest to find a converter.
Does anyone know if this could be the problem and how do i secure that regardless of what video my user uploads that it will always be able to play?
Yes, this can be a problem.
You have not written about your server limitations, so if you have the possibility to execute converters (like ffmpeg) then this is the best solution. This way you can also guarantee fixed resolution, framerate and various other properties, and your server won't eat up all the space if someone uploads a 2GB video... (Users can be dumb sometimes.)
If you cannot run ffmpeg on the server then try reading some about how can you detect codecs on your server, in the language you use, etc. Then, if you still want to, post a specific question.
Also try opening your videoplayer page with different browsers (Chrome, FF, IE at least). They might not support the codecs the same way.

Load only audio from youtube in as3

Is it possible to load only the audio from YouTube into my AS3 flash custom player through youtube AS3 api?
I want to load it into a sound object and then assign it to a sound channel.
I would like to know if there is an "official" way to do this, I'd like to avoid improvising (like loading the whole stream and then use only the audio).
Thank you.
I suggest you read the YouTube terms of service carefully:
https://developers.google.com/youtube/terms
In particular, you may not "promote separately the audio or video components of any YouTube audiovisual content made available through the YouTube API".
Doing so in any way (such as moving the video off stage) is likely to have your site blocked for playbacks by YouTube for breach of terms of service.
NB: YouTube manages to provide the service it does through advertising on top of video content. Separating the content like this prevents YouTube from making any money from the service it is providing.
If you use it for private usage, its okay I guess.
After some research work with different APIs and libraries and researching source code, I just tried it by myself and wolla.
Just saying, audio only links are in the page source of each video.
You just have to know what you are looking for ;)
Open a youtube video, view page source and search for "mime%3Daudio". There should be 5 matches, full url for example:
"https%3A%2F%2Fr2---sn-35cxanpbo5a-8pxl.googlevideo.com%2Fvideoplayback%3Fsource%3Dyoutube%26signature%3D30EC556F55533FBFD9003767730D10556681F33A.B12E021CA54CCB9E225F58A4430E9BB528081FB5%26requiressl%3Dyes%26expire%3D1527306011%26clen%3D3064602%26initcwndbps%3D1152500%26ipbits%3D0%26mime%3Daudio%252Fmp4%26dur%3D192.911%26fvip%3D5%26lmt%3D1524946334873350%26key%3Dyt6%26sparams%3Dclen%252Cdur%252Cei%252Cgir%252Cid%252Cinitcwndbps%252Cip%252Cipbits%252Citag%252Ckeepalive%252Clmt%252Cmime%252Cmm%252Cmn%252Cms%252Cmv%252Cpl%252Crequiressl%252Csource%252Cexpire%26itag%3D140%26gir%3Dyes%26ip%3D81.217.53.239%26id%3Do-ALNxMeQYw4LLc1FAjxt4h795wKTdqJnzc_SBgzEJVBxR%26c%3DWEB%26keepalive%3Dyes%26mm%3D31%252C29%26mn%3Dsn-35cxanpbo5a-8pxl%252Csn-2gb7sn7r%26ei%3Du4IIW7DfC46rgAfrrpnICw%26ms%3Dau%252Crdu%26mt%3D1527284230%26pl%3D16%26mv%3Dm"
Just decode URL and you got what you want.

How do I embed wmv/mpg/avi/mov/etc videos reliably?

I am trying to embed video files (wmv, mpg, avi, mov, etc.) dynamically by creating embed elements in javascript. The problem I am running in to is this has not been very reliable across all browsers and even if it does work, there is no guarantee that the end user has the required plugin to play the video. Ideally, I would convert everything to flv or an HTML5 video format but this is not currently possible due to cpu/disk space restrictions (these are videos uploaded by the end user, not me). I feel like this shouldn't be as difficult as it has presented itself to be - does anyone have any suggestions?
To the day VLC release a browser plug-in, the best way is to convert them to .FLV or .MP4 files server side. And use a free Flash video player for the playback (I mean HTML5 with Flash fallback).
If you do not want to convert those videos, let the end user directly download the files. And deal with the problem of multiple video format himself.
edit:
Or you could move your website out of the HTML browser, and build a desktop software, that can take charge of all those videos format, client side.
edit2:
Use Youtube API or any other already existing video hosting services. Personally I will avoid this solution.
The only way to do it reliably is with flash. Use ffmpeg to convert incoming videos to .FLV and use a flash player.