video

Remote download M3U8 files and convert them to local MP4 files

ffmpeg  -i "https://test.com/index.m3u8" -vcodec copy -acodec copy -absf aac_adtstoasc  output.mp4

MP4 file compression

MP4-B: V: Specifies the bitrate of the video, which determines the size of the video

Download a remote M3U8 file and convert it to a local MP4

 ffmpeg  -i "https://test.com/index.m3u8" -vcodec copy -acodec copy -absf aac_adtstoasc  output.mp4

MP4 to M3U8 file


ffmpeg -i test.mp4 -c:v libx264 -c:a aac -strict -2 -f hls -hls_list_size 0  -hls_time 15 test.m3u8

Most of the directives found on the Internet are -hls_list_size 5. This parameter means that only the last 5 fragments are retrieved, so specify -hls_list_size 0 so that all fragments are included

MP4 captures a segment and converts it into a GIF

 ffmpeg -ss 270 -t 10 -i output.mp4  -r 15 output1.gif

A picture taken of a particular frame of a video

Ffmpeg-i test.mp4-ss 1.000 -vframes 1 test.jpg ss for time in seconds

Extract audio

ffmpeg  -i 4.mp4 -vn 4.mp3

Extract audio free video

ffmpeg -i 4.mp4 -an r.mp4

audio

Audio file conversion

Ffmpeg-i test.mp3 -b:a 64k-ar 32000-y test.m4a from mp3 to m4a, using 64k sampling rate

Capture a segment of audio

FFMPEG-SS 18.59-T 2-I Test.mp3 -C Copy 2miao.mp3 means to intercept 2 seconds of audio from 18.59 seconds

Audio joining together

Ffmpeg -i "concat: arjun p3 | b.m p3 | c. p3" - c copy output. The abc3 a mp3 audio pieced together, according to ABC this order require three audio sample rate

The picture

Play the watermark

ffmpeg -i 1.jpg -vf drawtext=fontcolor=white:fontsize=40:text='hello':x=825:y=1316:fontsize=24:fontcolor=yellow:shadowy=2 1x.jpg

Remove the watermark

ffmpeg -y -i test.jpg -strict -2 -vf delogo=x=100:y=100:w=200:h=200:show=0 output.jpg