Download YouTube and create an animated GIF from sub-part
Convert videos
Figure out which DirectShow input devices I have
On my work laptop, I have an integrated web cam, a built-in microphone, and an additional head set:
The strings "Integrated Camera", "Microphone (Realtek High Definition Audio)" and "Headset Microphone (Plantronics C520-M)" now refer to the different usable sources. In ffmpeg, the -i parameter usually refers to the input file. In our case, we can now combine video & audio sources to an input specification for ffmpeg:
-f flv rtmp://chan1-acc2.channel.mediaservices.windows.net:1936/live/deadbeef/chan1 target RTMP endpoint to push to
Ingest the RTMP stream
You can use the DASHPlayer or aka.ms/azuremediaplayer. Don't forget to append (format=mpd-time-csf) or (format=m3u8-aapl) to the streams for DASH or HLS streaming.
Convert a bunch of MP3 files to an iPod audio book
Using FFMPEG to create VOD files
Convert FLV (Flash Video) into real MP4
Files are FLVs, but named MP4. Make them real MP4. The -map_metadata 0 ensures that metadata like date etc flows over to the new file.
Concatenate video files
In order to concatenate MP4 files, each file must be converted into a Transport Stream (.ts), i.e. without a MOOV atom, and then concatenated and re-written into a proper .mp4 file (with MOOV atom):
Alternatively, you can list all input files in a text file:
@echo off
REM Line 1 sets the universal encoding parameters for all video files including the recommended 2-second GOP size.
REM Lines 2 – 5 set the encoding parameters and identifies the four video files. You can add any encoding parameter to any line so long as you designate which file it is using the v:# syntax shown. I listed the 540p file first to loosely comply with Apple’s recommendation of starting with a 2 Mbps file. You can add or subtract files from the ladder so long as you adjust the mappings on lines 7 and 8.
REM Line 6 produces the audio file.
REM Line 7 maps the single input video file to all video files in the encoding ladder and maps the single audio file to the audio output. Note that there are four -map 0:v switches, one for each video file. If you add or subtract video files you’d have to adjust this line accordingly.
REM Line 8 chooses the HLS format and then maps the individual video files to the single audio file. Again, you need a mapping statement for each video file in the encoding ladder.
REM This is what it looks like in the master manifest file. You see the two video files shown both play the group_audio file specified in line 8.
REM Line 9 sets normal HLS options like producing a single file rather than multiple segments (-hls_flags single_file), producing a fragmented MP4 file rather than an MPEG-2 transport stream (-hls_segment_type fmp4), including all segments in each manifest file (-hls_list_size 0), choosing six-second segments (-hls_time 6) and then naming the master and media manifest files.
ffmpeg.exe ^
-threads 0 -i TOS_1080p.mov -r 24 -g 48 -keyint_min 48 -sc_threshold 0 -c:v libx264^
-s:v:0 960x540 -b:v:0 2400k -maxrate:v:0 2640k -bufsize:v:0 2400k^
-s:v:1 1920x1080 -b:v:1 5200k -maxrate:v:1 5720k -bufsize:v:1 5200k^
-s:v:2 1280x720 -b:v:2 3100k -maxrate:v:2 3410k -bufsize:v:2 3100k^
-s:v:3 640x360 -b:v:3 1200k -maxrate:v:3 1320k -bufsize:v:3 1200k^
-b:a 128k -ar 44100 -ac 2^
-map 0:v -map 0:v -map 0:v -map 0:v -map 0:a^
-f hls -var_stream_map "v:0,agroup:audio v:1,agroup:audio v:2,agroup:audio v:3,agroup:audio a:0,agroup:audio"^
-hls_flags single_file -hls_segment_type fmp4 -hls_list_size 0 -hls_time 6 -master_pl_name master.m3u8 -y TOS%v.m3u8