mencoder

FFMpeg无损合并视频的多种方法

为君一笑 提交于 2020-04-14 16:16:25
【推荐阅读】微服务还能火多久?>>> 转自:https://www.jianshu.com/p/a9bccc12229b 众所周知,从某些视频网站下载的视频是分段的。比如新浪视频每隔6分钟分段,俗称“ 6分钟诅咒 ”。 现在的任务是将这些视频片段合并起来,并且尽量无损。 方法一:FFmpeg concat 协议 对于 MPEG 格式的视频,可以直接连接: ffmpeg -i "concat:input1.mpg|input2.mpg|input3.mpg" -c copy output .mpg 对于非 MPEG 格式容器,但是是 MPEG 编码器(H.264、DivX、XviD、MPEG4、MPEG2、AAC、MP2、MP3 等),可以包装进 TS 格式的容器再合并。在新浪视频,有很多视频使用 H.264 编码器,可以采用这个方法 ffmpeg -i input1 .flv -c copy -bsf :v h264_mp4toannexb -f mpegts input1 .ts ffmpeg -i input2 .flv -c copy -bsf :v h264_mp4toannexb -f mpegts input2 .ts ffmpeg -i input3 .flv -c copy -bsf :v h264_mp4toannexb -f mpegts input3 .ts

How to split flv file by size using FFmpeg or mencoder or smth else?

爱⌒轻易说出口 提交于 2020-01-11 11:53:08
问题 I need to split an flv file into chunks of the known size on linux server. For example my original file is 9Mb and the chunk size is 4Mb. So I should get 3 parts - 4Mb, 4Mb and 1 Mb. Seems that FFmpeg can split only by time. Mencoder can start by time (-ss TIME) and finish by size ( -endpos SIZE MB). But if start second of the first chunk is obviously 0, then how can I get start second for next chunks? Do you have any suggestions? Thanks in advance. 回答1: calculate ~time (sec) of every block &

Where is the documentation for the Mjpeg codec used in mencoder, VLC and FFMpeg?

白昼怎懂夜的黑 提交于 2020-01-06 10:20:23
问题 Mencoder has a lovely option for converting a mjpeg file into an avi file with an 'MJPG' codec that plays in VLC. The command line to do this is: mencoder filename.mjpeg -oac copy -ovc copy -o outputfile.avi -speed 0.3 where 0.3 is the ratio of the desired play framerate to the default 25 fps. All this does is make a copy of the mjpeg file, put an avi header on top and at the end, what seems to be an index of the frame positions in the file. I want to replicate this in my own code, but I can

Where is the documentation for the Mjpeg codec used in mencoder, VLC and FFMpeg?

自作多情 提交于 2020-01-06 10:20:21
问题 Mencoder has a lovely option for converting a mjpeg file into an avi file with an 'MJPG' codec that plays in VLC. The command line to do this is: mencoder filename.mjpeg -oac copy -ovc copy -o outputfile.avi -speed 0.3 where 0.3 is the ratio of the desired play framerate to the default 25 fps. All this does is make a copy of the mjpeg file, put an avi header on top and at the end, what seems to be an index of the frame positions in the file. I want to replicate this in my own code, but I can

Java+Windows+ffmpeg实现视频转换

纵饮孤独 提交于 2020-01-04 21:49:17
最近由于项目需要,研究了一下如何用Java实现视频转换,“着实”废了点心思,整理整理,写出给自己备忘下。 思路 由于之前没有没法过相关功能的经验,一开始来真不知道从哪里入手。当然,这个解决,google一下立马就发现了ffmpeg,网上讲解用Java+ffmpeg来进行视频转换的文章也不在少数,我主要参考的 这篇文章 。 上文提到的这篇文章,基本已经把开发流程什么的讲的很清楚了,这里总结下: 1)核心是利用ffmpeg进行视频转换,我们自己并不写转换视频的代码,只是调用ffmpeg,它会帮我们完成视频的转换。ffmpeg支持的类型有:asx,asf,mpg,wmv,3gp,mp4,mov,avi,flv等,这些类型,可以利用ffmpeg进行直接转换。ffmpeg不支持的类型有:wmv9,rm,rmvb等,这些类型需要先用别的工具(mencoder)转换为avi(ffmpeg能解析的)格式。 2)了解Java如何调用外部程序,这会是最困难的,也会是坑最多的地方。 3)根据我们的需求设置ffmpeg的参数。(这类文章网上已经有很多了,我也不用复制黏贴了,见 这里 ) 代码 上文中提到的那篇文章中的代码其实已经写的很友好了,基本拿来就能用,不过仍然存在许多问题,接下来会讲到,下面是文中的代码: 1 import java.io.File; 2 import java.util

Re-sampling H264 video to reduce frame rate while maintaining high image quality

情到浓时终转凉″ 提交于 2019-12-31 08:28:21
问题 Here's the mplayer output for a video of interest: br@carina:/tmp$ mplayer foo.mov mplayer: Symbol `ff_codec_bmp_tags' has different size in shared object, consider re-linking MPlayer 1.0rc4-4.5.2 (C) 2000-2010 MPlayer Team mplayer: could not connect to socket mplayer: No such file or directory Failed to open LIRC support. You will not be able to use your remote control. Playing foo.mov. libavformat file format detected. [lavf] stream 0: video (h264), -vid 0 [lavf] stream 1: audio (aac), -aid

Black overlay appears when merging a transparent video to another video

拟墨画扇 提交于 2019-12-22 17:39:25
问题 This is what I have done so far: Command to create a transparent PNG image: convert -size 640x480 -background transparent -fill blue \ -gravity South label:ROCK image1-0.png Command to create a transparent video: ffmpeg -loop 1 -f image2 -i image1-0.png -r 20 -vframes 100 \ -vcodec png -pix_fmt bgra mov-1.mov (as per this post) - I expect this video to be a transparent video . Command to overlay a video with another: ffmpeg -i final-video.mov -sameq -ar 44100 \ -vf "movie=mov-1.mov [logo];[in

ffmpeg vs mencoder

跟風遠走 提交于 2019-12-20 08:48:35
问题 I'm doing a bunch of video encoding for a variety of devices and platforms. I've bounced back and forth a few times between mencoder and ffmpeg. Which do you recommend and why? Side question: From googling it seems that mencoder uses ffmpeg. Does it do this all the time or only when it deems necessary? 回答1: You are right, mencoder uses ffmpeg. Mencoder is actually a universal interface to a number of different codecs or codec libraries like ffmpeg. So, beyond ffmpeg, mencoder can be compiled

Dump last frame of video file using ffmpeg/mencoder/transcode et. al

筅森魡賤 提交于 2019-12-18 14:18:15
问题 I'd like to grab the last frame in a video ( .mpg , .avi , whatever) and dump it into an image file ( .jpg , .png , whatever). Toolchain is a modern Linux command-line , so things like mencoder , transcode , ffmpeg &c. Cheers, Bob. 回答1: This isn't a complete solution, but it'll point you along the right path. Use ffprobe -show_streams IN.AVI to get the number of frames in the video input. Then ffmpeg -i IN.AVI -vf "select='eq(n,LAST_FRAME_INDEX)'" -vframes 1 LAST_FRAME.PNG where LAST_FRAME

How to route the exe exception back to VB6 app?

久未见 提交于 2019-12-12 19:12:53
问题 i have a vb6 apps which will call the mencoder.exe which is part of the mplayer to convert some files into flv format. i'm getting this weird unhandled exception problem from mencoder whenever i try to convert this one opendivx file. At the moment, i'm unclear of whether is this codec is the culprit behind this. Either way i have try to modify the command line and even downloaded the latest available version for mencoder. so the conversion works fine and the only problem is that the mencoder