LosslessCut 无损剪切教程:从片段设置到切点偏移排查

本文基于LosslessCut v3.70.1详解无损视频剪切全流程,涵盖片段创建(I/O快捷键)、导出模式(Separate/Merge)、切点偏移排查(关键帧对齐)、轨道与容器兼容性分析、预览黑屏与导出失败的区分处理。强调FFmpeg封装原理、时间轴非线性编辑局限性及跨平台依赖配置,适用于录屏粗剪、轨道精简等免重编码场景。

LosslessCut 无损剪切教程:从片段设置到切点偏移排查

用 LosslessCut 截取视频,窗口里设置了开始时间,输出却多出一点片头,这是普通无损剪切可能遇到的情况。要定位原因,需要先区分三件事:片段范围是否选对、输出模式是否符合预期、编码结构是否允许从目标位置直接开始。

本文按 v3.70.1 的官方资料说明基本流程和排查顺序。LosslessCut 是 FFmpeg 的跨平台图形界面,适合免重编码地提取音视频片段、处理轨道和改封装。它的时间轴不是用于任意多文件叠放的非线性编辑时间线,复杂剪辑应拆成不同操作或使用相应编辑器。

准备发行包,先确认架构和依赖

Windows 提供 x64、ARM64 的 7z 包,应按系统架构选择并完整解压,保留程序旁边的文件。v3.70.1 发行说明专门修复了 Windows x64 构建缺少 FFmpeg 的问题,因此遇到相关问题时,应先确认实际使用的版本,而不是在不同目录之间混搭文件。

macOS 分 Intel 与 Apple Silicon 的 DMG。Linux x64 有 tar.bz2 和 AppImage,ARM64、armv7l 有 tar.bz2,Linux 两种 ARM 构建不包含 FFmpeg,需要准备相应依赖。官方明确说明 APPX 与 PKG 不可用,文件名里带 DONT-USE-THIS-FILE 的包不要作为常规安装选择。

当前版本也不适合旧 Windows 7/8/8.1,macOS 11 的支持则已在 v3.66 移除。遇到启动问题时先区分系统条件和素材条件:程序尚未正常打开,与某个视频不能预览,是不同层次的问题。7z 解压使用也不等于应用配置、项目与临时数据全部不落盘。

按默认保留规则创建片段

拖入文件或用 Ctrl/Cmd+O 打开,空格播放与暂停。把时间轴光标移动到目标起点,按 I;移动到终点,按 O。该片段就表示一段准备导出的时间区间,检查时要同时看起止值和当前选中的片段。

LosslessCut 的片段列表与时间轴

主窗口右边列出片段,下方显示时间轴。这里先用来辨认区域,具体快捷键和设置仍应结合当前窗口检查。时间轴可缩放,移动到更接近目标的位置后,再设置入点和出点。

按加号创建下一段,再重复 I、O;B 在当前光标位置分割片段,Backspace 删除片段或切点。只有开始位置、没有结束位置的条目是标记,不是有长度的片段,也不会像完整片段那样导出。只做了定位标记却没得到片段文件时,应先检查有没有设置终点。

默认逻辑是保留创建的片段。例如要去掉中间的等待,直接把前后的有效内容标成两段即可。高级视图里的阴阳图标可以反转片段含义,改为跳过选定范围。导出内容与预期相反时,先检查这一项,别急着调整编码或更换容器。

把“导出几份”与“按什么顺序”一起确认

Separate files 把选定片段分别保存,Merge cuts 将剪下的片段合并。右侧列表可以拖动重排,合并后的内容会按相应顺序出现。要保留原录像时间顺序,或要把演示步骤重新组织成一份文件,应在确认范围后分别核对。

按 Export 或 E 打开导出概览,查看输出目录、容器、片段和轨道,再确认 Export。高级视图还可以用导出按钮旁的图标控制是否每次显示导出选项,所以不同设置下看到的确认流程可能不完全相同。

软件默认创建新文件,不原位覆盖输入。需要输出与原片同名的文件时,选择另一个输出目录。建议将排查用的单片段输出放在独立目录,保留原文件,避免把后一次结果错当作前一次结果比较。

片段规划可以保存为 .llc 项目,它记录时间范围等信息,不包含原视频本体。CSV 则可交换片段列表,每行包含起点秒数、终点秒数和标签。需要继续编辑时保留项目和素材;需要给别人直接播放时,应交付导出的媒体文件,二者用途不同。

起点偏移:先导出,再检查实际边界

普通无损剪切通常从前一个关键帧附近开始。时间框允许输入某个精确时间,并不意味着原编码能从那个位置独立播放。不同素材的关键帧间隔和时间戳结构不同,偏移量不能用一个固定数值概括。

先只启用一个片段导出,再在播放器中检查实际开头、结尾与音画同步。内置预览中光标所在的画面,不能替代输出文件的切点验证。只验证一段,也能减少批量导出后才发现边界不合适的返工。

如果开头多带入内容,比较关键帧剪切模式开关,并尝试把入点移到相邻的几帧。官方文档说明,部分文件即使把起点放在关键帧上,也可能回退到更前一个关键帧;稍微移动起点有时能改变结果。应根据实际输出判断,不能把同一偏移量直接套给所有视频。

Smart cut 是实验功能,可以尝试关键帧之间的切点,但许多文件并不适用。普通剪切或拼接已经异常时,先关闭它,建立可解释的常规输出,再决定是否尝试实验模式。要求严格帧准确的交付,也不应只凭一次时间码设置就认定合格。

导出时长奇怪,检查轨道和容器

有的文件包含无法按预期裁切的轨道,可能出现成品长度仍像原片、局部黑段等现象。可以进入 Tracks 面板,先仅保留主要视频轨道,导出一个短片段;若正常,再逐条恢复声音、字幕或其他轨道,观察问题从哪一步出现。

这个过程是在缩小范围,不是建议最终作品一律去掉声音。片段控制时间,轨道控制同时存在的媒体流,排查时临时关闭某条轨道,最终导出前仍需恢复读者需要的内容并重新检查。

容器也可能影响兼容性。更换 MP4、MOV 或 Matroska 等输出格式,属于重新封装已有媒体流,不会自动把内部编码变成另一种编码。选择时要同时考虑容器能否容纳轨道、接收端播放器能否解码;只把文件名后缀改掉,不能完成这种转换。

合并不同文件时,要求编码参数一致。同为 MP4 并不足够,因为 MP4 只是容器名称。建议先确认单个文件独立导出是否正常,再比较待合并文件的参数和轨道,避免同时改变片段、轨道、容器后反而无法辨认原因。

预览黑屏,与导出失败分开处理

LosslessCut 的内置播放器依赖 Chromium,某些编码不能直接预览,但 FFmpeg 仍可能处理原媒体。可以从 File → Convert to supported format 尝试兼容预览,优先选择 FFmpeg 辅助播放方式。创建的低质量预览用于播放定位,实际剪切仍从原文件进行。

因此,预览模糊不能直接说明导出发生了画质损失;反过来,预览正常也不能保证输出切点和轨道都正确。排查时分别记录“能否打开”“能否定位”“能否导出”“输出是否符合预期”,每次只改变一个相关条件。

对于录屏摘录、素材粗剪和移除多余轨道,这条工作流已经能覆盖很多需求。先用一段素材建立正常输出,再增加复杂度;若任务转向叠字、混音、转场或严格逐帧编辑,就切换到对应的编辑方式。

下载与获取

  • 百度网盘:https://pan.baidu.com/s/1zbyyUnTfYbGozQgr3qOGng?pwd=legl 提取码:legl
  • 夸克网盘:https://pan.quark.cn/s/0152049f7cc1
深度学习工具包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")
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值