Can I have a video with transparent background using HTML5 video tag?

Yes, this sort of thing is possible without Flash: http://hacks.mozilla.org/2009/06/tristan-washing-machine/ http://jakearchibald.com/scratch/alphavid/ However, only very modern browsers supports HTML5 videos, and this should be your consideration when deploying in HTML 5, and you should provide a fallback (probably Flash or just omit the transparency).

what is the codec for mp4 videos in python OpenCV

You can also use mp4v fourcc = cv2.VideoWriter_fourcc(*’mp4v’) where the videowriter should look like this: out = cv2.VideoWriter(‘output.mp4’,fourcc, 15, size) But there are more codecs available for mp4. You can see the list of them by setting fourcc = -1, it will show a list like this: OpenCV: FFMPEG: format mp4 / MP4 (MPEG-4 Part … Read more

Use ffmpeg to add text subtitles [closed]

NOTE: This solution adds the subtitles to the video as a separate optional (and user-controlled) subtitle track. ffmpeg -i infile.mp4 -i infile.srt -c copy -c:s mov_text outfile.mp4 -vf subtitles=infile.srt will not work with -c copy The order of -c copy -c:s mov_text is important. You are telling FFmpeg: Video: copy, Audio: copy, Subtitle: copy Subtitle: … Read more

plays in other browsers, but not Safari

Safari requires webserver to support “Range” request header in order to play your media content. https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW6 For a legit “Range” request response, your webserve need to return status code “206”.

Reading mp4 files with PHP

You need to implement the skipping functionality yourself in PHP. This is a code snippet that will do that. <?php $path=”file.mp4″; $size=filesize($path); $fm=@fopen($path,’rb’); if(!$fm) { // You can also redirect here header (“HTTP/1.0 404 Not Found”); die(); } $begin=0; $end=$size; if(isset($_SERVER[‘HTTP_RANGE’])) { if(preg_match(‘/bytes=\h*(\d+)-(\d*)[\D.*]?/i’, $_SERVER[‘HTTP_RANGE’], $matches)) { $begin=intval($matches[0]); if(!empty($matches[1])) { $end=intval($matches[1]); } } } if($begin>0||$end<$size) header(‘HTTP/1.0 … Read more

How to output fragmented mp4 with ffmpeg?

This should do the trick: ffmpeg -re -i infile.ext -g 52 \ -c:a aac -b:a 64k -c:v libx264 -b:v 448k \ -f mp4 -movflags frag_keyframe+empty_moov \ output.mp4 frag_keyframe causes fragmented output, empty_moov will cause output to be 100% fragmented; without this the first fragment will be muxed as a short movie (using moov) followed by … Read more