Live streaming through MP4

You may use fragmented MP4. A fragmented MP4 file is built a follows: moov [moof mdat]+ The moov box then only contains basic information about the tracks (how many, their type , codec initialization and so on) but no information about the samples in the track. The information about sample locations and sample sizes is … Read more

Cannot open “.mp4” video files using OpenCV 2.4.3, Python 2.7 in Windows 7 machine

I have had the same issue before, solved by this step: Check your OpenCV python version >>> from cv2 import __version__ >>> __version__ ‘2.4.0’ Then Copy your opencv_ffmpeg.dll to C:\Python27\ and rename it to relevant your OpenCV Python Version. In my case I had to rename it to opencv_ffmpeg240.dll. Update: On Windows, you can find … Read more

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

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

How to play .mp4 video in videoview in android?

Finally it works for me. private VideoView videoView; videoView = (VideoView) findViewById(R.id.videoView); Uri video = Uri.parse(“http://www.servername.com/projects/projectname/videos/1361439400.mp4”); videoView.setVideoURI(video); videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) { mp.setLooping(true); videoView.start(); } });