ffmpeg 学习笔记

扶醉桌前 提交于 2021-01-30 14:52:05

ffmpeg -threads 8 -i 997.mp4 -y -c:v libx264 -c:a copy -f hls -g 60 -hls_time 2 hls_list_size 0 -hls_segment_filename test/out-%08d.ts test/out.m3u8

ffmpeg -re -i 997.mp4 -c copy -f hls -bsf:v libx264 test/out-%08d.ts test/out.m3u8

"ffmpeg","-threads","4","-i","/tmp/video/workdir/rBL7YF9hn_CEOIUNAAAAAIn7Jxk745/marker/rBL7YF9hn_CEOIUNAAAAAIn7Jxk745.mp4","-c:v","libx264","-c:a","copy","-f","hls","-g","60","-hls_time","2","-hls_list_size","0","-hls_key_info_file","/tmp/video/workdir/rBL7YF9hn_CEOIUNAAAAAIn7Jxk745/marker/keys/encrypt.keyinfo","-hls_segment_filename","/tmp/video/workdir/rBL7YF9hn_CEOIUNAAAAAIn7Jxk745/marker/out/out-%08d.ts","/tmp/video/workdir/rBL7YF9hn_CEOIUNAAAAAIn7Jxk745/marker/out/out.m3u8"

ffmpeg -re -i test.mp4 -c copy -f hls -hls_time 15 segment -segment_format mp4 -segment_list_type m3u8 -segment_list test_output.m3u8 test_output_%d.ts

-fs 20480000

ffmpeg -threads 7 -re -i test.mp4 -c copy -f hls -g 60 -hls_time 15 -hls_list_size 0 -bsf:v h264_mp4toannexb -hls_segment_filename out-%08d.ts output.m3u8

ffmpeg -re -i test.mp4 -c copy -f hls -g 60 -hls_time 15 -hls_list_size 0 -bsf:v h264_mp4toannexb -hls_segment_filename out-%08d.ts output.m3u8

ffmpeg -re -i huijia.mp4 -c copy -f hls -hls_time 9 -hls_list_size 0 -bsf:v h264_mp4toannexb output.m3u8

Video: h264 (avc1 / 0x31637661), yuv420p, 1920x910 [SAR 1:1 DAR 192:91], q=2-31, 197 kb/s, 15 fps, 15 tbr, 90k tbn, 15 tbc (default)

ffmpeg version 2.8.15 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-36) configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect libavutil 54. 31.100 / 54. 31.100 libavcodec 56. 60.100 / 56. 60.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 40.101 / 5. 40.101 libavresample 2. 1. 0 / 2. 1. 0 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 libpostproc 53. 3.100 / 53. 3.100 Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Getting help: -h -- print basic options -h long -- print more options -h full -- print all options (including all format and codec specific options, very long) See man ffmpeg for detailed description of the options.

Print help / information / capabilities: -L show license -h topic show help -? topic show help -help topic show help --help topic show help -version show version -buildconf show build configuration -formats show available formats -devices show available devices -codecs show available codecs -decoders show available decoders -encoders show available encoders -bsfs show available bit stream filters -protocols show available protocols -filters show available filters -pix_fmts show available pixel formats -layouts show standard channel layouts -sample_fmts show available audio sample formats -colors show available color names -sources device list sources of the input device -sinks device list sinks of the output device -hwaccels show available HW acceleration methods

Global options (affect whole program instead of just one file: -loglevel loglevel set logging level -v loglevel set logging level -report generate a report -max_alloc bytes set maximum size of a single allocated block -y overwrite output files -n never overwrite output files -ignore_unknown Ignore unknown stream types -stats print progress report during encoding -max_error_rate ratio of errors (0.0: no errors, 1.0: 100% error maximum error rate -bits_per_raw_sample number set the number of bits per raw sample -vol volume change audio volume (256=normal)

Per-file main options: -f fmt force format -c codec codec name -codec codec codec name -pre preset preset name -map_metadata outfile[,metadata]:infile[,metadata] set metadata information of outfile from infile -t duration record or transcode "duration" seconds of audio/video -to time_stop record or transcode stop time -fs limit_size set the limit file size in bytes -ss time_off set the start time offset -sseof time_off set the start time offset relative to EOF -seek_timestamp enable/disable seeking by timestamp with -ss -timestamp time set the recording timestamp ('now' to set the current time) -metadata string=string add metadata -target type specify target file type ("vcd", "svcd", "dvd", "dv" or "dv50" with optional prefixes "pal-", "ntsc-" or "film-") -apad audio pad -frames number set the number of frames to output -filter filter_graph set stream filtergraph -filter_script filename read stream filtergraph description from a file -reinit_filter reinit filtergraph on input parameter changes -discard discard -disposition disposition

Video options: -vframes number set the number of video frames to output -r rate set frame rate (Hz value, fraction or abbreviation) -s size set frame size (WxH or abbreviation) -aspect aspect set aspect ratio (4:3, 16:9 or 1.3333, 1.7777) -bits_per_raw_sample number set the number of bits per raw sample -vn disable video -vcodec codec force video codec ('copy' to copy stream) -timecode hh:mm:ss[:;.]ff set initial TimeCode value. -pass n select the pass number (1 to 3) -vf filter_graph set video filters -ab bitrate audio bitrate (please use -b:a) -b bitrate video bitrate (please use -b:v) -dn disable data

Audio options: -aframes number set the number of audio frames to output -aq quality set audio quality (codec-specific) -ar rate set audio sampling rate (in Hz) -ac channels set number of audio channels -an disable audio -acodec codec force audio codec ('copy' to copy stream) -vol volume change audio volume (256=normal) -af filter_graph set audio filters

Subtitle options: -s size set frame size (WxH or abbreviation) -sn disable subtitle -scodec codec force subtitle codec ('copy' to copy stream) -stag fourcc/tag force subtitle tag/fourcc -fix_sub_duration fix subtitles duration -canvas_size size set canvas size (WxH or abbreviation) -spre preset set the subtitle options to the indicated preset

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!