Showing posts with label Video. Show all posts
Showing posts with label Video. Show all posts

Tuesday, August 18, 2026

Video: Air Parcel Trajectory

Two-week HYSPLIT simulations of air parcel trajectories originating in Manitoba and transported across the globe, using ERA5 reanalysis data as meteorological input.

Video: Dust Storm

NOAA GOES-19 imagery showing a dust storm affecting the entire Winnipeg area on the afternoon of May 14, 2026.

Reference:

https://classic107.com/articles/rare-dust-storm-warning-issued-across-southern-manitoba

Sunday, July 30, 2023

Video: Video processing toolkit

This toolkit includes functions for video merging, editing, and compression.File
[20231202 Updated]Add new feature to merge two videos either horizontally or vertically. File
[20240109 Updated]Trim multiple audio and video files in sequence. File
[20250810 Update]Merge audio and video files. file. and Extract the frames from the input videos.
[20250811 Updated]Conversion from m4a to mp3. file.

Saturday, March 17, 2018

Video: Convert Gifs to Video

工具箱ffmpeg可以将Gif动图文件转换成Video文件,Video文件格式包含.mp4、mpeg等。

References

Tuesday, April 11, 2017

FFmpeg: Clip Audio Files

Introduction

剪辑音频文件,提取出文件特定时间的音频资料,并且周而复始。
文献[1]示例代码:
1
ffmpeg -ss 0 -t 30 -i file.mp3 file.wav
代码
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
% Created by LI Xu
% Version 1.0
% April 11, 2017

% Description:
% 

% If you have any question about this code,
% please do not hesitate to contact me via E-mail: 
% jeremy456@163.com

% Blog:
% http://blog.sciencenet.cn/u/lixujeremy
% http://lixuworld.blogspot.com/

% Reference
% http://stackoverflow.com/questions/7945747/how-can-you-only-extract-30-seconds-of-audio-using-ffmpeg

clear;
clc;

timebegin=tic;
cur_data=date;
cur_time=fix(clock);
str1=sprintf('%s %.2d:%.2d:%.2d', cur_data, cur_time(4), cur_time(5), cur_time(6)); 
fprintf('Time Begin: ');
fprintf(str1);
fprintf('\n');

% XLS
xlspath='AudioInfo.xlsx';
[~, conaud]=xlsread(xlspath);
conaud(1, :)=[];

% Source Directory
SouDir='input';
% Destination Directory
DesDir='output';

% Loop
for ii=1:size(conaud, 1)
    rowrd=conaud(ii, :);
    filepath=GetFilePath(SouDir, rowrd{1});
    if filepath==0
        continue;
    end
    [~, filename, ext]=fileparts(filepath);
    inpath=fullfile(SouDir, [filename, ext]);
    otpath=fullfile(DesDir, [filename, ext]);
    if exist(otpath, 'file')
        delete(otpath);
    end
    % Start
    sttm=rowrd{2};
    % Finish
    fitm=rowrd{3};
    % Construct Sentence
    Constr=['ffmpeg -ss ', sttm, ' -t ', fitm, ' -i ', inpath, ' ', otpath];
    disp(['...Start to process ', filename, ext, '...']);
    [stuat, cmdout]=system(Constr);
    disp(['...Finish ', filename, ext, '...']);

end

fprintf('Time Begin: ');
fprintf(str1);
fprintf('\n');

cur_data=date;
cur_time=fix(clock);
str2=sprintf('%s %.2d:%.2d:%.2d', cur_data, cur_time(4), cur_time(5), cur_time(6)); 
fprintf('Time End: ');
disp(str2);
timespan=toc(timebegin);
fprintf('Time Span: %.4f s\n', timespan);

disp('******************************************');

References

Thursday, May 5, 2016

Video: Matlab Call GDAL Functions

Introduction

视频讲解Matlab启动GDAL处理数据的一般原理及过程。

FFmpeg: Concatenate videos

Introduction

FFmpeg连接(组合、合并)多视频文件的操作。
文献[1]示例代码:
1
2
3
4
ffmpeg -i input1.avi -qscale:v 1 intermediate1.mpg
ffmpeg -i input2.avi -qscale:v 1 intermediate2.mpg
ffmpeg -i concat:"intermediate1.mpg|intermediate2.mpg" -c copy intermediate_all.mpg
ffmpeg -i intermediate_all.mpg -qscale:v 2 output.avi
简述以上处理过程:文件input1.avi和input2.avi先经格式转换至mpg文件,随后这两个mpg文件首尾连接输出一个合并文件,最后将这一合并文件再经格式转换至.avi格式文件。

Example

在Matlab启动FFmpeg实现如上同样的处理流程,代码:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
% Created by LI Xu
% Version 1.0
% April 20, 2016

% Description:
% Combine several videos to one

% If you have any question about this code,
% please do not hesitate to contact me via E-mail: 
% jeremy456@163.com

% Blog:
% http://blog.sciencenet.cn/u/lixujeremy
% http://lixuworld.blogspot.com/

clear
clc

% Source Directory
SouDir='input';
% Destination Directory
DesDir='output';
otpath=fullfile(DesDir, 'all.wmv');
% All Input Videos
videos=dir(fullfile(SouDir, '*.wmv'));

% Loop to convert input videos
% to the mpg format

disp('...Start to convert to mpg format...');
for ii=1:length(videos)
    vidname=videos(ii).name;
    [~, filename, ~]=fileparts(vidname);
    vidpath=fullfile(SouDir, vidname);
    % Mpg
    mpgpath=fullfile(SouDir, [filename, '.mpg']);
    ConToMpg(vidpath, mpgpath); 
end
disp('...Finish to convert to mpg format...');

% All mpg Videos
mpgfiles=dir(fullfile(SouDir, '*.mpg'));
% Construct file path string
vidstr=[];
for ii=1:length(mpgfiles)
    mpgname=mpgfiles(ii).name;
    mpgpath=fullfile(SouDir, mpgname);
    if isempty(vidstr)
        vidstr=mpgpath;
    else
        vidstr=[vidstr, '|', mpgpath];
    end
end


disp('...Start to Concatenate...');
% Command
outmpg='temporary.mpg';
cmdstr=['ffmpeg -i concat:"', vidstr, '"'];
cmdstr=[cmdstr, ' -c copy ', outmpg];
[stuat, cmdout]=system(cmdstr);

% Delete all mpg files
DeleteMPG(SouDir, mpgfiles);

% Convert to wmv
ConToWMV(outmpg, otpath);
delete(outmpg);
disp('...Finish to Concatenate...');
disp('Exit');
disp('**************************************************');
注意:合并文件比之输入文件大小之和还大出许多。

References

Tuesday, April 26, 2016

Video: Installing FFmpeg

Introduction

FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations.
It contains libavcodec, libavutil, libavformat, libavfilter, libavdevice, libswscale and libswresample which can be used by applications. As well as ffmpeg, ffserver, ffplay and ffprobe which can be used by end users for transcoding, streaming and playing.

Installation

首先,从参考文献[2]下载适用于安装机器的FFmpeg安装文件,32bit或是64bit。安装文件有三种Static、Shared和Dev,若区分不清,可以直接选择Static。以Win7 64bit操作系统为例,选择最新安装文件是:
1
ffmpeg-20160418-git-13406b6-win64-static.7z
20160418是发布日期,win64是指Win 64bit系统,static是其中一种类型。
将这一安装文件解压,得到一个名为如下的目录:
1
ffmpeg-20160418-git-13406b6-win64-static
这一目录可以放在任何位置,即为以后该软件的运行位置。
之后,路径要添加到环境变量Path下,这一路径是:
1
~~\ffmpeg-20160418-git-13406b6-win64-static\bin
添加成功后,在CMD上输入命令“ffmpeg –version”,若返回ffmpeg版本信息即表示安装成功。

References

[1] http://ffmpeg.org.
[2] Download Address: https://ffmpeg.zeranoe.com/builds/.

Tuesday, April 19, 2016

Video: Matlab操作GeoTIFF文件

Introduction

视频讲解Matlab自带函数对GeoTIFF文件的操作,包括3个函数:geotiffread、geotiffinfo、geotiffwrite。