使用mencoder进行视频分割

Mencoder实现视频剪切合并添加字幕 Mencoder实现视频剪切合并添加字幕.请注意字幕文件最好和视频文件同名. 立即下载

mencoder input_file -o output_file -ss 30 -endpos 60 -oac copy -ovc copy

以上命令可以截取视频文件从30秒开始持续1分钟的内容保存到output_file。如果仔细看输出的视频,会发现视频确实恰好有一分钟,但开始时间并不是准确的原视频的第30秒。在mplayer的文档中,关于这点写到mencoder定位在离-ss指定时间最近I帧。一般对于截取视频来说这样问题不大,但如果要对分割的连接视频再合并,就会出现问题。比如,再分割

mencoder input_file -o output_file2 -ss 0 -endpos 30 -oac copy -ovc copy,

一般对output_file和output_file2再合并,视频会缺帧或重帧。为了合并得到连续的视频,可以对mencoder.c做以下修改并重新编译(修改后合并视频会出错,得用原来的可执行文件),基本原理是让视频在ss+endpos最近的I帧结束:

1. 定义变量(以下改动都是在main中)

 

2. 把if(seek_to_sec)处改为

3. 把 play_n_frames=play_n_frames_mf;改为play_n_frames=next_frame_no-sh_video->num_frames;

4. 注释掉if ((end_at.type == END_AT_SIZE && end_at.ps <= stream_tell(muxer->stream)) || (end_at.type == END_AT_TIME && end_at.pos < v_muxer_time)) 这个条件语句(连同下面的break)。

 

注:本文使用源码为2010-11-19

基于mencoder实现的视频截取合并demo 可以实现avi视频的截取合并 添加字幕,基于窗口实现 立即下载

相关推荐

mencoder实现视频合并、剪切、添加字幕的VisualC++代码

mencoder 视频合并、视频剪切 视频添加字幕 VisualC++

使用mencoder剪辑视频

mencoder可以做视频剪辑和视频格式转换。它既能在Windows操作系统上使用,又能在Linux操作系统上使用。它只能通过命令行的形式使用。例一:mencoder basket.rm -ovc lavc -oac lavc -o basket.avi把basket.rm文件转换为basket.avi文件,其中,视频转换为mp4格式,音频转换为mp2格式。"-o bask

在水一方 990

ffmpeg+mencoder

内有ffmpeg和mencoder,用来进行视频转码的工具,java使用的时候直接调用里面的就可以。

利用mencoder进行视频分割和合并

<br />      在ubuntu下,可以十分简单的安装好mplayer和mencoder,没有安装的时候,按照提示可以输入万能的sudo apt -get ***,就解决问题了。所以用起来很顺手啊~~<br />      我利用mencoder主要干的两个事情就是视频的分割和合并。如果要对视频进行分割,最好提前知道它的总时间长度,而mplayer提供了这个命令。<br />      获得视屏文件相关信息的命令为: mplayer -identify fileName -nosound -vc du

moodytong的专栏 7397

高分思路!挑战7天完成一篇网状meta DAY1-7

PASSION!继续析挑战,7天完成一篇网状meta分!

MR_SCI_help的博客 787

【Macbook-Latex安装部署教程】【Win-Texlive镜像下载】【简单易上手】MacTex+Vscode/Texstudio

该教程记录自己在mac()上安装部署Latex环境的经验,整个教程操作简单,配置要求少,易上手。教程分成三部分:Mactex下载与安装,Vscode插件下载与配置文件修改,Texstudio安装。

sunriseOvO的博客 2570

mencoder和ffmpeg分割合并视频(1)--基础命令

1. mencoder        (1)mencoder分割视频命令            miko@bogon:~/Videos> mencoder -ss 1:00 -endpos 3:00 -oac pcm -ovc copy orgin.mp4 -o 1.mp4            选项说明:

just_easy的专栏 6389

AI人工智能全模态大模型架构:推动智能交通发展的架构设计

本文旨在阐述全模态大模型在智能交通领域的架构设计原理和应用方法。我们将探讨如何利用多模态AI技术解决交通流量预测、事故预警、路线优化等关键问题。文章将从基础概念入手,逐步深入技术细节,最后探讨实际应用和未来发展方向。全模态大模型:能够处理和理解多种数据模态(如图像、文本、语音等)的大型AI模型智能交通系统(ITS):利用先进技术优化交通流量和安全性的综合系统多模态融合:将不同数据源的信息整合处理的技术核心概念回顾全模态大模型是能够处理多种数据类型的强大AI系统。

AGI×大数据,开启智能时代的认知跃迁;解码AGI,赋能数据驱动的智能革命。 835

mencoder和ffmpeg分割合并视频

1. mencoder        (1)mencoder分割视频命令            view plainprint? miko@bogon:~/Videos> mencoder -ss 1:00  -endpos 3:00 -oac pcm -ovc copy orgin.mp4 -o 1.mp4               选项

星精灵的新世纪 2578

RK3588高速接口实战-PCIE

摘要: RK3588的PCIe接口支持PCIe 3.0x4和PCIe 2.1x1/x2,具备Root Complex和Endpoint模式,适用于NVMe SSD、5G模块等高速设备。硬件设计需注意85Ω/100Ω阻抗匹配、220nF AC耦合电容及100MHz参考时钟。设备树需配置控制器节点、PHY模式和IOMMU映射(RC模式用iommu-map,EP模式用iommus)。调试时可通过lspci检查链路状态,dmesg查看训练日志,perf分析性能。常见问题包括设备识别失败(检查复位时序、PHY配置)、

weiyvyy的博客 505

(12)单相降压自耦变压器的等效电路和仿真模型

本文根据电机学基本原理,从单相双绕组变压器的接线方式出发,建立基本方程并导出T型等效电路。然后将双绕组变压器演变成一种降压自耦变压器,详细地建立起单相降压自耦变压器的数学模型以及导出相对应的等效电路,最后用Matlab/simulink的simscape元件库元件建立了基于单相自耦变压器的T型等效电路的仿真模型。用实例仿真验证了本文工作的正确性。

weixin_45670943的博客 1046

mencoder使用

mencoder是mplayer附带的一个工具,可以进行视频转码、分割、合并。 分割:    mencoder -ss 开始时间 -oac copy -ovc copy -endpos 终止时间 文件名 -o 目标文件名合并:    mencoder -ovc copy -oac copy 文件名1 文件名2 -o 目标文件名 参数说明:    -ovc: outp

duanbeibei的专栏 1070

自然语言处理NLP星空智能对话机器人系列:Gavin大咖 Transformer 101问答集 第一问

自然语言处理NLP星空智能对话机器人系列:Transformer 101问答 [让天下没有难学的Transformer] 你问我答系列之一 Gavin大咖第一问: Transformer中的可训练Queries、Keys和Values矩阵从哪儿来? 以上是智华解答,供同学们参考。 星空智能对话机器人系列博客 NLP星空智能对话机器人系列:第二次星空智能对话机器人Zoom线上演示安排 NLP星空智能对话机器人系列:StarSpace: Embed All The Things NLP星空智能对

大模型与Agent智能体 991

视频操作类

接 视频分割项目预研 [url]http://zhuyufufu.iteye.com/blog/2078404[/url] 对于没法用ffmpeg处理的rm等格式,使用了[b]mplayer[/b]的[b]mencoder[/b]来处理。 我的项目重点在视频分割。在此只写rmvb切分的代码。对于别的[b]ffmpeg[/b]无法处理的格式,[b]mencoder[/b...

zhuyufufu的专栏 217

OpenClaw 子代理配对失败问题分析与解决方案

OpenClaw子代理配对失败问题分析与解决方案 问题核心在于agent设备权限不足,仅有operator.approvals权限而缺少operator.admin权限,导致子代理启动时形成权限死锁。本文提供三种解决方案: 直接编辑设备配对文件(推荐):修改本地JSON文件,为agent设备添加完整operator.admin权限,操作简单快捷。 标准重新配对流程:删除现有agent设备后重新配对,通过正常审批流程获取完整权限,符合系统安全设计。 修改源码降低权限要求(仅限开发环境):调整子代理代码避免强制

多媒体编程、网络编程、系统编程、网络安全编程、驱动编程 150

T507 buildroot linux4.9之RLT8211F 1000M以太网开发调试

调试T507的gmac,解决该RTL8211F 1000m以太网中调试遇到的问题

目前从事linux驱动开发,多交流多学习吧 689

Linux下视频转换工具

首先当然是需要安装ffmpeg软件包,可以直接从源中进行安装!但我安装后并不能成功执行后面所需要执行的转换命令,所以我只能重新从源码编译安装ffmpeg: (1)下载ffmpeg源码包,注意版本不能太高,应该与直接从源中安装的版本大抵相当最好;我刚开始下的版本比较高,编译时提示说有一个编译选项找不到,我到网上也没搜出什么结果,所以只能又降低了版本,最后使用的是ffmpeg-0.4.9-p20

482

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

ffmpeg特殊命令

分割命令: ffmpeg -ss 01:00:00 -i 12.mp4  -vcodec copy -acodec copy -t 00:06:00 fenge.mp4 --  只适合于Mp4 合并命令: mencoder 1.mp4 ... 2.mp4 -oac pcm -ovc copy  -o ok.mp4  合并多个: mencoder file1Name fil

知识的力量 808

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

2019ROM

hello

nicoyuan的专栏 219

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

linux mencoder,linux下mencoder的一些用法

引用://To DIVXmencoder -oac mp3lame -lameopts aq=7:cbr:br=128 -srate 44100 -vf scale=width:height,harddup -ovc lavc -ffourcc DX50 -lavcopts vcodec=mpeg4:vbitrate=320 InputFile -o OutputFile//To DIVX(2ps...

weixin_35851482的博客 517

mencoder

分割: mencoder -ss 开始时间 -oac copy -ovc copy -endpos 终止时间 文件名 -o 目标文件名 合并: mencoder -ovc copy -oac copy 文件名1 文件名2 -o 目标文件名 mencoder可以做视频剪辑和视频格式转换。它既能在Windows操作系统上使用,又 能在Linux操作系统上使用。它只能通过命令行的形式使用。 例一: mencoder basket.rm -ovc lavc -oac lavc -o basket.

bbplayers的专栏 2783

视频转换工具-mencoder命令行参数

因为刚好有些视频要转,google了一下,网上有很多Ubuntu视频转换工具mencoder的介绍,使用以后,觉得有必要汇总一下,留以他用。 feedom.net     CODE: mencoder [options] file1 [specific options] [file2] [specific options] mencoder src.avi -o dst.avi -vf sc

零下二度 2547

从MPG切割,合并到转换成FLV视频过程中可能遇到的一些问题(主要用到mencoder ffmpeg flvtool2)...

目标:将MPG或AVI等其他格式的视频源进行切割或合并 最终转换成FLV视频文件 并能够在FLVPlayer中播放 可以随意拖放 前进n秒 后退n秒 具体步骤 目前有两个非常出名的视频处理工具 都是在命令行下使用 可以做成批处理命令 相当方便 1. mencoder 著名的视频处理工具 2. f...

iteye_10679的博客 276

【转】视频分割

ffmpeg可以说是一个比较全能的编码器,在ffmpeg命令详解中我列出了所有ffmpeg的命令,但我在分割视频的时候视频被他重新编码了,明明是copy却变成了encode。 我使用的命令是这样的: 1 ffmpeg -vcodec copy -acodec copy -ss 01:00:00 -t 00:00:30 -i input_file

一些有的没的 941

DirectShow捕获+mencoder+ffmpeg+sox

DirectShow捕获+mencoder+ffmpeg+sox 打造小巧的音视频制作、加工软件 DirectShow捕获+mencoder+ffmpeg+sox  打造小巧的音视频制作、加工软件   捕获音视频并进行加工处理,是常见的应用。录制一段小视频,加上广告,贴上字幕,再搞点音乐什么的,可以上传到视频网站上去,不管是做营销宣传,还是纯粹的娱乐目的,都很常见。当然,你可

星精灵的新世纪 884
上一篇: linux防火墙与路由设置
下一篇: 计算二进制位中1的个数
Welson80
博客等级 码龄19年 14粉丝 13原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值