mp4

Use ffmpeg to add text subtitles

帅比萌擦擦* 提交于 2019-11-26 15:01:44
问题 I am trying to add text subtitles to an .mp4 container using ffmpeg: ffmpeg -i input.mp4 -i input.srt -map 0.0 -map 0.1 -map 1.0 output.mp4 When I am trying to run this line, it gives me an error : Nmber of stream maps must match number of output streams. If I try to change the mp4 to mkv (although mp4 supports text subtitles), like this: ffmpeg -i input.mp4 -i input.srt -map 0.0 -map 0.1 -map 1.0 output.mkv It correctly maps the streams, but gives an error : Encoder (codec id 94210) not

How to get video duration from mp4, wmv, flv, mov videos

时光怂恿深爱的人放手 提交于 2019-11-26 12:44:43
问题 Alright. Actually i need mostly the mp4 format. But if it is possible to get for other types as well that would be nice. I just need to read the duration of the file. How can i do that with C# 4.0 ? So the thing i need is like this video is like : 13 minutes 12 seconds I can use 3 third party exes too. Like they save the information about the file to a text file. I can parse that text file. Thank you. 回答1: You can use DirectShow API MediaDet object, through DirectShow.NET wrapper library. See

Adding watermark bitmap over video in android: 4.3's MediaMuxer or ffmpeg

本小妞迷上赌 提交于 2019-11-26 10:50:03
问题 Here is my scenario: Download an avi movie from the web Open a bitmap resource Overlay this bitmap at the bottom of the movie on all frames in the background Save the video on extarnal storage The video length is 15 seconds usually Is this possible to achieve using MediaMuxer ? Any info on the matter is gladly received I\'ve been looking to http://bigflake.com/mediacodec/#DecodeEditEncodeTest (Thanks @fadden) and it says there: \"Decoding the frame and copying it into a ByteBuffer with

What exactly is Fragmented mp4(fMP4)? How is it different from normal mp4?

故事扮演 提交于 2019-11-26 09:15:57
问题 Media Source Extension ( MSE ) needs fragmented mp4 for playback in the browser. 回答1: A fragmented MP4 contains a series of segments which can be requested individually if your server supports byte-range requests. Boxes aka Atoms All MP4 files use an object oriented format that contains boxes aka atoms. You can view a representation of the boxes in your MP4 using an online tool such as MP4 Parser or if you're using Windows, MP4 Explorer. Let's compare a normal MP4 with one that is fragmented:

How to output fragmented mp4 with ffmpeg?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 09:15:21
问题 ffmpeg -i infile.avi out.mp4 outputs non-fragmented MP4. How do I obtain fragmented mp4? Update A fragmented mp4 file is internally divided into several back-to-back chunks or MPEG-4 movie fragments. Each chunk has its own moof atom - so there are several moof atoms interleaved in the file instead of a single moov at the end as in the case of an unfragmented mp4. This makes it easier to stream over slow networks where buffering is involved There are several tools like mp4box that convert a

Another: Force Chrome to fully buffer mp4 video

孤街醉人 提交于 2019-11-26 08:09:37
I've seen a few threads about this, but with no answers, so I thought I'd add another to the grave yard of polluted youtube related pages. I've got a 100MB mp4 video that needs to be fully downloaded by the browser, However theres no event that fires when its been fully downloaded, and Chrome seems to stop buffering any more of the video until the current video time has almost reached the end of the buffer, then it requests more. How can I get the browsers to fully download the video and buffer it 100%? Thanks Offbeatmammal Sadly Chrome - like other HTML5 browsers - tries to be smart about

Using php to output an mp4 video

此生再无相见时 提交于 2019-11-26 07:26:55
问题 Ok basically I have a project that requires that videos are hidden from the users while still able to see them (by using php). here\'s what i got so far: The video.php file has this: <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, \'path/to/movie.mp4\'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); $out = curl_exec($ch); curl_close($ch); header(\'Content-type: video/mp4\'); header(\'Content-type: video/mpeg\'); header(\'Content-disposition: inline\'

适配器模式

浪子不回头ぞ 提交于 2019-11-26 00:45:37
适配器模式 适配器模式(Adapter Pattern)是作为两个不兼容的接口之间的桥梁。将一个类的接口转换成客户希望的另外一个接口。 1、创建媒体播放器和高级媒体播放器接口 1 public interface MediaPlayer { 2 void play(String audioType,String fileName); 3 } MediaPlayer 1 public interface AdvanceMediaplayer { 2 void playVLC(String fileName); 3 void playMP4(String fileName); 4 } AdvanceMediaplayer 2、高级播放器的2个实现类 1 public class MP4Player implements AdvanceMediaplayer { 2 @Override 3 public void playVLC(String fileName) { 4 5 } 6 7 @Override 8 public void playMP4(String fileName) { 9 System.out.println("Playing mp4 file. Name:"+fileName); 10 } 11 } MP4Player 1 public class VLCPlayer

Possible Locations for Sequence/Picture Parameter Set(s) for H.264 Stream

只愿长相守 提交于 2019-11-25 22:59:11
问题 I\'m working on a H.264 Decoder and I\'m wondering where to find the SPS and PPS. My reference literature tells me that those are NAL Units encoded in the H.264-Stream, but when I look into an example-MP4-File with IsoViewer, it says that the SPS and PPS are in the avcC Box. How exactly does this work? How does it look for .mkv files or other H.264 containers? Thanks in advance! 回答1: First off, it's important to understand that there is no single standard H.264 elementary bitstream format.

How to concatenate two MP4 files using FFmpeg?

…衆ロ難τιáo~ 提交于 2019-11-25 22:41:33
问题 I\'m trying to concatenate two mp4 files using ffmpeg. I need this to be an automatic process hence why I chose ffmpeg. I\'m converting the two files into .ts files and then concatenating them and then trying to encode that concated .ts file. The files are h264 and aac encoded and I\'m hoping to keep the quality the same or as close to original as possible. ffmpeg -i part1.mp4 -vcodec copy -vbsf h264_mp4toannexb -acodec copy part1.ts ffmpeg -i part2.mp4 -vcodec copy -vbsf h264_mp4toannexb