Machine learning or computer vision practitioners often have to deal with videos. The prerequisite is to download video from servers, or further need to stream multiple small videos into one video, with its format changed (for instance,
.mp4). Here I give a simple way to do this:
First, download the video from web server with
youtube-dl. Although it is initially designed for downloading videos from youtube, it covers most video servers in China, like youku, aiqiyi. It works as:
Assume that you have all the video downloaded, then all you have to do is to list all videos you want to stream into a file, as:
1 2 3
/path/ can be either relative or absolute paths. Then you can stream copy or re-encode your files into whatever format you want, like
.mp4, with the following shell script:
Of course, in order to let it work, you should pre-install
FFmpeg in your OS.
Now, just enjoy this technique.