mp4

适配器模式

♀尐吖头ヾ 提交于 2019-12-03 13:25:01
适配器模式(Adapter Pattern)是作为两个不兼容的接口之间的桥梁。这种类型的设计模式属于结构型模式,它结合了两个独立接口的功能。 这种模式涉及到一个单一的类,该类负责加入独立的或不兼容的接口功能。举个真实的例子,读卡器是作为内存卡和笔记本之间的适配器。您将内存卡插入读卡器,再将读卡器插入笔记本,这样就可以通过笔记本来读取内存卡。 我们通过下面的实例来演示适配器模式的使用。其中,音频播放器设备只能播放 mp3 文件,通过使用一个更高级的音频播放器来播放 vlc 和 mp4 文件。 介绍 意图: 将一个类的接口转换成客户希望的另外一个接口。适配器模式使得原本由于接口不兼容而不能一起工作的那些类可以一起工作。 主要解决: 主要解决在软件系统中,常常要将一些"现存的对象"放到新的环境中,而新环境要求的接口是现对象不能满足的。 何时使用: 1、系统需要使用现有的类,而此类的接口不符合系统的需要。 2、想要建立一个可以重复使用的类,用于与一些彼此之间没有太大关联的一些类,包括一些可能在将来引进的类一起工作,这些源类不一定有一致的接口。 3、通过接口转换,将一个类插入另一个类系中。(比如老虎和飞禽,现在多了一个飞虎,在不增加实体的需求下,增加一个适配器,在里面包容一个虎对象,实现飞的接口。) 如何解决: 继承或依赖(推荐)。 关键代码: 适配器继承或依赖已有的对象,实现想要的目标接口

FFmpeg: Read profile level information from mp4

佐手、 提交于 2019-12-03 13:09:51
I have a mp4 file and need the profile level of it. FFmpeg says, it has baseline profile, which is what I need, but I need also the level . Here is what I get from FFmpeg: ffmpeg version 0.8, Copyright (c) 2000-2011 the FFmpeg developers built on Jul 20 2011 13:32:19 with gcc 4.4.3 configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 libavutil 51. 9. 1 / 51. 9. 1 libavcodec 53. 7. 0 / 53. 7. 0 libavformat 53. 4. 0 / 53. 4. 0 libavdevice 53. 1

Stream video with rtmp and videojs

旧城冷巷雨未停 提交于 2019-12-03 13:05:47
问题 I looking for a way to stream play videos with rtmp. I use video-js but it doesn't work. Firebug return an error : L'attribut « type » spécifié sur « video/flash » n'est pas géré. Le chargement de la ressource média rtmp://server.com/vod/mp4:foo/bar/my_video.mp4 a échoué. VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) No compatible source was found for this video. MediaError { code=4, message="No compatible source was found for this video." HTML code : <!doctype html> <html lang="fr"

MP4 container writer in Java

梦想与她 提交于 2019-12-03 12:49:46
问题 I would like to find a FREE MP4 (container) writer for Java. I do not need an encoder, only something which can write the correct atoms given their expected values. Bonus for such a library that also can write "valid" F4V. I would prefer a pure Java solution rather than something using JNI or external executables. 回答1: Even though my answer comes very late you could have a look into my MP4 Parser/Unparser at Github. You can parse MP4 files, modify them and write the result. You can even start

GoLang http webserver provide video (mp4)

半城伤御伤魂 提交于 2019-12-03 12:32:45
问题 I developed a webserver using golang. Pretty plane stuff, it just provides html/js/css and images which works perfectly fine: func main() { http.Handle("/", new(viewHandler)) http.ListenAndServe(":8080", nil) } func (vh *viewHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { path := r.URL.Path[1:] log.Println(path) data, err := ioutil.ReadFile(string(path)) if err == nil { var contentType string if strings.HasSuffix(path, ".html") { contentType = "text/html" } else if strings

How to export video as .mp4 using openCV?

匿名 (未验证) 提交于 2019-12-03 10:10:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to export video as .mp4 with openCV. I have tried several codecs but for now I had no success. This is a function that constructs a video from frames: def create_movie(self, out_directory, fps, total_frames): img1 = cv2.imread("temp/scr0.png") height, width, layers = img1.shape codec = cv2.cv.CV_FOURCC('X','V','I','D') video = cv2.VideoWriter(out_directory, codec, fps, (width, height)) for i in range(total_frames): img_name = "temp/scr" + str(i) + ".png" img = cv2.imread(img_name) video.write(img) video.release() cv2

FFMPEG resize video not working in browser or IOS

匿名 (未验证) 提交于 2019-12-03 08:59:04
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have tried to compress video using FFMPEG command and it's compress properly but I couldn't see in browser as like original video. I have used below all command but didn't success. ffmpeg -i /var/www/html/test.mp4 -c:v copy -bsf:v h264_mp4toannexb -an /var/www/html/test123.mp4 ffmpeg -i /var/www/html/test.mp4 -s 640x480 -c:v copy -bsf:v h264_mp4toannexb -an /var/www/html/test123.mp4 ffmpeg -i /var/www/html/test.mp4 -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis /var/www/html/test111.mp4 ffmpeg -i /var/www/html/test.mp4 -s 720x960 -b:v

C++ FFmpeg distorted sound when converting audio

廉价感情. 提交于 2019-12-03 08:45:38
I'm using the FFmpeg library to generate MP4 files containing audio from various files, such as MP3, WAV, OGG, but I'm having some troubles (I'm also putting video in there, but for simplicity's sake I'm omitting that for this question, since I've got that working). My current code opens an audio file, decodes the content and converts it into the MP4 container and finally writes it into the destination file as interleaved frames. It works perfectly for most MP3 files, but when inputting WAV or OGG, the audio in the resulting MP4 is slightly distorted and often plays at the wrong speed (up to

Combining an audio and video stream using gstreamer [closed]

匿名 (未验证) 提交于 2019-12-03 08:42:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am streaming an mp4(mpeg-4) file from one device to another using gstreamer over RTP stream. Basically I am splitting up the mp4 file into its audio and video file and then sending it all to the other device where it gets streamed. Now, I want to save the mp4 file to disk in the other device, but my problem is that I am able to save the audio and video files seperately and it cannot be played individually. I am confused on how to combine both the audio and video rtp streams to form my mp4 file back and save it to a file in the other device

HTML5 video: ffmpeg-encoded MP4 not playing in any browser (plays in VLC though)

删除回忆录丶 提交于 2019-12-03 08:32:17
I am trying to serve HTML5 video in MP4 and WEBM fomats. I cannot get all browsers to work though: Browsers which support WEBM (Chrome desktop, Firefox desktop) play the videos fine. Browsers which use MP4 are not working (IE, Safari, Android). WEBM is being served as video/webm . MP4 is being served as video/mp4 . Minimal JSFiddle at: http://jsfiddle.net/#&togetherjs=5Ql5MmrV4j Browser errors: IE11: 11.0.9600.17126 / 11.0.9 KB2957689 Error: Unsupported video type of invalid file path Android browser and Chrome Android: No error, video just refuses to start Sanity test - the following three