此前做了一系列有关FFmpeg的示例程序,组成了《FFmpeg示例程序合集》,其中包含了如下项目:
simplest ffmpeg player:                  最简单的基于FFmpeg的视频播放器
simplest ffmpeg audio player:       最简单的基于FFmpeg的音频播放器
simplest ffmpeg pic encoder:        最简单的基于FFmpeg的图像编码器
simplest ffmpeg video encoder:    最简单的基于FFmpeg的视频编码器
simplest ffmpeg audio encoder:   最简单的基于FFmpeg的音频编码器
simplest ffmpeg streamer:             最简单的基于FFmpeg的推流器(推送RTMP)
simplest ffmpeg mem handler:     最简单的基于FFmpeg的内存读写例子
simplest ffmpeg device:                  最简单的基于FFmpeg的AVDevice例子
simplest ffmpeg format:                 最简单的基于FFmpeg的封装格式方面的例子
simplest ffmpeg video filter:          最简单的基于FFmpeg的AVfilter例子(水印叠加)
simplest ffmpeg swscale:             最简单的基于FFmpeg的libswscale的示例
为了方便今后代码的升级,将上述工程的代码统一上传到了Git代码托管平台(SourceForge,Github,开源中国),并且做了几个简单的脚本用于获取代码,如下所列:

克隆(simplest_ffmpeg_demos_git_clone_all.sh):把代码从远端复制到本机(类似于下载)。
更新(simplest_ffmpeg_demos_git_pull_all.sh):把代码从远端更新到本机(类似于升级)。
重置(simplest_ffmpeg_demos_git_reset_all.sh):回退本机的代码到上一个版本(类似于还原)。
归档(simplest_ffmpeg_demos_git_archive_all.sh):将本机的项目代码归档(例如打包为zip)。

这些脚本的下载地址:

【Github】 https://github.com/leixiaohua1020/leixiaohua1020.github.io/tree/master/batch

克隆

克隆脚本可以“一键下载”(clone命令)源代码至本机,并且设置本地仓库的3个远程仓库(remote):SourceForge,Github和开源中国。
该脚本有一个originstr参数需要设置。该参数决定了从哪里克隆源代码,经过测试发现开源中国的速度明显高于SourceForge和Github。
simplest_ffmpeg_demos_git_clone_all.sh内容如下所示。

echo "============================================="
echo "simplest ffmpeg demos list ---- git clone all"
echo "Lei Xiaohua"
echo "Communication University of China / Digital TV Technology"
echo "leixiaohua1020@126.com"
echo "http://blog.csdn.net/leixiaohua1020"
echo "============================================="

originstr="github"
#3 kinds of origins:
githubstr="github"
sourceforgestr="sourceforge"
oscstr="osc"

#Git Clone
#Github
#http://leixiaohua1020.github.com/
if [ "$originstr" = "$githubstr" ]
then
git clone https://github.com/leixiaohua1020/simplest_ffmpeg_player.git simplest_ffmpeg_player
git clone https://github.com/leixiaohua1020/simplest_ffmpeg_audio_player.git simplest_ffmpeg_audio_player
git clone https://github.com/leixiaohua1020/simplest_ffmpeg_picture_encoder.git simplest_ffmpeg_picture_encoder
git clone https://github.com/leixiaohua1020/simplest_ffmpeg_video_encoder.git simplest_ffmpeg_video_encoder
git clone https://github.com/leixiaohua1020/simplest_ffmpeg_audio_encoder.git simplest_ffmpeg_audio_encoder
git clone https://github.com/leixiaohua1020/simplest_ffmpeg_streamer.git simplest_ffmpeg_streamer
git clone https://github.com/leixiaohua1020/simplest_ffmpeg_mem_handler.git simplest_ffmpeg_mem_handler
git clone https://github.com/leixiaohua1020/simplest_ffmpeg_device.git simplest_ffmpeg_device
git clone https://github.com/leixiaohua1020/simplest_ffmpeg_format.git simplest_ffmpeg_format
git clone https://github.com/leixiaohua1020/simplest_ffmpeg_video_filter.git simplest_ffmpeg_video_filter
git clone https://github.com/leixiaohua1020/simplest_ffmpeg_swscale.git simplest_ffmpeg_swscale
#SourceForge
#https://sourceforge.net/u/leixiaohua1020/wiki/
elif [ "$originstr" = "$sourceforgestr" ]
then
git clone git://git.code.sf.net/p/simplestffmpegplayer/code simplest_ffmpeg_player
git clone git://git.code.sf.net/p/simplestffmpegaudioplayer/code simplest_ffmpeg_audio_player
git clone git://git.code.sf.net/p/simplestffmpegpictureencoder/code simplest_ffmpeg_picture_encoder
git clone git://git.code.sf.net/p/simplestffmpegvideoencoder/code simplest_ffmpeg_video_encoder
git clone git://git.code.sf.net/p/simplestffmpegaudioencoder/code simplest_ffmpeg_audio_encoder
git clone git://git.code.sf.net/p/simplestffmpegstreamer/code simplest_ffmpeg_streamer
git clone git://git.code.sf.net/p/simplestffmpegmemhandler/code simplest_ffmpeg_mem_handler
git clone git://git.code.sf.net/p/simplestffmpegdevice/code simplest_ffmpeg_device
git clone git://git.code.sf.net/p/simplestffmpegformat/code simplest_ffmpeg_format
git clone git://git.code.sf.net/p/simplestffmpegvideofilter/code simplest_ffmpeg_video_filter
git clone git://git.code.sf.net/p/simplestffmpegswscale/code simplest_ffmpeg_swscale
#OSC
#http://git.oschina.net/leixiaohua1020
else
git clone https://git.oschina.net/leixiaohua1020/simplest_ffmpeg_player.git simplest_ffmpeg_player
git clone https://git.oschina.net/leixiaohua1020/simplest_ffmpeg_audio_player.git simplest_ffmpeg_audio_player
git clone https://git.oschina.net/leixiaohua1020/simplest_ffmpeg_picture_encoder.git simplest_ffmpeg_picture_encoder
git clone https://git.oschina.net/leixiaohua1020/simplest_ffmpeg_video_encoder.git simplest_ffmpeg_video_encoder
git clone https://git.oschina.net/leixiaohua1020/simplest_ffmpeg_audio_encoder.git simplest_ffmpeg_audio_encoder
git clone https://git.oschina.net/leixiaohua1020/simplest_ffmpeg_streamer.git simplest_ffmpeg_streamer
git clone https://git.oschina.net/leixiaohua1020/simplest_ffmpeg_mem_handler.git simplest_ffmpeg_mem_handler
git clone https://git.oschina.net/leixiaohua1020/simplest_ffmpeg_device.git simplest_ffmpeg_device
git clone https://git.oschina.net/leixiaohua1020/simplest_ffmpeg_format.git simplest_ffmpeg_format
git clone https://git.oschina.net/leixiaohua1020/simplest_ffmpeg_video_filter.git simplest_ffmpeg_video_filter
git clone https://git.oschina.net/leixiaohua1020/simplest_ffmpeg_swscale.git simplest_ffmpeg_swscale
fi

更新

更新脚本可以把本地库的源代码更新到最新版本。随着FFmpeg的API的变更以及一些程序中Bug的修复,项目的源代码需要与时俱进地做一些微调。可以使用pull命令将本地库的源代码“升级”到最新版本。
simplest_ffmpeg_demos_git_pull_all.sh内容如下所示。

echo "============================================="
echo "simplest ffmpeg demos list ---- git pull all"
echo "Lei Xiaohua"
echo "Communication University of China / Digital TV Technology"
echo "leixiaohua1020@126.com"
echo "http://blog.csdn.net/leixiaohua1020"
echo "============================================="

#remotestr="github"
remotestr="osc master"

#Git Pull
cd simplest_ffmpeg_player
git pull $remotestr
cd ..

cd simplest_ffmpeg_audio_player
git pull $remotestr
cd ..

cd simplest_ffmpeg_picture_encoder
git pull $remotestr
cd ..

cd simplest_ffmpeg_video_encoder
git pull $remotestr
cd ..

cd simplest_ffmpeg_audio_encoder
git pull $remotestr
cd ..

cd simplest_ffmpeg_streamer
git pull $remotestr
cd ..

cd simplest_ffmpeg_mem_handler
git pull $remotestr
cd ..

cd simplest_ffmpeg_device
git pull $remotestr
cd ..

cd simplest_ffmpeg_format
git pull $remotestr
cd ..

cd simplest_ffmpeg_video_filter
git pull $remotestr
cd ..

cd simplest_ffmpeg_swscale
git pull $remotestr
cd ..

重置

重置脚本用于将源代码回退到上一个版本。重置命令(reset)在两种情况会使用:
一种情况是改代码的时候改着改着忽然发现代码编译不过了,可是又难以恢复到原来可以编译通过的代码,这时候可以使用重置命令;
另一种情况是改完代码之后,使用更新命令(pull)却提示错误,这时候可以先使用重置命令,然后再使用更新命令。
simplest_ffmpeg_demos_git_reset_all.sh内容如下所示。

echo "============================================="
echo "simplest ffmpeg demos list ---- git reset all"
echo "Lei Xiaohua"
echo "Communication University of China / Digital TV Technology"
echo "leixiaohua1020@126.com"
echo "http://blog.csdn.net/leixiaohua1020"
echo "============================================="

#Git Pull
cd simplest_ffmpeg_player
git reset --hard
cd ..

cd simplest_ffmpeg_audio_player
git reset --hard
cd ..

cd simplest_ffmpeg_picture_encoder
git reset --hard
cd ..

cd simplest_ffmpeg_video_encoder
git reset --hard
cd ..

cd simplest_ffmpeg_audio_encoder
git reset --hard
cd ..

cd simplest_ffmpeg_streamer
git reset --hard
cd ..

cd simplest_ffmpeg_mem_handler
git reset --hard
cd ..

cd simplest_ffmpeg_device
git reset --hard
cd ..

cd simplest_ffmpeg_format
git reset --hard
cd ..

cd simplest_ffmpeg_video_filter
git reset --hard
cd ..

cd simplest_ffmpeg_swscale
git reset --hard
cd ..

归档

归档脚本用于将本地的代码库打包为压缩包(*.zip,*.tar.gz)。我个人感觉Git归档和直接压缩源代码文件夹最大的不同在于Git归档使用了“.gitignore”文件,从而忽略掉一些无关紧要的文件。
该脚本运行之后会生成一个名称为“simplest_ffmpeg_demos_list_{日期}”的文件夹,并且将归档后的文件保存在其中,归档后文件的命名方式为“simplest_ffmpeg_player_{日期}.zip”。
simplest_ffmpeg_demos_git_archive_all.sh内容如下所示。

echo "============================================="
echo "simplest ffmpeg demos list ---- git archive all"
echo "Lei Xiaohua"
echo "Communication University of China / Digital TV Technology"
echo "leixiaohua1020@126.com"
echo "http://blog.csdn.net/leixiaohua1020"
echo "============================================="

#save in a folder named with date
#file suffix
#fsuffix="latest"
fsuffix=$(date +%y%m%d)
#folder to save files
archivefolder="simplest_ffmpeg_demos_list_"${fsuffix}
echo "Archive Folder : "${archivefolder}

#if folder not exist, create it
if [ ! -d ${archivefolder} ]; then
  mkdir ${archivefolder}
fi

#Git Archive
echo Archive simplest_ffmpeg_player...
cd simplest_ffmpeg_player
git archive -o "../"${archivefolder}"/simplest_ffmpeg_player_"${fsuffix}".zip" HEAD
cd ..

echo Archive simplest_ffmpeg_audio_player...
cd simplest_ffmpeg_audio_player
git archive -o "../"${archivefolder}"/simplest_ffmpeg_audio_player_"${fsuffix}".zip" HEAD
cd ..

echo Archive simplest_ffmpeg_picture_encoder...
cd simplest_ffmpeg_picture_encoder
git archive -o "../"${archivefolder}"/simplest_ffmpeg_picture_encoder_"${fsuffix}".zip" HEAD
cd ..

echo Archive simplest_ffmpeg_video_encoder...
cd simplest_ffmpeg_video_encoder
git archive -o "../"${archivefolder}"/simplest_ffmpeg_video_encoder_"${fsuffix}".zip" HEAD
cd ..

echo Archive simplest_ffmpeg_audio_encoder...
cd simplest_ffmpeg_audio_encoder
git archive -o "../"${archivefolder}"/simplest_ffmpeg_audio_encoder_"${fsuffix}".zip" HEAD
cd ..

echo Archive simplest_ffmpeg_streamer...
cd simplest_ffmpeg_streamer
git archive -o "../"${archivefolder}"/simplest_ffmpeg_streamer_"${fsuffix}".zip" HEAD
cd ..

echo Archive simplest_ffmpeg_mem_handler...
cd simplest_ffmpeg_mem_handler
git archive -o "../"${archivefolder}"/simplest_ffmpeg_mem_handler_"${fsuffix}".zip" HEAD
cd ..

echo Archive simplest_ffmpeg_device...
cd simplest_ffmpeg_device
git archive -o "../"${archivefolder}"/simplest_ffmpeg_device_"${fsuffix}".zip" HEAD
cd ..

echo Archive simplest_ffmpeg_format...
cd simplest_ffmpeg_format
git archive -o "../"${archivefolder}"/simplest_ffmpeg_format_"${fsuffix}".zip" HEAD
cd ..

echo Archive simplest_ffmpeg_video_filter...
cd simplest_ffmpeg_video_filter
git archive -o "../"${archivefolder}"/simplest_ffmpeg_video_filter_"${fsuffix}".zip" HEAD
cd ..

echo Archive simplest_ffmpeg_swscale...
cd simplest_ffmpeg_swscale
git archive -o "../"${archivefolder}"/simplest_ffmpeg_swscale_"${fsuffix}".zip" HEAD
cd ..

FFmpeg示例程序合集-Git批量获取脚本的更多相关文章

  1. FFmpeg示例程序合集-批量编译脚本

    此前做了一系列有关FFmpeg的示例程序,组成了<最简单的FFmpeg示例程序合集>,其中包含了如下项目:simplest ffmpeg player:                   ...

  2. 天气类API调用的代码示例合集:全国天气预报、实时空气质量数据查询、PM2.5空气质量指数等

    以下示例代码适用于 www.apishop.net 网站下的API,使用本文提及的接口调用代码示例前,您需要先申请相应的API服务. 全国天气预报:数据来自国家气象局,可根据地名.经纬度GPS.IP查 ...

  3. 位置信息类API调用的代码示例合集:中国省市区查询、经纬度地址转换、POI检索等

    以下示例代码适用于 www.apishop.net 网站下的API,使用本文提及的接口调用代码示例前,您需要先申请相应的API服务. 中国省市区查询:2017最新中国省市区地址 经纬度地址转换:经纬度 ...

  4. 通讯服务类API调用的代码示例合集:短信服务、手机号归属地查询、电信基站查询等

    以下示例代码适用于 www.apishop.net 网站下的API,使用本文提及的接口调用代码示例前,您需要先申请相应的API服务. 短信服务:通知类和验证码短信,全国三网合一通道,5秒内到达,费用低 ...

  5. 生活常用类API调用的代码示例合集:邮编查询、今日热门新闻查询、区号查询等

    以下示例代码适用于 www.apishop.net 网站下的API,使用本文提及的接口调用代码示例前,您需要先申请相应的API服务. 邮编查询:通过邮编查询地名:通过地名查询邮编 今日热门新闻查询:提 ...

  6. 开发工具类API调用的代码示例合集:六位图片验证码生成、四位图片验证码生成、简单验证码识别等

    以下示例代码适用于 www.apishop.net 网站下的API,使用本文提及的接口调用代码示例前,您需要先申请相应的API服务. 六位图片验证码生成:包括纯数字.小写字母.大写字母.大小写混合.数 ...

  7. 出行服务类API调用的代码示例合集:长途汽车查询、车型大全、火车票查询等

    以下示例代码适用于 www.apishop.net 网站下的API,使用本文提及的接口调用代码示例前,您需要先申请相应的API服务. 长途汽车查询:全国主要城市的长途汽车时刻查询,汽车站查询 车型大全 ...

  8. 部署Bookinfo示例程序详细过程和步骤(基于Kubernetes集群+Istio v1.0)

    部署Bookinfo示例程序详细过程和步骤(基于Kubernetes集群+Istio v1.0) 部署Bookinfo示例程序   在下载的Istio安装包的samples目录中包含了示例应用程序. ...

  9. 前端,Java,产品经理,微信小程序,Python等资源合集大放送

    为了感恩大家长久以来的关注和支持,小编准备了一些福利,整理了包含前端,Java,产品经理,微信小程序,Python,网站源码,Android应用视频教程,微信公众平台开发教程及材料等资源合集大放送. ...

随机推荐

  1. 【bzoj4568 scoi2016】幸运数字

    题目描述 A 国共有 n 座城市,这些城市由 n-1 条道路相连,使得任意两座城市可以互达,且路径唯一.每座城市都有一个幸运数字,以纪念碑的形式矗立在这座城市的正中心,作为城市的象征. 一些旅行者希望 ...

  2. springmvc上传文件方法及注意事项

    本文基于注解的配置,敬请留意  基于注解整合 一.springmvc为我们提供两种上传方式配置: org.springframework.web.multipart.commons.CommonsMu ...

  3. 实现鼠标双击(OnGUI)

    void OnGUI()//实现鼠标双击 { Event Mouse = Event.current; if (Mouse.isMouse && Mouse.type == Event ...

  4. Python IDLE背景主题

    相信刚进入python学习之路的朋友们,都还是挺喜欢python自带的IDLE,但是白的代码背景色以及其它的代码色确实让人看着有点不舒服,所以当时也琢磨着能不能自己给它换换颜色,这个当然可以,废话不多 ...

  5. Python与C的简单比较(Python3.0)

    Python可以说是目前最火的语言之一了,人工智能的兴起让Python一夜之间变得家喻户晓,Python号称目前最最简单易学的语言,现在有不少高校开始将Python作为大一新生的入门语言.本萌新也刚开 ...

  6. Linked List Cycle II--寻找单链表中环的起始点

    题目要求 Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull. ...

  7. ES6(数组)

    ES6数组新增特性 1. 空数组 2.将伪数组转换成真正的数组 将 p 标签集合转换成真正数组 类似于map的用法,转换数组同时还在遍历. 3.填充数组(将所有数组换成一个值) 1代表起始位置,3代表 ...

  8. Tomcat出现validateJarFile-jar not loaded问题

    tomcat启动时问题: validateJarFile(...\WEB-INF\lib\servlet-api.jar)-jar not loaded. See Servlet Spec 2.3, ...

  9. MYSQL 表左连接 ON AND 和ON WHERE 的区别

    首先是针对左右连接,这里与inner join区分 在使用left join时,on and 和on where会有区别 1. on的条件是在连接生成临时表时使用的条件,以左表为基准 ,不管on中的条 ...

  10. C# get 、set、索引器

    get 与 set C#类的属性有公有属性(public)和私有属性(private).如果直接将一个属性声明为public,则该类的任意实例可以随意获取或修改该属性的值,很不安全..NET Fram ...