ããã¯ãUbuntu OnlineãFedora OnlineãWindows ãªã³ã©ã€ã³ ãšãã¥ã¬ãŒã¿ãŒããŸã㯠MAC OS ãªã³ã©ã€ã³ ãšãã¥ã¬ãŒã¿ãŒãªã©ã®è€æ°ã®ç¡æãªã³ã©ã€ã³ ã¯ãŒã¯ã¹ããŒã·ã§ã³ã® XNUMX ã€ã䜿çšããŠãOnWorks ç¡æãã¹ãã£ã³ã° ãããã€ããŒã§å®è¡ã§ããã³ãã³ã ffmpeg-formats ã§ãã
ããã°ã©ã ïŒ
NAME
ffmpeg-formats - FFmpeg ãã©ãŒããã
DESCRIPTION
ãã®ããã¥ã¡ã³ãã§ã¯ã
libavformat ã©ã€ãã©ãªã
FORMAT OPTIONS
libavformatã©ã€ãã©ãªã¯ããã¹ãŠã®
ãã«ããã¬ã¯ãµãšããã«ããã¬ã¯ãµã ããã«ãåãã«ããã¬ã¯ãµãŸãã¯ããã«ããã¬ã¯ãµã¯ããããããã©ã€ããŒãããµããŒãããå ŽåããããŸã
ãã®ã³ã³ããŒãã³ãã«åºæã®ãªãã·ã§ã³ã
ãªãã·ã§ã³ã¯ã-ãæå®ããŠèšå®ã§ããŸãããªãã·ã§ã³ å€ FFmpegããŒã«ã§ããŸãã¯ãèšå®ããããšã«ãã£ãŠ
ãAVFormatContextããªãã·ã§ã³ã§æ瀺çã«å€ãæå®ãããã libavutil / opt.h ã®API
ããã°ã©ã ã«ãã䜿çšã
ãµããŒããããŠãããªãã·ã§ã³ã®ãªã¹ãã¯æ¬¡ã®ãšããã§ãã
ã¢ããªãã©ã° ãã©ã° (å ¥åºå)
å¯èœãªå€ïŒ
çŽæ¥
ãããã¡ãªã³ã°ãæžãããŸãã
ãããŒããµã€ãº æŽæ° ( )
ãããŒããµã€ãºããã€ãåäœã§èšå®ããŸããã€ãŸããã¹ããªãŒã ãååŸããããã«åæããããŒã¿ã®ãµã€ãºã§ãã
æ å ±ã å€ã倧ãããããšãããå€ãã®æ å ±ãæ€åºã§ããããã«ãªããŸãã
ã¹ããªãŒã ã«åæ£ãããŸãããé 延ãå¢å ããŸãã æŽæ°ä»¥äžã§ããå¿ èŠããããŸã
32ããã倧ãããããã©ã«ãã§ã¯5000000ã§ãã
ãã±ãããµã€ãº æŽæ° (åºå)
ãã±ãããµã€ãºãèšå®ããŸãã
ãã©ã° ãã©ã° (å ¥åºå)
ãã©ãŒããããã©ã°ãèšå®ããŸãã
å¯èœãªå€ïŒ
ã€ã°ãã
ã€ã³ããã¯ã¹ãç¡èŠããŸãã
ãã¡ã¹ãã·ãŒã¯
äžéšã®ãã©ãŒãããã§ã¯ãé«éã§ããäžæ£ç¢ºãªã·ãŒã¯ãæå¹ã«ããŸãã
ãžã§ã³ãã¹
PTSãçæããŸãã
ããã£ãªã³
æ£ç¢ºã«èšç®ã§ããæ¬ èœå€ãå ¥åããªãã§ãã ããã
ããŒã¹ãªã
AVParsersãç¡å¹ã«ããŸããããã«ãã+ nofillinããå¿ èŠã§ãã
ç¡èŠãã
DTSãç¡èŠããŸãã
ç Žæããç Žæ£
ç Žæãããã¬ãŒã ãç Žæ£ããŸãã
䞊ã¹æ¿ã
DTSã«ãã£ãŠåºåãã±ãããã€ã³ã¿ãŒãªãŒãããŠã¿ãŠãã ããã
ããŒããµã€ã
ãµã€ãããŒã¿ãããŒãžããªãã§ãã ããã
緯床
RTPMP4A-LATMãã€ããŒããæå¹ã«ããŸãã
ããŒãããã¡
ãªãã·ã§ã³ã®ãããã¡ãªã³ã°ã«ãã£ãŠå°å ¥ãããã¬ã€ãã³ã·ãåæžããŸã
ãããæ£ç¢º
ãã©ãããã©ãŒã ããã«ããããã³æéã«äŸåããªãããŒã¿ã®ã¿ãæžã蟌ã¿ãŸãã ããã«ããããã¡ã€ã«ã確å®ã«ãªããŸã
ããŒã¿ãã§ãã¯ãµã ã¯åçŸå¯èœã§ããããã©ãããã©ãŒã éã§äžèŽããŸãã ãã®äž»ãªçšé
ååž°ãã¹ãçšã§ãã
ã·ãŒã¯2 æŽæ° ( )
1ã«èšå®ãããŠããå ŽåããµããŒããããŠããå Žåãããã«ããã¬ã¯ãµã¬ãã«ã§éããŒãã¬ãŒã ãã·ãŒã¯ã§ããããã«ããŸããããã©ã«ã
0ã§ãã
åæããã æŽæ° ( )
å ¥åããããŒãããããã«åæããããã€ã¯ãç§æ°ãæå®ããŸãã ããé«ãå€ã¯
ããæ£ç¢ºãªæ å ±ã®æ€åºãå¯èœã«ããŸãããåŸ ã¡æéãé·ããªããŸãã ããã©ã«ãã¯
5,000,000ãã€ã¯ãç§= 5ç§ã
ã¯ãªããã㌠16é²æ° string ( )
埩å·åããŒãèšå®ããŸãã
ã€ã³ããã¯ã¹ã¡ã¢ãª æŽæ° ( )
ã¿ã€ã ã¹ã¿ã³ãã€ã³ããã¯ã¹ã«äœ¿çšãããæ倧ã¡ã¢ãªãèšå®ããŸãïŒã¹ããªãŒã ããšïŒã
rtbufsize æŽæ° ( )
ãªã¢ã«ã¿ã€ã ãã¬ãŒã ã®ãããã¡ãªã³ã°ã«äœ¿çšããæ倧ã¡ã¢ãªãèšå®ããŸãã
fdebug ãã©ã° (å ¥åºå)
ç¹å®ã®ãããã°æ å ±ãåºåããŸãã
å¯èœãªå€ïŒ
ts
æ倧é 延 æŽæ° (å ¥åºå)
æ倧ãã«ããã¬ã¯ãµãŸãã¯ããã«ããã¬ã¯ãµé 延ããã€ã¯ãç§åäœã§èšå®ããŸãã
fpsãããŒããµã€ãº æŽæ° ( )
fpsã®ãããŒãã«äœ¿çšãããã¬ãŒã æ°ãèšå®ããŸãã
audio_preload æŽæ° (åºå)
ãªãŒãã£ãªãã±ãããæ©æã«ã€ã³ã¿ãŒãªãŒããããã€ã¯ãç§ãèšå®ããŸãã
ãã£ã³ã¯ãã¥ã¬ãŒã·ã§ã³ æŽæ° (åºå)
åãã£ã³ã¯ã«ãã€ã¯ãç§ãèšå®ããŸãã
ãã£ã³ã¯ãµã€ãº æŽæ° (åºå)
åãã£ã³ã¯ã®ãµã€ãºããã€ãåäœã§èšå®ããŸãã
err_detectã f_err_detect ãã©ã° ( )
ãšã©ãŒæ€åºãã©ã°ãèšå®ããŸãã ãf_err_detectãã¯éæšå¥šã§ãããçµç±ã§ã®ã¿äœ¿çšããå¿ èŠããããŸã
ã ffmpeg ããŒã«ã
å¯èœãªå€ïŒ
crccheck
åã蟌ãŸããCRCã確èªããŸãã
ãããã¹ããªãŒã
ãããã¹ããªãŒã ä»æ§ã®éžè±ãæ€åºããŸãã
ãããã¡
äžé©åãªãããã¹ããªãŒã é·ãæ€åºããŸãã
ççºãã
ãã€ããŒãšã©ãŒæ€åºã§ãã³ãŒããäžæ¢ããŸãã
泚ææ·±ã
ä»æ§ã«éåããå®éã«ã¯èŠãããŠããªããã®ã
ãšã©ãŒãã
æºæ ãã
ãã¹ãŠã®ä»æ§ã®éæºæ ããšã©ãŒãšèŠãªããŸãã
ç©æ¥µçãª
æ£åžžãªãšã³ã³ãŒããŒããšã©ãŒãšããŠå®è¡ããŠã¯ãªããªãããšãèæ ®ããŠãã ããã
max_interleave_delta æŽæ° (åºå)
ã€ã³ã¿ãŒãªãŒãã®æ倧ãããã¡ãªã³ã°æéãèšå®ããŸãã æéã¯ã§è¡šãããŸã
ãã€ã¯ãç§ãããã©ã«ãã¯1000000ïŒ1ç§ïŒã§ãã
ãã¹ãŠã®ã¹ããªãŒã ãæ£ããã€ã³ã¿ãŒãªãŒããããããã«ããããã«ãlibavformatã¯ãããŸã§åŸ æ©ããŸã
å®éã«ãã±ãããæžã蟌ãåã«ãã¹ããªãŒã ããšã«å°ãªããšãXNUMXã€ã®ãã±ããããããŸãã
åºåãã¡ã€ã«ã äžéšã®ã¹ããªãŒã ãããŸã°ããã§ããå ŽåïŒã€ãŸããéã«å€§ããªã®ã£ãããããå Žå
é£ç¶ãããã±ããïŒãããã«ããéå°ãªãããã¡ãªã³ã°ãçºçããå¯èœæ§ããããŸãã
ãã®ãã£ãŒã«ãã¯ãæåã®ã¿ã€ã ã¹ã¿ã³ããšã®ã¿ã€ã ã¹ã¿ã³ãã®æ倧差ãæå®ããŸã
muxingãã¥ãŒã®æåŸã®ãã±ããããããè¶ ãããšãlibavformatããã±ãããåºåããŸãã
ãã¹ãŠã®ã¹ããªãŒã ã®ãã±ããããã¥ãŒã«å ¥ãããã©ããã«é¢ä¿ãªãã
0ã«èšå®ãããšãlibavformatã¯ã次ã®ãã±ãããã§ãããŸã§ãã±ããã®ãããã¡ãªã³ã°ãç¶è¡ããŸãã
ãããã¡ãªã³ã°ãããéã®æ倧ã¿ã€ã ã¹ã¿ã³ãã®éãã«é¢ä¿ãªããåã¹ããªãŒã
ãã±ããã
use_wall Clock_as_timestamps æŽæ° ( )
ã¿ã€ã ã¹ã¿ã³ããšããŠwallclockã䜿çšããŸãã
aim_negative_ts æŽæ° (åºå)
å¯èœãªå€ïŒ
ã¡ã€ã¯_ãã³ãã¬ãã£ã
ã¿ã€ã ã¹ã¿ã³ããã·ããããŠãè² ã§ãªãããã«ããŸãã ãŸããããã¯ã®ã¿åœ±é¿ããããšã«æ³šæããŠãã ãã
éå調ãªè² ã®ã¿ã€ã ã¹ã¿ã³ãã§ã¯ãªããå è¡ããè² ã®ã¿ã€ã ã¹ã¿ã³ãã
ã¡ã€ã¯ãŒã
æåã®ã¿ã€ã ã¹ã¿ã³ãã0ã«ãªãããã«ã¿ã€ã ã¹ã¿ã³ããã·ããããŸãã
ãªãŒã ïŒããã©ã«ãïŒ
ã¿ãŒã²ãããã©ãŒãããã§å¿ èŠãªå Žåã«ã·ãããæå¹ã«ããŸãã
ç¡å¹
ã¿ã€ã ã¹ã¿ã³ãã®ã·ãããç¡å¹ã«ããŸãã
ã·ãããæå¹ã«ãããšããã¹ãŠã®åºåã¿ã€ã ã¹ã¿ã³ããåãéã ãã·ãããããŸãã ãªãŒãã£ãªã
ãããªãåå¹ã®éåæåãšçžå¯Ÿçãªã¿ã€ã ã¹ã¿ã³ãã®éãã¯ä¿æãããŸã
ã·ããããªãã£ãå Žåãšæ¯èŒããŠã
Skip_initial_bytes æŽæ° ( )
1ã«èšå®ãããŠããå ŽåãããããŒãšãã¬ãŒã ãèªã¿åãåã«ã¹ããããããã€ãæ°ãèšå®ããŸããããã©ã«ãã¯
0.
æ£ãã_ts_ãªãŒããŒãã㌠æŽæ° ( )
1ã«èšå®ãããŠããå Žåãåäžã®ã¿ã€ã ã¹ã¿ã³ããªãŒããŒãããŒãä¿®æ£ããŸããããã©ã«ãã¯1ã§ãã
ãã©ãã·ã¥_ãã±ãã æŽæ° (åºå)
åãã±ããã®åŸã«ãåºã«ãªãI / Oã¹ããªãŒã ããã©ãã·ã¥ããŸãã ããã©ã«ã1ã¯ãããæå¹ã«ãã
åŸ ã¡æéãççž®ããå¹æã 0ã¯ãããç¡å¹ã«ããããã©ãŒãã³ã¹ããããã«åäžãããå¯èœæ§ããããŸã
ããå Žåã
åºå_ts_offset ãªãã»ãã (åºå)
åºåæéãªãã»ãããèšå®ããŸãã
ãªãã»ãã æéã®æå®ã§ããå¿ èŠããããŸãããåç §ããŠãã ããã ã Time ãã¥ã¬ãŒã·ã§ã³ in ã
ffmpeg-utils(1) ããã¥ã¢ã«.
ãªãã»ããã¯ããã«ããã¬ã¯ãµã«ãã£ãŠåºåã¿ã€ã ã¹ã¿ã³ãã«è¿œå ãããŸãã
æ£ã®ãªãã»ãããæå®ãããšã察å¿ããã¹ããªãŒã ãé 延ããŸãã
ã§æå®ãããæé ãªãã»ããã ããã©ã«ãå€ã¯0ã§ãïŒãªãã»ããããªãããšãæå³ããŸã
é©çšïŒã
ãã©ãŒããã_ãã¯ã€ããªã¹ã ãªã¹ã ( )
"ã"ã¯èš±å¯ãããããã«ããã¬ã¯ãµã®ãªã¹ããåé¢ããŸããã ããã©ã«ãã§ã¯ããã¹ãŠãèš±å¯ãããŠããŸãã
ãã³ãã»ãã¬ãŒã¿ãŒ string ( )
ã¹ããªãŒã ã«é¢ããã³ãã³ãã©ã€ã³ã«åºåããããã£ãŒã«ããåºåãããã«äœ¿çšãããã»ãã¬ãŒã¿
ãã©ã¡ãŒã¿ãŒã ããšãã°ããã£ãŒã«ããæ¹è¡ãšã€ã³ãã³ãã§åºåãã«ã¯ã次ã®ããã«ããŸãã
ffprobe -dump_separator "
" -ç§ ã/ videos / matrixbench_mpeg2.mpg
ãã©ãŒããã æµã æå®å
ãã©ãŒãããã¹ããªãŒã æå®åã䜿çšãããšãç¹å®ã®ã¹ããªãŒã ã«äžèŽããXNUMXã€ä»¥äžã®ã¹ããªãŒã ãéžæã§ããŸã
ããããã£ã
ã¹ããªãŒã æå®åã®å¯èœãªåœ¢åŒã¯æ¬¡ã®ãšããã§ãã
ã¹ããªãŒã ã€ã³ããã¯ã¹
ã¹ããªãŒã ããã®ã€ã³ããã¯ã¹ãšäžèŽãããŸãã
ã¹ããªãŒã ã¿ã€ã[:ã¹ããªãŒã ã€ã³ããã¯ã¹]
ã¹ããªãŒã ã¿ã€ã ã¯æ¬¡ã®ããããã§ãïŒãvãã¯ãããªããaãã¯ãªãŒãã£ãªããsãã¯åå¹ããdã
ããŒã¿ã®å Žåã¯ãtããæ·»ä»ãã¡ã€ã«ã®å Žåã¯ãtãã ããã ã¹ããªãŒã ã€ã³ããã¯ã¹ ãäžãããããšãããã¯äžèŽããŸã
ã¹ããªãŒã çªå· ã¹ããªãŒã ã€ã³ããã¯ã¹ ãã®ã¿ã€ãã®ã ãã以å€ã®å Žåã¯ããã®ãã¹ãŠã®ã¹ããªãŒã ã«äžèŽããŸã
ã¿ã€ãã
p:ããã°ã©ã ID[:ã¹ããªãŒã ã€ã³ããã¯ã¹]
If ã¹ããªãŒã ã€ã³ããã¯ã¹ ãäžãããããšãã¹ããªãŒã ãšçªå·ãäžèŽããŸã ã¹ããªãŒã ã€ã³ããã¯ã¹ äŒå Žã¯
IDã®ããã°ã©ã ããã°ã©ã IDã ãã以å€ã®å Žåã¯ãããã°ã©ã å ã®ãã¹ãŠã®ã¹ããªãŒã ã«äžèŽããŸãã
#ã¹ããªãŒã ID
ãã©ãŒãããåºæã®IDã§ã¹ããªãŒã ãç §åããŸãã
ã¹ããªãŒã æå®åã®æ£ç¢ºãªã»ãã³ãã£ã¯ã¹ã¯ã
ã§å®£èšããããavformat_match_stream_specifierïŒïŒãé¢æ° libavformat / avformat.h
ãããã
ããã¥ã¯ãµãŒ
ããã¥ã¯ãµãŒã¯FFmpegã§æ§æãããèŠçŽ ã§ããããã«ãã¡ãã£ã¢ã¹ããªãŒã ã
ç¹å®ã®çš®é¡ã®ãã¡ã€ã«ã
FFmpegãã«ããèšå®ãããšããµããŒããããŠãããã¹ãŠã®ããã«ããã¬ã¯ãµãããã©ã«ãã§æå¹ã«ãªããŸãã
æ§æãªãã·ã§ã³ã--list-demuxersãã䜿çšããŠã䜿çšå¯èœãªãã¹ãŠã®ãã®ããªã¹ãã§ããŸãã
æ§æãªãã·ã§ã³ã--disable-demuxersãã䜿çšããŠããã¹ãŠã®ããã«ããã¬ã¯ãµãç¡å¹ã«ã§ããŸãã
ãªãã·ã§ã³ã--enable-demuxer =ãã䜿çšããŠåäžã®ããã«ããã¬ã¯ãµãéžæçã«æå¹ã«ããŸãããã¥ã¯ãµãŒãããŸãã¯ç¡å¹ã«ãã
ãªãã·ã§ã³ã--disable-demuxer =ããã¥ã¯ãµãŒã.
ff *ããŒã«ã®ãªãã·ã§ã³ã-formatsãã¯ãæå¹ãªããã«ããã¬ã¯ãµã®ãªã¹ãã衚瀺ããŸãã
çŸåšå©çšå¯èœãªããã€ãã®ããã«ããã¬ã¯ãµã®èª¬æã¯æ¬¡ã®ãšããã§ãã
aa
Audible Format 2ã3ãããã³4ã®ããã«ããã¬ã¯ãµã
ãã®ããã«ããã¬ã¯ãµã¯ãAudible Format 2ã3ãããã³4ïŒ.aaïŒãã¡ã€ã«ãããã«ããã¬ã¯ãµããããã«äœ¿çšãããŸãã
ã¢ããã«http
AppleHTTPã©ã€ãã¹ããªãŒãã³ã°ããã«ããã¬ã¯ãµã
ãã®ããã«ããã¬ã¯ãµã¯ããã¹ãŠã®ããªã¢ã³ãã¹ããªãŒã ããã®ãã¹ãŠã®AVStreamã衚瀺ããŸãã idãã£ãŒã«ãã¯ã«èšå®ãããŸã
ãããã¬ãŒãããªã¢ã³ãã€ã³ããã¯ã¹çªå·ã AVStreamsã«ç Žæ£ãã©ã°ãèšå®ããïŒãaããæŒãïŒ
ãŸãã¯ffplayã®ãvãïŒãåŒã³åºãå ã¯å®éã«åä¿¡ããããªã¢ã³ãã¹ããªãŒã ã決å®ã§ããŸãã NS
ã¹ããªãŒã ãå±ããããªã¢ã³ãã®åèšãããã¬ãŒãã¯ãã¡ã¿ããŒã¿ããŒã§å©çšã§ããŸã
ãvariant_bitrateããšããååã
APNG
ã¢ãã¡ãŒã·ã§ã³åãããããŒã¿ãã«ãããã¯ãŒã¯ã°ã©ãã£ãã¯ã¹ããã«ããã¬ã¯ãµã
ãã®ããã«ããã¬ã¯ãµã¯ãAPNGãã¡ã€ã«ãããã«ããã¬ã¯ãµããããã«äœ¿çšãããŸãã PNG眲åãé€ããã¹ãŠã®ããããŒïŒãã ã
å«ãŸãªãïŒæåã®fcTLãã£ã³ã¯ã¯extradataãšããŠéä¿¡ãããŸãã ãã®åŸããã¬ãŒã ãåå²ãããŸã
XNUMXã€ã®fcTLãã£ã³ã¯éããŸãã¯æåŸã®fcTLãã£ã³ã¯ãšIENDãã£ã³ã¯éã®ãã¹ãŠã®ãã£ã³ã¯ãšããŠã
-ignore_loop ããŒã«
èšå®ãããŠããå Žåããã¡ã€ã«å ã®ã«ãŒãå€æ°ãç¡èŠããŸãã
-max_fps intå
0ç§ãããã®ãã¬ãŒã æ°ã§è¡šããæ倧ãã¬ãŒã ã¬ãŒãïŒå¶éãªãã®å Žåã¯XNUMXïŒã
-default_fps intå
ãã¡ã€ã«ã«äœãæå®ãããŠããªãå Žåã®ããã©ã«ãã®ãã¬ãŒã ã¬ãŒãïŒãã¬ãŒã /ç§ïŒïŒ0ã¯æå³
ã§ããã ãéãïŒã
ASF
Advanced SystemsFormatããã«ããã¬ã¯ãµã
ãã®ããã«ããã¬ã¯ãµã¯ãASFãã¡ã€ã«ãšMMSãããã¯ãŒã¯ã¹ããªãŒã ãããã«ããã¬ã¯ãµããããã«äœ¿çšãããŸãã
-no_resync_search ããŒã«
ç¹å®ã®ãªãã·ã§ã³ã®éå§ã³ãŒããæ¢ããŠååæãè©Šã¿ãªãã§ãã ããã
é£çµ
ä»®æ³é£çµã¹ã¯ãªããããã«ããã¬ã¯ãµã
ãã®ããã«ããã¬ã¯ãµã¯ãããã¹ããã¡ã€ã«ãããã¡ã€ã«ãšãã®ä»ã®ãã£ã¬ã¯ãã£ãã®ãªã¹ããèªã¿åããããããããã«ããã¬ã¯ãµããŸã
ãŸãã§åœŒãã®ãã¹ãŠã®ãã±ãããäžç·ã«æ··ãåãããããã®ããã«ã次ã ã«ã
ãã¡ã€ã«ã®ã¿ã€ã ã¹ã¿ã³ãã¯ãæåã®ãã¡ã€ã«ã0ããå§ãŸãã次ã®åãã¡ã€ã«ãå§ãŸãããã«èª¿æŽãããŸãã
ãã¡ã€ã«ã¯åã®ãã¡ã€ã«ãçµäºãããšããããå§ãŸããŸãã ããã¯ã°ããŒãã«ã«è¡ãããåå ãšãªãå¯èœæ§ãããããšã«æ³šæããŠãã ãã
ãã¹ãŠã®ã¹ããªãŒã ã®é·ãããŸã£ããåãã§ãªãå Žåã¯ã®ã£ãããçºçããŸãã
ãã¹ãŠã®ãã¡ã€ã«ã¯åãã¹ããªãŒã ïŒåãã³ãŒããã¯ãåãã¿ã€ã ããŒã¹ãªã©ïŒãæã£ãŠããå¿ èŠããããŸãã
åãã¡ã€ã«ã®æéã¯ã次ã®ãã¡ã€ã«ã®ã¿ã€ã ã¹ã¿ã³ãã調æŽããããã«äœ¿çšãããŸãã
æéãæ£ãããªãïŒãããã¬ãŒãã䜿çšããŠèšç®ãããããããŸãã¯ãã¡ã€ã«ã
ããšãã°ãåãæšãŠãããå ŽåïŒãã¢ãŒãã£ãã¡ã¯ããçºçããå¯èœæ§ããããŸãã ãdurationããã£ã¬ã¯ãã£ãã¯ã
åãã¡ã€ã«ã«ä¿åãããŠããæéãäžæžãããŸãã
æ§æ
ã¹ã¯ãªããã¯æ¡åŒµASCIIã®ããã¹ããã¡ã€ã«ã§ãXNUMXè¡ã«XNUMXã€ã®ãã£ã¬ã¯ãã£ãããããŸãã 空ã®è¡ã
'ïŒ'ã§å§ãŸãå é ã®ã¹ããŒã¹ãšè¡ã¯ç¡èŠãããŸãã 次ã®ãã£ã¬ã¯ãã£ãã¯
èªèãããïŒ
"ãã¡ã€ã« path"
èªã¿åããã¡ã€ã«ãžã®ãã¹ã ç¹æ®æåãšã¹ããŒã¹ã¯åèšå·ã§ãšã¹ã±ãŒãããå¿ èŠããããŸã
ãŸãã¯äžéåŒçšç¬Šã
以éã®ãã¹ãŠã®ãã¡ã€ã«é¢é£ã®ãã£ã¬ã¯ãã£ãã¯ããã®ãã¡ã€ã«ã«é©çšãããŸãã
ãffconcat ããŒãžã§ã³ 1.0 "
ã¹ã¯ãªããã®çš®é¡ãšããŒãžã§ã³ãç¹å®ããŸãã ãŸãã å®å šãª ããå Žåã¯1ãžã®ãªãã·ã§ã³
ããã©ã«ãã¯-1ã§ãã
FFmpegã«ãã©ãŒããããèªåçã«èªèãããã«ã¯ããã®ãã£ã¬ã¯ãã£ããæ£ç¢ºã«è¡šç€ºãããå¿ èŠããããŸã
ã¹ã¯ãªããã®æåã®è¡ã«ãã®ãŸãŸïŒäœåãªã¹ããŒã¹ããã€ãé ããŒã¯ã¯ãããŸããïŒã
"éé DUR"
ãã¡ã€ã«ã®æéã ãã®æ å ±ã¯ãã¡ã€ã«ããæå®ã§ããŸãã ãããæå®ãã
ããã§ã¯ããã¡ã€ã«ã®æ å ±ãå©çšã§ããªãå Žåã«ãããå¹ççãŸãã¯åœ¹ç«ã€å ŽåããããŸã
ãŸãã¯æ£ç¢ºã
ãã¹ãŠã®ãã¡ã€ã«ã«æéãèšå®ãããŠããå Žåãå šäœãã·ãŒã¯ããããšãå¯èœã§ã
é£çµããããããªã
ãã€ã³ãã€ã³ã ã¿ã€ã ã¹ã¿ã³ã"
ãã¡ã€ã«ã®ãã€ã³ãã§ã ããã«ããã¬ã¯ãµããã¡ã€ã«ãéããšãå³åº§ã«
æå®ãããã¿ã€ã ã¹ã¿ã³ãã ãã¹ãŠã®ã¹ããªãŒã ãæ£åžžã«è¡šç€ºã§ããããã«ã·ãŒã¯ãè¡ãããŸã
ã€ã³ãã€ã³ãã§ã
ãã®ãã£ã¬ã¯ãã£ãã¯ããã¬ãŒã å ã³ãŒããã¯ã§ã¯æé©ã«æ©èœããŸããããã¯ããã¬ãŒã å ã³ãŒããã¯ã§ã¯ãªãããã§ãã
éåžžãå®éã®ã€ã³ãã€ã³ããšãã³ãŒããããã³ã³ãã³ãã®åã«è¿œå ã®ãã±ãããååŸããŸã
ã»ãšãã©ã®å Žåãã€ã³ãã€ã³ãã®åã«ããã¬ãŒã ãå«ãŸããŸãã
ãã¡ã€ã«ããšã«ããã¡ã€ã«ã€ã³ãã€ã³ãã®åã®ãã±ããã®ã¿ã€ã ã¹ã¿ã³ãã¯
ãã¡ã€ã«ã®èšç®ãããéå§ã¿ã€ã ã¹ã¿ã³ãïŒæåã®ãã¡ã€ã«ã®å Žåã¯è² ïŒãããã³
ãã¡ã€ã«ã®æéïŒãdurationããã£ã¬ã¯ãã£ãã§æå®ãããŠããªãå ŽåïŒãççž®ãããŸã
æå®ãããã€ã³ãã€ã³ãã«åºã¥ããŸãã
æå®ãããã€ã³ãã€ã³ãããåã®æœåšçãªãã±ããã®ããããã±ããã®ã¿ã€ã ã¹ã¿ã³ãã¯
XNUMXã€ã®é£çµããããã¡ã€ã«éã®éãªãã
ãã¢ãŠããã€ã³ã ã¿ã€ã ã¹ã¿ã³ã"
ãã¡ã€ã«ã®ã¢ãŠããã€ã³ãã ããã«ããã¬ã¯ãµãã§æå®ããããã³ãŒãã¿ã€ã ã¹ã¿ã³ãã«éãããšã
ã¹ããªãŒã ã®ãããããããã¯ãã¡ã€ã«ã®çµããã®ç¶æ ãšããŠãããåŠçããçŸåšã®ãã¹ãããããŸã
ãããŠããã¹ãŠã®ã¹ããªãŒã ããã®æ®ãã®ãã¹ãŠã®ãã±ããã
ã¢ãŠããã€ã³ãã¯æä»çã§ããã€ãŸããããã«ããã¬ã¯ãµã¯ãã±ãããåºåããŸããã
ã¢ãŠããã€ã³ã以äžã®ã¿ã€ã ã¹ã¿ã³ãããã³ãŒãããŸãã
ãã®ãã£ã¬ã¯ãã£ãã¯ããã¹ãŠã®ã¹ããªãŒã ãååšãããã¬ãŒã å ã³ãŒããã¯ããã³ãã©ãŒãããã§æé©ã«æ©èœããŸãã
ãã£ãããšã€ã³ã¿ãŒãªãŒããããŠããŸãã éã€ã³ãã©ãã¬ãŒã ã³ãŒããã¯ã®å Žåãéåžžã¯è¿œå ã®ã³ãŒããã¯ãååŸããŸã
ã¢ãŠããã€ã³ãã®åŸã«ãã¬ãŒã³ããŒã·ã§ã³ã¿ã€ã ã¹ã¿ã³ãããããã±ããããããã£ãŠãã³ãŒããããã³ã³ãã³ãã¯
ã»ãšãã©ã®å Žåãã¢ãŠããã€ã³ãã®åŸã«ãã¬ãŒã ãå«ãŸããŠããŸãã ã¹ããªãŒã ãã¿ã€ãã§ãªãå Žå
ã€ã³ã¿ãŒãªãŒããããå Žåãã¢ãŠããã€ã³ãã®åã«ãã¹ãŠã®ã¹ããªãŒã ãããã¹ãŠã®ãã±ãããååŸã§ããªãå ŽåããããŸãã
ã¢ãŠããã€ã³ããŸã§ãæãæ©ãã¹ããªãŒã ã®ã¿ããã³ãŒãã§ããå¯èœæ§ããããŸãã
ãã¡ã€ã«ã®æéïŒãdurationããã£ã¬ã¯ãã£ãã§æå®ãããŠããªãå ŽåïŒã¯æ¬¡ã®ããã«ãªããŸã
æå®ãããã¢ãŠããã€ã³ãã«åºã¥ããŠåæžãããŸãã
"file_packet_metadata key = value"
ãã¡ã€ã«ã®ãã±ããã®ã¡ã¿ããŒã¿ã æå®ããã¡ã¿ããŒã¿ããã¡ã€ã«ããšã«èšå®ãããŸã
ãã±ããã ãã®ãã£ã¬ã¯ãã£ããè€æ°åæå®ããŠãè€æ°ã®ã¡ã¿ããŒã¿ãè¿œå ã§ããŸã
ãšã³ããªãŒã
"ã¹ããªãŒã "
ä»®æ³ãã¡ã€ã«ã«ã¹ããªãŒã ãå°å ¥ããŸãã åŸç¶ã®ãã¹ãŠã®ã¹ããªãŒã é¢é£ã®ãã£ã¬ã¯ãã£ã
æåŸã«å°å ¥ãããã¹ããªãŒã ã«é©çšãããŸãã äžéšã®ã¹ããªãŒã ããããã£ã¯ã次ã®ããã«èšå®ããå¿ èŠããããŸã
ãµããã¡ã€ã«å ã®äžèŽããã¹ããªãŒã ãèå¥ã§ããããã«ããŸãã ã§ã¹ããªãŒã ãå®çŸ©ãããŠããªãå Žå
ã¹ã¯ãªããã§ã¯ãæåã®ãã¡ã€ã«ããã®ã¹ããªãŒã ãã³ããŒãããŸãã
"exact_stream_id id"
ã¹ããªãŒã ã®IDãèšå®ããŸãã ãã®ãã£ã¬ã¯ãã£ããæå®ãããŠããå Žåã
ãµããã¡ã€ã«å ã®å¯Ÿå¿ããIDã䜿çšãããŸãã ããã¯ãMPEG-PSã§ç¹ã«åœ¹ç«ã¡ãŸã
ïŒVOBïŒãã¡ã€ã«ãã¹ããªãŒã ã®é åºãä¿¡é Œã§ããŸããã
ãªãã·ã§ã³
ãã®ããã«ããã¬ã¯ãµã¯ã次ã®ãªãã·ã§ã³ãåãå ¥ããŸãã
å®å šãª
1ã«èšå®ãããšãå®å šã§ãªããã¡ã€ã«ãã¹ãæåŠããŸãã ããã§ãªãå Žåããã¡ã€ã«ãã¹ã¯å®å šã§ãããšèŠãªãããŸã
ãããã³ã«ä»æ§ãå«ã¿ãçžå¯Ÿçã§ããããã¹ãŠã®ã³ã³ããŒãã³ãã«ã¯ã®ã¿ãå«ãŸããŸã
ããŒã¿ãã«æåã»ããã®æåïŒæåãæ°åãããªãªããã¢ã³ããŒã¹ã³ã¢ãããã³
ãã€ãã³ïŒã§ãããã³ã³ããŒãã³ãã®å é ã«ããªãªãã¯ãããŸããã
0ã«èšå®ãããšãä»»æã®ãã¡ã€ã«åãåãå ¥ããããŸãã
ããã©ã«ãã¯-1ã§ããã©ãŒããããèªåçã«ãããŒããããå Žåã¯1ã«çžåœãã0ã«çžåœããŸãã
ãããªããšã
auto_convert
1ã«èšå®ãããŠããå Žåã¯ããã±ããããŒã¿ã«å¯ŸããŠèªåå€æãå®è¡ããŠã¹ããªãŒã ãäœæããŠã¿ãŠãã ãã
é£çµå¯èœã ããã©ã«ãã¯1ã§ãã
çŸåšãå¯äžã®å€æã¯ãh264_mp4toannexbãããã¹ããªãŒã ãã£ã«ã¿ãŒãã«è¿œå ããããšã§ãã
MP264圢åŒã®H.4ã¹ããªãŒã ã ããã¯ç¹ã«è§£æ±ºçãããå Žåã«å¿ èŠã§ã
å€æŽã
FLV
Adobe Flash VideoFormatããã«ããã¬ã¯ãµã
ãã®ããã«ããã¬ã¯ãµã¯ãFLVãã¡ã€ã«ãšRTMPãããã¯ãŒã¯ã¹ããªãŒã ãããã«ããã¬ã¯ãµããããã«äœ¿çšãããŸãã
-flv_ã¡ã¿ããŒã¿ ããŒã«
onMetaDataé åã®å 容ã«åŸã£ãŠã¹ããªãŒã ãå²ãåœãŠãŸãã
libgme
Game Music Emuã©ã€ãã©ãªã¯ããããªã²ãŒã é³æ¥œãã¡ã€ã«ãšãã¥ã¬ãŒã¿ã®ã³ã¬ã¯ã·ã§ã³ã§ãã
èŠãhttp://code.google.com/p/game-music-emu/>詳现ã«ã€ããŠã¯ã
äžéšã®ãã¡ã€ã«ã«ã¯è€æ°ã®ãã©ãã¯ããããŸãã ããã«ããã¬ã¯ãµã¯ãããã©ã«ãã§æåã®ãã©ãã¯ãéžæããŸãã NS
ãã©ãã¯ã€ã³ããã¯ã¹ ãªãã·ã§ã³ã䜿çšããŠãå¥ã®ãã©ãã¯ãéžæã§ããŸãã ãã©ãã¯ã€ã³ããã¯ã¹ã¯0ããå§ãŸããŸãã
demuxerã¯ãã©ãã¯æ°ã次ã®ããã«ãšã¯ã¹ããŒãããŸã ãã©ã㯠ã¡ã¿ããŒã¿ãšã³ããªã
éåžžã«å€§ããªãã¡ã€ã«ã®å Žåã æ倧ãµã€ãº ãªãã·ã§ã³ã調æŽããå¿ èŠãããå ŽåããããŸãã
ãªãã¯ãŽã£
quviãããžã§ã¯ãã䜿çšããŠã€ã³ã¿ãŒããããµãŒãã¹ããã¡ãã£ã¢ãåçããŸãã
ããã«ããã¬ã¯ãµã¯ã 圢åŒã§ã¢ãŒã«ã€ããããããžã§ã¯ããä¿åããŸãïŒ ç¹å®ã®å質ãèŠæ±ãããªãã·ã§ã³ã ããã©ã«ãã§ã¯ã«èšå®ãããŠããŸã
æè¯.
èŠãhttp://quvi.sourceforge.net/>詳现ã«ã€ããŠã¯ã
ãã®ããã«ããã¬ã¯ãµãæå¹ã«ããã«ã¯ãFFmpegãã--enable-libquviãã§ãã«ãããå¿ èŠããããŸãã
GIF
ã¢ãã¡ãŒã·ã§ã³GIFããã«ããã¬ã¯ãµã
次ã®ãªãã·ã§ã³ãåãå ¥ããŸãã
min_delay
ãã¬ãŒã éã®æå°æå¹é 延ã0åã®XNUMXç§åäœã§èšå®ããŸãã ç¯å²ã¯XNUMXã
6000ãããã©ã«ãå€ã¯2ã§ãã
max_gif_é 延
ãã¬ãŒã éã®æ倧æå¹é 延ã0åã®XNUMXç§åäœã§èšå®ããŸãã ç¯å²ã¯XNUMXã
65535ãããã©ã«ãå€ã¯65535ïŒçŽXNUMXåïŒã§ãèš±å¯ãããæ倧å€ã¯
ä»æ§ã
ããã©ã«ã_é 延
ãã¬ãŒã éã®ããã©ã«ãã®é 延ã0åã®6000ç§åäœã§èšå®ããŸãã ç¯å²ã¯XNUMXãXNUMXã§ãã
ããã©ã«ãå€ã¯10ã§ãã
ç¡èŠã«ãŒã
GIFãã¡ã€ã«ã«ã¯ãç¹å®ã®åæ°ïŒãŸãã¯ç¡éã«ïŒã«ãŒãããæ å ±ãå«ããããšãã§ããŸãã
If ç¡èŠã«ãŒã ã1ã«èšå®ãããŠããå Žåãå ¥åããã®ã«ãŒãèšå®ã¯ç¡èŠããã
ã«ãŒãã¯çºçããŸããã 0ã«èšå®ãããšãã«ãŒããçºçããçªå·ã埪ç°ããŸã
GIFã«ãããšäœåºŠãã ããã©ã«ãå€ã¯1ã§ãã
ããšãã°ããªãŒããŒã¬ã€ãã£ã«ã¿ã䜿çšããŠãç¡éã«ã«ãŒãããGIFãå¥ã®ãããªã®äžã«é 眮ããŸãã
ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay = shortest = 1 out.mkv
äžèšã®äŸã§ã¯ããªãŒããŒã¬ã€ãã£ã«ã¿ãŒã®æçãªãã·ã§ã³ã䜿çšããŠ
æçã®å ¥åãã¡ã€ã«ã®é·ãã§ãããªãåºåããŸãããã®å Žåã¯ã å ¥å.mp4 as
ãã®äŸã®GIFã¯ç¡éã«ã«ãŒãããŸãã
image2
ç»åãã¡ã€ã«ã®ããã«ããã¬ã¯ãµã
ãã®ããã«ããã¬ã¯ãµã¯ããã¿ãŒã³ã§æå®ãããç»åãã¡ã€ã«ã®ãªã¹ãããèªã¿åããŸãã æ§æãš
ãã¿ãŒã³ã®æå³ã¯ãªãã·ã§ã³ã§æå®ãããŸã ãã¿ãŒã³ã¿ã€ã.
ãã¿ãŒã³ã«ã¯ã次ã®åœ¢åŒãèªåçã«å€å¥ããããã«äœ¿çšãããæ¥å°ŸèŸãå«ãŸããå ŽåããããŸãã
ãã¡ã€ã«ã«å«ãŸããç»åã
ãµã€ãºããã¯ã»ã«åœ¢åŒãããã³åç»åã®åœ¢åŒã¯ããã¹ãŠã®ç»åã§åãã§ããå¿ èŠããããŸãã
ã·ãŒã±ã³ã¹å ã®ãã¡ã€ã«ã
ãã®ããã«ããã¬ã¯ãµã¯ã次ã®ãªãã·ã§ã³ãåãå ¥ããŸãã
ãã¬ãŒã ã¬ãŒã
ãããªã¹ããªãŒã ã®ãã¬ãŒã ã¬ãŒããèšå®ããŸãã ããã©ã«ãã¯25ã§ãã
ã«ãŒã
1ã«èšå®ãããšãå ¥åãã«ãŒãããŸãã ããã©ã«ãå€ã¯0ã§ãã
ãã¿ãŒã³ã¿ã€ã
æäŸããããã¡ã€ã«åã®è§£éã«äœ¿çšããããã¿ãŒã³ã¿ã€ããéžæããŸãã
ãã¿ãŒã³ã¿ã€ã 次ã®ããããã®å€ãåãå ¥ããŸãã
ãªã
ãã¿ãŒã³ãããã³ã°ãç¡å¹ã«ããããããããªã«ã¯æå®ããããã®ã®ã¿ãå«ãŸããŸã
ç»åã ããã·ãŒã±ã³ã¹ãäœæããããªãå Žåã¯ããã®ãªãã·ã§ã³ã䜿çšããå¿ èŠããããŸã
è€æ°ã®ç»åãšãã¡ã€ã«åã«ç¹æ®ãªãã¿ãŒã³æåãå«ãŸããŠããå ŽåããããŸãã
ã·ãŒã±ã³ã¹
ã·ãŒã±ã³ã¹ãã¿ãŒã³ã¿ã€ããéžæããŸããããã¯ãã«ãã£ãŠã€ã³ããã¯ã¹ãä»ãããããã¡ã€ã«ã®ã·ãŒã±ã³ã¹ãæå®ããããã«äœ¿çšãããŸãã
é£çªã
ã·ãŒã±ã³ã¹ãã¿ãŒã³ã«ã¯ãæååãïŒ dããŸãã¯ãïŒ 0ããå«ããããšãã§ããŸãNd "ãããã¯
åãã¡ã€ã«åã®é£çªãè¡šãæåã®äœçœ®
ãã¿ãŒã³ã«äžèŽããŸãã ãã©ãŒã ããïŒ d0ãã®å ŽåNd "ã䜿çšãããæååã¯
åãã¡ã€ã«åã®æ°åã¯0ã§åãããã N 0ãåã蟌ãŸããæ¡ã®ç·æ°ã§ã
æ°ãè¡šããŸãã ãªãã©ã«æå 'ïŒ 'ããã¿ãŒã³ã§æå®ã§ããŸã
æååã%%ãã䜿çšããŸãã
ã·ãŒã±ã³ã¹ãã¿ãŒã³ã«ãïŒ dããŸãã¯ãïŒ 0ããå«ãŸããŠããå ŽåNd "ããã¡ã€ã«ã®æåã®ãã¡ã€ã«å
ãã¿ãŒã³ã§æå®ããããªã¹ãã«ã¯ãéã«å«ãŸããæ°å€ãå«ãŸããŠããå¿ èŠããããŸã
éå§çªå· ãš éå§çªå·+éå§çªå·ç¯å²-1ãããã³ä»¥äžã®ãã¹ãŠã®çªå·
ã·ãŒã±ã³ã·ã£ã«ã§ããå¿ èŠããããŸãã
ããšãã°ããã¿ãŒã³ãimg-ïŒ 03d.bmpãã¯ã
ãã©ãŒã img-001.bmp, img-002.bmpâŠâŠã img-010.bmpã NSã; ãã¿ãŒã³
"i %% m %% g-ïŒ d.jpg" Loading = "lazy"ã¯ããã©ãŒã ã®ãã¡ã€ã«åã®ã·ãŒã±ã³ã¹ãšäžèŽããŸã iïŒ mïŒ g-1.jpg,
iïŒ mïŒ g-2.jpgâŠâŠã iïŒ mïŒ g-10.jpg, etc.
ãã¿ãŒã³ã«ã¯å¿ ããããïŒ dããŸãã¯ãïŒ 0ããå«ãŸããŠããå¿ èŠã¯ãªãããšã«æ³šæããŠãã ããNd "ãäŸãã°
åäžã®ç»åãã¡ã€ã«ãå€æãã img.jpeg 次ã®ã³ãã³ãã䜿çšã§ããŸãã
ffmpeg -i img.jpeg img.png
å°ç
ã°ããã¯ã€ã«ãã«ãŒããã¿ãŒã³ã¿ã€ããéžæããŸãã
ãã®ãã¿ãŒã³ã¯ãglobïŒïŒããã¿ãŒã³ã®ããã«è§£éãããŸãã ããã¯ã次ã®å Žåã«ã®ã¿éžæã§ããŸã
libavformatã¯globbingããµããŒãããŠã³ã³ãã€ã«ãããŸããã
ã°ããã·ãŒã±ã³ã¹ ïŒéæšå¥šã æå¿ be é€å»ãããïŒ
æ··åã°ããã¯ã€ã«ãã«ãŒã/ã·ãŒã±ã³ã¹ãã¿ãŒã³ãéžæããŸãã
ã䜿çšã®ããŒãžã§ã³ã®libavformatãglobbingãµããŒãã䜿çšããŠã³ã³ãã€ã«ãããŠããå Žåãããã³
æå®ããããã¿ãŒã³ã«ã¯ããïŒ *ïŒ[] {}ãã®äžã«å°ãªããšãXNUMXã€ã®ã°ããã¡ã¿æåãå«ãŸããŠããŸãã
ãšã¹ã±ãŒããããŠããªããïŒ ããåã«ä»ããŠããå Žåããã¿ãŒã³ã¯ãglobïŒïŒããã¿ãŒã³ã®ããã«è§£éãããŸãã
ãã以å€ã®å Žåã¯ãã·ãŒã±ã³ã¹ãã¿ãŒã³ã®ããã«è§£éãããŸãã
ãã¹ãŠã®ã°ããç¹æ®æåãïŒ *ïŒ[] {}ãã®åã«ãïŒ ããä»ããå¿ èŠããããŸãã è±åºããã«ã¯
æåéãã®ãïŒ ãã¯ã%%ãã䜿çšããŸãã
ããšãã°ããã¿ãŒã³ãfoo-ïŒ *ãjpegãã¯ãæ¥é èŸãä»ãããã¹ãŠã®ãã¡ã€ã«åãšäžèŽããŸã
ãfoo-ãã§ã.jpegãã§çµäºãããfoo-ïŒ ïŒïŒ ïŒïŒ ïŒã jpegãã¯ãã¹ãŠã®
ãfoo-ãã§å§ãŸãããã®åŸã«XNUMXæåã®ã·ãŒã±ã³ã¹ãç¶ããã¡ã€ã«åãããã³
ã.jpegãã§çµäºããŸãã
ãã®ãã¿ãŒã³ã¿ã€ãã¯å»æ¢ããã å°ç ãš ã·ãŒã±ã³ã¹.
ããã©ã«ãå€ã¯ ã°ããã·ãŒã±ã³ã¹.
ãã¯ã»ã«åœ¢åŒ
èªã¿åãç»åã®ãã¯ã»ã«åœ¢åŒãèšå®ããŸãã æå®ãããŠããªãå Žåããã¯ã»ã«åœ¢åŒã¯
ã·ãŒã±ã³ã¹ã®æåã®ç»åãã¡ã€ã«ããæšæž¬ãããŸãã
éå§çªå·
èªã¿åããéå§ããç»åãã¡ã€ã«ãã¿ãŒã³ã«äžèŽãããã¡ã€ã«ã®ã€ã³ããã¯ã¹ãèšå®ããŸãã
ããã©ã«ãå€ã¯0ã§ãã
éå§çªå·ç¯å²
ã§æåã®ç»åãã¡ã€ã«ãæ¢ããšãã«ãã§ãã¯ããã€ã³ããã¯ã¹ééã®ç¯å²ãèšå®ããŸã
ããå§ãŸãã·ãŒã±ã³ã¹ éå§çªå·ã ããã©ã«ãå€ã¯5ã§ãã
ts_from_file
1ã«èšå®ãããšããã¬ãŒã ã®ã¿ã€ã ã¹ã¿ã³ããç»åãã¡ã€ã«ã®å€æŽæå»ã«èšå®ãããŸãã ãäºæ¿ãã ãã
ã¿ã€ã ã¹ã¿ã³ãã®å調æ§ã¯æäŸãããŸããïŒç»åã¯ããããªãå Žåãšåãé åºã«ãªããŸã
ãªãã·ã§ã³ã ããã©ã«ãå€ã¯0ã§ãã2ã«èšå®ãããšããã¬ãŒã ã®ã¿ã€ã ã¹ã¿ã³ããå€æŽã«èšå®ãããŸã
ããç§ã®ç²ŸåºŠã§ã®ç»åãã¡ã€ã«ã®æéã
ãããªãµã€ãº
èªã¿åãç»åã®ãããªãµã€ãºãèšå®ããŸãã æå®ãããŠããªãå Žåããããªãµã€ãºãæšæž¬ãããŸã
ã·ãŒã±ã³ã¹ã®æåã®ç»åãã¡ã€ã«ããã
äŸ
㻠䜿çšãã ffmpeg ãã¡ã€ã«ã·ãŒã±ã³ã¹å ã®ç»åãããããªãäœæãããã img-001.jpeg,
img-002.jpegã...ã10ç§ãããXNUMXãã¬ãŒã ã®å ¥åãã¬ãŒã ã¬ãŒããæ³å®ïŒ
ffmpeg -framerate 10 -i'img-ïŒ 03d.jpeg 'out.mkv
ã»äžèšãšåãã§ããã次ã®é åºã§ã€ã³ããã¯ã¹100ã®ãã¡ã€ã«ããèªã¿åãããšããå§ããŸãã
ffmpeg -framerate 10 -start_number 100 -i'img-ïŒ 03d.jpeg 'out.mkv
ã»ã*ãpngãloading = "lazy"ã°ãããã¿ãŒã³ã«äžèŽããç»åãèªã¿åããŸããããã¯ãã§çµäºãããã¹ãŠã®ãã¡ã€ã«ã§ãã
ã.pngãloading = "lazy"ãµãã£ãã¯ã¹ïŒ
ffmpeg -framerate 10 -pattern_type glob -i "* .png" Loading = "lazy" out.mkv
mov / mp4 / 3gp / Quicktme
Quicktime / MP4ããã«ããã¬ã¯ãµã
ãã®ããã«ããã¬ã¯ãµã¯ã次ã®ãªãã·ã§ã³ãåãå ¥ããŸãã
æå¹å_drefs
å€éšãã©ãã¯ã®ããŒããæå¹ã«ããŸããããã©ã«ãã§ã¯ç¡å¹ã«ãªã£ãŠããŸãã ãããæå¹ã«ãããš
çè«çã«ã¯ãäžéšã®ãŠãŒã¹ã±ãŒã¹ã§æ å ±ãæŒæŽ©ããŸãã
use_absolute_path
絶察ãã¹ãä»ããå€éšãã©ãã¯ã®ããŒããèš±å¯ããŸããããã©ã«ãã§ã¯ç¡å¹ã«ãªã£ãŠããŸãã æå¹å
ããã¯ã»ãã¥ãªãã£ãªã¹ã¯ããããããŸãã ãœãŒã¹ãéã§ããããšãããã£ãŠããå Žåã«ã®ã¿æå¹ã«ããå¿ èŠããããŸã
æªæã®ããã
mpegt
MPEG-2ãã©ã³ã¹ããŒãã¹ããªãŒã ããã«ããã¬ã¯ãµã
ãã®ããã«ããã¬ã¯ãµã¯ã次ã®ãªãã·ã§ã³ãåãå ¥ããŸãã
ååæãµã€ãº
æ°ããåæãæ€çŽ¢ããããã®ãµã€ãºå¶éãèšå®ããŸãã ããã©ã«ãå€ã¯65536ã§ãã
fix_teletext_pts
æåæŸéãã±ããã®PTSããã³DTSå€ããããèšç®ãããã¿ã€ã ã¹ã¿ã³ãã§äžæžãããŸãã
æåæŸéã¹ããªãŒã ãå«ãŸããç Žæ£ãããªãæåã®ããã°ã©ã ã®PCRã
ããã©ã«ãå€ã¯1ã§ãããã¬ããã¹ããã±ããPTSããã³DTSãå¿ èŠãªå Žåã¯ããã®ãªãã·ã§ã³ã0ã«èšå®ããŸãã
æã€ããã®å€ã
ts_packetsize
çã®ãã±ãããµã€ãºããã€ãåäœã§äŒéããåºåãªãã·ã§ã³ã æ€åºãããçã®ãã±ããã衚瀺ãã
ãµã€ãºããŠãŒã¶ãŒãèšå®ããããšã¯ã§ããŸããã
scan_all_pmts
ãã¹ãŠã®PMTãã¹ãã£ã³ããŠçµåããŸãã å€ã¯-1ãã1ãŸã§ã®å€ã®æŽæ°ã§ãïŒ-1ã¯
èªåèšå®ã1ã¯æå¹ã0ã¯ç¡å¹ãæå³ããŸãïŒã ããã©ã«ãå€ã¯-1ã§ãã
çãããª
çã®ãããªããã«ããã¬ã¯ãµã
ãã®ããã«ããã¬ã¯ãµã䜿çšãããšãçã®ãããªããŒã¿ãèªã¿åãããšãã§ããŸãã ãæå®ããããããŒããªããã
æ³å®ããããããªãã©ã¡ãŒã¿ã®å ŽåããŠãŒã¶ãŒã¯ãããããã³ãŒãã§ããããã«ããããã«ããããæå®ããå¿ èŠããããŸã
ããŒã¿ãæ£ããã
ãã®ããã«ããã¬ã¯ãµã¯ã次ã®ãªãã·ã§ã³ãåãå ¥ããŸãã
ãã¬ãŒã ã¬ãŒã
å ¥åãããªã®ãã¬ãŒã ã¬ãŒããèšå®ããŸãã ããã©ã«ãå€ã¯25ã§ãã
ãã¯ã»ã«åœ¢åŒ
å ¥åãããªã®ãã¯ã»ã«ãã©ãŒããããèšå®ããŸãã ããã©ã«ãå€ã¯ãyuv420pãã§ãã
ãããªãµã€ãº
å ¥åãããªãµã€ãºãèšå®ããŸãã ãã®å€ã¯æ瀺çã«æå®ããå¿ èŠããããŸãã
ããšãã°ãrawvideoãã¡ã€ã«ãèªã¿åãã«ã¯ å ¥å.ç ã åçãããã®ãã¯ã»ã«ãã©ãŒããããæ³å®
ãrgb24ããã320x240ãã®ãããªãµã€ãºãããã³10ç§ãããXNUMXç»åã®ãã¬ãŒã ã¬ãŒãã䜿çšããã«ã¯ã
ã³ãã³ãïŒ
ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
SBG
SBaGenã¹ã¯ãªããããã«ããã¬ã¯ãµã
ãã®ããã«ããã¬ã¯ãµã¯ãSBaGenã§äœ¿çšãããã¹ã¯ãªããèšèªãèªã¿åããŸãhttp://uazu.net/sbagen/>ãž
ãã€ããŒã©ã«ããŒãã»ãã·ã§ã³ãçæããŸãã SBGã¹ã¯ãªããã¯æ¬¡ã®ããã«ãªããŸãã
-SE
a: 300-2.5/3 440+4.5/0
b: 300-2.5/0 440+4.5/3
ãªãïŒ -
ä»==
+0ïŒ07ïŒ00 == b
+0ïŒ14ïŒ00 == a
+0ïŒ21ïŒ00 == b
+0ïŒ30ïŒ00ãªã
SBGã¹ã¯ãªããã¯ã絶察ã¿ã€ã ã¹ã¿ã³ããšçžå¯Ÿã¿ã€ã ã¹ã¿ã³ããæ··åšãããããšãã§ããŸãã ã¹ã¯ãªãããããããã®ã¿ã䜿çšããå Žå
絶察ã¿ã€ã ã¹ã¿ã³ãïŒã¹ã¯ãªããã®éå§æå»ãå«ãïŒãŸãã¯çžå¯Ÿã¿ã€ã ã¹ã¿ã³ãã®ã¿ããã®åŸ
ã¬ã€ã¢ãŠãã¯åºå®ãããŠãããå€æã¯ç°¡åã§ãã äžæ¹ãã¹ã¯ãªããã®å Žå
äž¡æ¹ã®çš®é¡ã®ã¿ã€ã ã¹ã¿ã³ããæ··åãã次㫠çŸåš çžå¯Ÿã¿ã€ã ã¹ã¿ã³ãã®åç §ã¯æ¬¡ã®ããã«ãªããŸã
ã¹ã¯ãªãããèªã¿åãããçŸåšã®æå»ãšã¹ã¯ãªããã®ã¬ã€ã¢ãŠãããååŸ
ãã®åç §ã«åŸã£ãŠåçµãããŸãã ã€ãŸããã¹ã¯ãªãããçŽæ¥ã§ããå Žå
åçãããšãå®éã®æéã¯ãµãŠã³ãã³ã³ãããŒã©ãŒã®çµ¶å¯Ÿã¿ã€ã ã¹ã¿ã³ããŸã§äžèŽããŸã
æèšã®ç²ŸåºŠã§ããããŠãŒã¶ãŒãäœããã®çç±ã§åçãäžæåæ¢ãããã·ãŒã¯ããããããšãåžžã«
ããã«å¿ããŠã·ããããŸããã
åå¹
ã«äœ¿çšãããJSONãã£ãã·ã§ã³http://www.ted.com/>.
TEDã¯ãã£ãã·ã§ã³ãžã®ãªã³ã¯ãæäŸããŠããŸããããããŒãžããæšæž¬ã§ããŸãã NS
file tools / bookmarklets.html FFmpegãœãŒã¹ããªãŒããå ¬éããããã¯ããŒã¯ã¬ãããå«ãŸããŠããŸã
ãããã
ãã®ããã«ããã¬ã¯ãµã¯ã次ã®ãªãã·ã§ã³ãåãå ¥ããŸãã
å§ãŸãæé
TEDããŒã¯ã®éå§æéãããªç§åäœã§èšå®ããŸãã ããã©ã«ãã¯15000ïŒ15ç§ïŒã§ãã ã§ã
15ç§ãå«ãŸããŠããããããã£ãã·ã§ã³ãããŠã³ããŒãå¯èœãªãããªãšåæããããã«äœ¿çšãããŸã
ã€ã³ããã
äŸïŒãã£ãã·ã§ã³ãã»ãšãã©ã®ãã¬ãŒã€ãŒãç解ã§ãã圢åŒã«å€æããŸãã
ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-ja.srt
ãã«ããã¬ã¯ãµ
ãã«ããã¬ã¯ãµã¯FFmpegã§æ§æãããèŠçŽ ã§ããããã«ãã¡ãã£ã¢ã¹ããªãŒã ã
ç¹å®ã®çš®é¡ã®ãã¡ã€ã«ã
FFmpegãã«ããèšå®ãããšããµããŒããããŠãããã¹ãŠã®ãã«ããã¬ã¯ãµãããã©ã«ãã§æå¹ã«ãªããŸãã åã¯
æ§æãªãã·ã§ã³ã--list-muxersãã䜿çšããŠã䜿çšå¯èœãªãã¹ãŠã®ãã«ããã¬ã¯ãµãäžèŠ§è¡šç€ºã§ããŸãã
æ§æãªãã·ã§ã³ã--disable-muxersãã䜿çšããŠãã¹ãŠã®ãã«ããã¬ã¯ãµãç¡å¹ã«ã§ããŸãã
ãªãã·ã§ã³ "--enable-muxer =ã䜿çšããŠãåäžã®ãã«ããã¬ã¯ãµãéžæçã«æå¹/ç¡å¹ã«ããŸãããã¥ã¯ãµãŒã /
"--disable-muxer =ãã¥ã¯ãµãŒã.
ff *ããŒã«ã®ãªãã·ã§ã³ã-formatsãã¯ãæå¹ãªãã«ããã¬ã¯ãµã®ãªã¹ãã衚瀺ããŸãã
çŸåšå©çšå¯èœãªããã€ãã®ãã«ããã¬ã¯ãµã®èª¬æã¯æ¬¡ã®ãšããã§ãã
ãšã
ãªãŒãã£ãªã€ã³ã¿ãŒãã§ã³ãžãã¡ã€ã«åœ¢åŒãã«ããã¬ã¯ãµã
ãªãã·ã§ã³
次ã®ãªãã·ã§ã³ãåãå ¥ããŸãã
write_id3v2
3ã«èšå®ãããšãID2v1ã¿ã°ã®æžã蟌ã¿ãæå¹ã«ãªããŸããããã©ã«ãã¯0ïŒç¡å¹ïŒã§ãã
id3v2_ããŒãžã§ã³
æžã蟌ãID3v2ããŒãžã§ã³ãéžæããŸãã çŸåšãããŒãžã§ã³3ããã³4ã®ã¿ïŒå¥åID3v2.3ããã³
ID3v2.4ïŒããµããŒããããŠããŸãã ããã©ã«ãã¯ããŒãžã§ã³4ã§ãã
CRM
CRCïŒå·¡ååé·æ€æ»ïŒãã¹ã圢åŒã
ãã®ãã«ããã¬ã¯ãµã¯ããã¹ãŠã®å ¥åãªãŒãã£ãªããã³ãããªãã¬ãŒã ã®Adler-32CRCãèšç®ããŠå°å·ããŸãã
ããã©ã«ãã§ã¯ããªãŒãã£ãªãã¬ãŒã ã¯çœ²åããã16ãããã®rawãªãŒãã£ãªããã³ãããªãã¬ãŒã ã«å€æãããŸãã
CRCãèšç®ããåã®ãããªã
ãã«ããã¬ã¯ãµã®åºåã¯ãCRC = 0xã®åœ¢åŒã®åäžè¡ã§æ§æãããŸããCRCããã§ã CRC ã
ãã³ãŒãããããã¹ãŠã®å ¥åã®CRCãå«ã0æ¡ã«8ãåã蟌ãŸããXNUMXé²æ°
ãã¬ãŒã ã
åç §ããŠãã ãã ãã¬ãŒã CRC ãã«ããã¬ã¯ãµã
äŸ
ããšãã°ãå ¥åã®CRCãèšç®ããããããã¡ã€ã«ã«ä¿åããã«ã¯ out.crc:
ffmpeg -i INPUT -f crc out.crc
次ã®ã³ãã³ãã䜿çšããŠãCRCãstdoutã«åºåã§ããŸãã
ffmpeg -i INPUT -f crc-
åãã¬ãŒã ã®åºå圢åŒã¯ã次ã®ã³ãã³ãã§éžæã§ããŸãã ffmpeg é³å£°ãæå®ããŠ
ãããªã³ãŒããã¯ãšãã©ãŒãããã ããšãã°ãPCMã«å€æãããå ¥åãªãŒãã£ãªã®CRCãèšç®ããã«ã¯
笊å·ãªã8ãããããã³å ¥åãããªãMPEG-2ãããªã«å€æããã«ã¯ã次ã®ã³ãã³ãã䜿çšããŸãã
ffmpeg -i INPUT -cïŒa pcm_u8 -cïŒv mpeg2video -f crc-
ãã¬ãŒã CRC
ãã±ããããšã®CRCïŒCyclic Redundancy CheckïŒãã¹ã圢åŒã
ãã®ãã«ããã¬ã¯ãµã¯ããªãŒãã£ãªããã³ãããªãã±ããããšã«Adler-32CRCãèšç®ããŠåºåããŸãã ã«
ããã©ã«ãã®ãªãŒãã£ãªãã¬ãŒã ã¯ã眲åããã16ãããã®rawãªãŒãã£ãªããã³ãããªãã¬ãŒã ã«å€æãããŸãã
CRCãèšç®ããåã®ãããªã
ãã«ããã¬ã¯ãµã®åºåã¯ã次ã®åœ¢åŒã®åãªãŒãã£ãªããã³ãããªãã±ããã®è¡ã§æ§æãããŸãã
ã ã ã ã ã0x
CRC ãã±ããã®CRCãå«ã0æ¡ã«8ãåã蟌ãŸããXNUMXé²æ°ã§ãã
äŸ
ããšãã°ããªãŒãã£ãªããã³ãããªãã¬ãŒã ã®CRCãèšç®ããã«ã¯ å ¥åãçã«å€æ
ãªãŒãã£ãªãã±ãããšãããªãã±ããããã¡ã€ã«ã«ä¿åããŸã out.crc:
ffmpeg -i INPUT -f Framecrc out.crc
æ å ±ãstdoutã«åºåããã«ã¯ã次ã®ã³ãã³ãã䜿çšããŸãã
ffmpeg -i INPUT -f framecrc-
é£çµ¡å ffmpegããªãŒãã£ãªããã³ãããªãã¬ãŒã ã®åºå圢åŒãéžæã§ããŸã
ãªãŒãã£ãªããã³ãããªã³ãŒããã¯ãæå®ããããšã«ãããåãã±ããã®CRCãèšç®ããåã«ãšã³ã³ãŒããããŸãã
ããšãã°ãPCMã«å€æããããã³ãŒããããåå ¥åãªãŒãã£ãªãã¬ãŒã ã®CRCãèšç®ããã«ã¯
笊å·ãªã8ãããããã³MPEG-2ãããªã«å€æããããã³ãŒããããåå ¥åãããªãã¬ãŒã ã®ã
ã³ãã³ãïŒ
ffmpeg -i INPUT -cïŒa pcm_u8 -cïŒv mpeg2video -f framecrc-
åç §ããŠãã ãã CRM ãã«ããã¬ã¯ãµã
ãã¬ãŒã md5
ãã±ããããšã®MD5ãã¹ã圢åŒã
ãã®ãã«ããã¬ã¯ãµã¯ããªãŒãã£ãªããã³ãããªãã±ããããšã«MD5ããã·ã¥ãèšç®ããŠåºåããŸãã ããã©ã«ãã§ã¯
ãªãŒãã£ãªãã¬ãŒã ã¯ã眲åããã16ãããã®rawãªãŒãã£ãªããã³ãããªãã¬ãŒã ããrawãããªã«å€æãããŸãã
ããã·ã¥ãèšç®ããŸãã
ãã«ããã¬ã¯ãµã®åºåã¯ã次ã®åœ¢åŒã®åãªãŒãã£ãªããã³ãããªãã±ããã®è¡ã§æ§æãããŸãã
ã ã ã ã ã
MD5 ãã±ããã®èšç®ãããMD5ããã·ã¥ãè¡šãXNUMXé²æ°ã§ãã
äŸ
ããšãã°ããªãŒãã£ãªããã³ãããªãã¬ãŒã ã®MD5ãèšç®ããã«ã¯ å ¥åãçã«å€æ
ãªãŒãã£ãªãã±ãããšãããªãã±ããããã¡ã€ã«ã«ä¿åããŸã ã¢ãŠã.md5:
ffmpeg -i INPUT -f Framemd5 out.md5
æ å ±ãstdoutã«åºåããã«ã¯ã次ã®ã³ãã³ãã䜿çšããŸãã
ffmpeg -i INPUT -f framemd5-
åç §ããŠãã ãã md5 ãã«ããã¬ã¯ãµã
GIF
ã¢ãã¡ãŒã·ã§ã³GIFãã«ããã¬ã¯ãµã
次ã®ãªãã·ã§ã³ãåãå ¥ããŸãã
ã«ãŒã
åºåãã«ãŒãããåæ°ãèšå®ããŸãã ã«ãŒããªãã®å Žåã¯ã-1ãã䜿çšããã«ãŒãã®å Žåã¯0ã䜿çšããŸã
ç¡æéïŒããã©ã«ãïŒã
æçµé 延
æåŸã®ãã¬ãŒã ã®åŸã«é 延ïŒã»ã³ãç§ã§è¡šãããïŒã匷å¶ããŸãã åãã¬ãŒã ã¯ã§çµãããŸã
次ã®ãã¬ãŒã ãŸã§ã®é 延ã ããã©ã«ãã¯ã-1ãã§ããããã¯ãäŒããããã®ç¹å¥ãªå€ã§ãã
åã®é 延ãåå©çšããããã®ãã«ããã¬ã¯ãµã ã«ãŒãã®å Žåã¯ãã«ã¹ã¿ãã€ãºããããšããå§ãããŸã
ãã®å€ã¯ãããšãã°äžæåæ¢ãããŒã¯ããŸãã
ããšãã°ãã«ãŒãéã«10ç§ã®é 延ãèšå®ããŠãgifã«ãŒãã5åãšã³ã³ãŒãããã«ã¯ã次ã®ããã«ããŸãã
ffmpeg -i INPUT -loop 10 -final_lay 500 out.gif
泚1ïŒãã¬ãŒã ãå¥ã ã®GIFãã¡ã€ã«ã«æœåºããå Žåã¯ã匷å¶çã«
image2 ãã«ããã¬ã¯ãµïŒ
ffmpeg -i INPUT -cïŒv gif -f image2 "outïŒ d.gif"
泚2ïŒGIF圢åŒã®ã¿ã€ã ããŒã¹ã¯éåžžã«å°ãããããXNUMXã€ã®ãã¬ãŒã éã®é 延ã¯
XNUMXã»ã³ãç§æªæºã
hls
HTTPã©ã€ãã¹ããªãŒãã³ã°ã«åŸã£ãŠMPEG-TSãã»ã°ã¡ã³ãåããAppleHTTPã©ã€ãã¹ããªãŒãã³ã°ãã«ããã¬ã¯ãµ
ïŒHLSïŒä»æ§ã
ãã¬ã€ãªã¹ããã¡ã€ã«ãšXNUMXã€ä»¥äžã®ã»ã°ã¡ã³ããã¡ã€ã«ãäœæããŸãã åºåãã¡ã€ã«åã¯æ¬¡ã®ããã«æå®ããŸã
ãã¬ã€ãªã¹ãã®ãã¡ã€ã«åã
ããã©ã«ãã§ã¯ãmuxerã¯çæãããã»ã°ã¡ã³ãããšã«ãã¡ã€ã«ãäœæããŸãã ãããã®ãã¡ã€ã«ã¯åãã§ã
ãã¬ã€ãªã¹ããšããŠååãä»ãããã®åŸã«é£çªãš.tsæ¡åŒµåãä»ããŸãã
ããšãã°ãå ¥åãã¡ã€ã«ã次ã®ããã«å€æããã«ã¯ ffmpeg:
ffmpeg -i in.nut out.m3u8
ãã®äŸã§ã¯ããã¬ã€ãªã¹ããäœæããŸãã out.m3u8ãããã³ã»ã°ã¡ã³ããã¡ã€ã«ïŒ out0.ts, out1.ts,
out2.ts, etc.
åç §ããŠãã ãã ã»ã°ã¡ã³ã muxerã¯ãããäžè¬çã§æè»ãªå®è£ ãæäŸããŸã
ã»ã°ã¡ã³ããŒã·ã§ã³ãããã³HLSã»ã°ã¡ã³ããŒã·ã§ã³ãå®è¡ããããã«äœ¿çšã§ããŸãã
ãªãã·ã§ã³
ãã®ãã«ããã¬ã¯ãµã¯ã次ã®ãªãã·ã§ã³ããµããŒãããŠããŸãã
hls_time ç§
ã»ã°ã¡ã³ãã®é·ããç§åäœã§èšå®ããŸãã ããã©ã«ãå€ã¯2ã§ãã
hls_list_size ãµã€ãº
ãã¬ã€ãªã¹ããšã³ããªã®æ倧æ°ãèšå®ããŸãã 0ã«èšå®ãããšããªã¹ããã¡ã€ã«ã«ã¯ãã¹ãŠãå«ãŸããŸã
ã»ã°ã¡ã³ãã ããã©ã«ãå€ã¯5ã§ãã
hls_ts_options ãªãã·ã§ã³ãªã¹ã
key = valueãã©ã¡ãŒã¿ãŒã®ïŒ-åºåããªã¹ãã䜿çšããŠãåºåãã©ãŒããããªãã·ã§ã³ãèšå®ããŸãã å€
ãïŒããå«ãç¹æ®æåã¯ãšã¹ã±ãŒãããå¿ èŠããããŸãã
hls_wrap ã©ãã
ã»ã°ã¡ã³ããã¡ã€ã«åçªå·ïŒããããã«æå®ãããçªå·ïŒã®åŸã«çªå·ãèšå®ããŸã
ã»ã°ã¡ã³ããã¡ã€ã«ïŒã©ããã 0ã«èšå®ãããšãæ°å€ãæãè¿ãããããšã¯ãããŸããã ããã©ã«ãå€ã¯0ã§ãã
ãã®ãªãã·ã§ã³ã¯ããã£ã¹ã¯ãå€ãã®ã»ã°ã¡ã³ããã¡ã€ã«ã§ãã£ã±ãã«ãªãã®ãåé¿ããã®ã«åœ¹ç«ã¡ãŸãã
ãã£ã¹ã¯ã«æžã蟌ãŸããã»ã°ã¡ã³ããã¡ã€ã«ã®æå€§æ° ã©ãã.
éå§çªå· æ°
ãããã¬ã€ãªã¹ãã·ãŒã±ã³ã¹çªå·ãéå§ããŸã æ°ã ããã©ã«ãå€ã¯0ã§ãã
hls_allow_cache èš±å¯ãã£ãã·ã¥
ã¯ã©ã€ã¢ã³ãã\fIs0ïŒ1ïŒãŸãã¯ããŠã¯ãããªã\fIs0ïŒ0ïŒãã£ãã·ã¥ã¡ãã£ã¢
ã»ã°ã¡ã³ãã
hls_base_url ããŒã¹URL
è¿œå ããŒã¹URL ãã¬ã€ãªã¹ãã®ãã¹ãŠã®ãšã³ããªã«ã ã§ãã¬ã€ãªã¹ããçæããã®ã«äŸ¿å©ã§ã
絶察ãã¹ã
ãã¬ã€ãªã¹ãã®ã·ãŒã±ã³ã¹çªå·ã¯ã»ã°ã¡ã³ãããšã«äžæã§ããå¿ èŠããããäžæã§ã¯ãªãããšã«æ³šæããŠãã ãã
埪ç°ããå¯èœæ§ã®ããã»ã°ã¡ã³ããã¡ã€ã«åã·ãŒã±ã³ã¹çªå·ãšæ··åããã
äŸ ã©ãã ãªãã·ã§ã³ãæå®ãããŠããŸãã
hls_segment_filename ãã¡ã€ã«å
ã»ã°ã¡ã³ãã®ãã¡ã€ã«åãèšå®ããŸãã hls_flagssingle_fileãèšå®ãããŠããªãéã ãã¡ã€ã«å ãšããŠäœ¿çšãããŸã
ã»ã°ã¡ã³ãçªå·ä»ãã®æåå圢åŒïŒ
ffmpeg in.nut -hls_segment_filename'fileïŒ 03d.ts 'out.m3u8
ãã®äŸã§ã¯ããã¬ã€ãªã¹ããäœæããŸãã out.m3u8ãããã³ã»ã°ã¡ã³ããã¡ã€ã«ïŒ ãã¡ã€ã«000.ts,
ãã¡ã€ã«001.ts, ãã¡ã€ã«002.ts, etc.
hls_key_info_file ããŒæ å ±ãã¡ã€ã«
ã®æ å ±ã䜿çšããŠãã ãã ããŒæ å ±ãã¡ã€ã« ã»ã°ã¡ã³ãæå·åçšã ã®æåã®è¡
ããŒæ å ±ãã¡ã€ã« ãã¬ã€ãªã¹ãã«æžã蟌ãŸããããŒURIãæå®ããŸãã ããŒURLã¯æ¬¡ã®ç®çã§äœ¿çšãããŸã
åçäžã«æå·åããŒã«ã¢ã¯ã»ã¹ããŸãã XNUMXè¡ç®ã¯ã
æå·åããã»ã¹äžã«ããŒãååŸããããã«äœ¿çšãããããŒãã¡ã€ã«ã ããŒãã¡ã€ã«ã¯æ¬¡ã®ããã«èªã¿åãããŸã
ãã€ããªåœ¢åŒã®16ãªã¯ãããã®åäžããã¯é åã ãªãã·ã§ã³ã®XNUMXè¡ç®ã¯ã
ã®ä»£ããã«äœ¿çšãããXNUMXé²æååãšããŠã®åæåãã¯ãã«ïŒIVïŒ
æå·åçšã®ã»ã°ã¡ã³ãã·ãŒã±ã³ã¹çªå·ïŒããã©ã«ãïŒã ãžã®å€æŽ ããŒæ å ±ãã¡ã€ã« çµæã«ãªããŸã
æ°ããããŒ/ IVãšæ°ããããŒã®ãã¬ã€ãªã¹ãã®ãšã³ããªã䜿çšããã»ã°ã¡ã³ãæå·å
URI / IVã
ããŒæ å ±ãã¡ã€ã«åœ¢åŒïŒ
ïŒãªãã·ã§ã³ïŒ
ããŒURIã®äŸïŒ
http://server/file.key
/path/to/file.key
ãã¡ã€ã«ããŒ
ããŒãã¡ã€ã«ãã¹ã®äŸïŒ
ãã¡ã€ã«ããŒ
/path/to/file.key
äŸIVïŒ
0123456789ABCDEF0123456789ABCDEF
ããŒæ å ±ãã¡ã€ã«ã®äŸïŒ
http://server/file.key
/path/to/file.key
0123456789ABCDEF0123456789ABCDEF
ã·ã§ã«ã¹ã¯ãªããã®äŸïŒ
#!/bin/sh
BASE_URL = $ {1ïŒ-'ã'}
openssl rand 16> file.key
echo $ BASE_URL / file.key> file.keyinfo
ãšã³ãŒfile.key >> file.keyinfo
echo $ïŒopenssl rand -hex 16ïŒ>> file.keyinfo
ffmpeg -f lavfi -re -i testsrc -cïŒv h264 -hls_flags delete_segments \
-hls_key_info_file file.keyinfo out.m3u8
hls_flags åäžãã¡ã€ã«
ãã®ãã©ã°ãèšå®ãããŠããå Žåããã«ããã¬ã¯ãµã¯ãã¹ãŠã®ã»ã°ã¡ã³ããåäžã®MPEG-TSãã¡ã€ã«ã«ä¿åããŸãã
ãã¬ã€ãªã¹ãã®ãã€ãç¯å²ã䜿çšããŸãã ãã®æ¹æ³ã§çæãããHLSãã¬ã€ãªã¹ãã«ã¯
ããŒãžã§ã³çªå·4ãäŸïŒ
ffmpeg -i in.nut -hls_flags single_file out.m3u8
ãã¬ã€ãªã¹ããäœæããŸãã out.m3u8ãããã³åäžã»ã°ã¡ã³ããã¡ã€ã«ã ã¢ãŠã.ts.
hls_flags ã»ã°ã¡ã³ãã®åé€
ãã¬ã€ãªã¹ãããåé€ãããã»ã°ã¡ã³ããã¡ã€ã«ã¯ã次ã®æéãçµéãããšåé€ãããŸãã
ã»ã°ã¡ã³ãã®æéãšãã¬ã€ãªã¹ãã®æéã
ICO
ICOãã¡ã€ã«ãã«ããã¬ã¯ãµã
Microsoftã®ã¢ã€ã³ã³ãã¡ã€ã«åœ¢åŒïŒICOïŒã«ã¯ã泚æãã¹ãããã€ãã®å³ããå¶éããããŸãã
ã»ãµã€ãºã¯ã©ã®å¯žæ³ã§ã256ãã¯ã»ã«ãè¶ ããããšã¯ã§ããŸãã
ã»ä¿åã§ããã®ã¯BMPãšPNGã®ç»åã®ã¿ã§ã
ã»BMPç»åã䜿çšããå Žåã¯ã次ã®ããããã®ãã¯ã»ã«åœ¢åŒã§ããå¿ èŠããããŸãã
BMPããã深床FFmpegãã¯ã»ã«åœ¢åŒ
1ãããpal8
4ãããpal8
8ãããpal8
16ãããrgb555le
24ãããbgr24
32ãããbgra
ã»BMPã€ã¡ãŒãžã䜿çšããå Žåã¯ãBITMAPINFOHEADERDIBããããŒã䜿çšããå¿ èŠããããŸã
ã»PNGç»åã䜿çšããå Žåã¯ãrgbaãã¯ã»ã«åœ¢åŒã䜿çšããå¿ èŠããããŸã
image2
ç»åãã¡ã€ã«ãã«ããã¬ã¯ãµã
ç»åãã¡ã€ã«muxerã¯ããããªãã¬ãŒã ãç»åãã¡ã€ã«ã«æžã蟌ã¿ãŸãã
åºåãã¡ã€ã«åã¯ãã¿ãŒã³ã§æå®ãããé 次çæããããã«äœ¿çšã§ããŸã
çªå·ä»ãã®äžé£ã®ãã¡ã€ã«ã ãã¿ãŒã³ã«ã¯ãæååãïŒ dããŸãã¯ãïŒ 0ããå«ããããšãã§ããŸãNd "ããã®æåå
ãã¡ã€ã«åã®çªå·ä»ããè¡šãæåã®äœçœ®ãæå®ããŸãã ã®å Žå
ãã©ãŒã "ïŒ 0Nd "ã䜿çšãããšãåãã¡ã€ã«åã®æ°å€ãè¡šãæååã«0ãåã蟌ãŸããŸãã N
æ°åã ãªãã©ã«æå 'ïŒ 'ã¯ãæåå "%%"ã䜿çšããŠãã¿ãŒã³ã§æå®ã§ããŸãã
ãã¿ãŒã³ã«ãïŒ dããŸãã¯ãïŒ 0ããå«ãŸããŠããå ŽåNd "ãæå®ããããã¡ã€ã«ãªã¹ãã®æåã®ãã¡ã€ã«åã¯
çªå·1ãå«ã¿ã以äžã®çªå·ã¯ãã¹ãŠé£ç¶ããŸãã
ãã¿ãŒã³ã«ã¯ã次ã®åœ¢åŒãèªåçã«å€å¥ããããã«äœ¿çšãããæ¥å°ŸèŸãå«ãŸããå ŽåããããŸãã
æžã蟌ãç»åãã¡ã€ã«ã
ããšãã°ããã¿ãŒã³ãimg-ïŒ 03d.bmpãã¯ããã©ãŒã ã®ãã¡ã€ã«åã®ã·ãŒã±ã³ã¹ãæå®ããŸã
img-001.bmp, img-002.bmpâŠâŠã img-010.bmpãªã©ããã¿ãŒã³ãimg %%-ïŒ d.jpgãloading = "lazy"ã¯æå®ããŸã
ãã©ãŒã ã®ãã¡ã€ã«åã®ã·ãŒã±ã³ã¹ imgïŒ -1.jpg, imgïŒ -2.jpgâŠâŠã imgïŒ -10.jpg, etc.
äŸ
次ã®äŸã¯ã䜿çšæ¹æ³ã瀺ããŠããŸã ffmpeg äžé£ã®ãã¡ã€ã«ãäœæãããã
img-001.jpeg, img-002.jpegã...ãå ¥åãããªããæ¯ç§XNUMXã€ã®ç»åãååŸããŸãã
ffmpeg -i in.avi -vsync 1 -r 1 -f image2'img-ïŒ 03d.jpeg '
ãšæ³šæããŠãã ãã ffmpegãã-fããªãã·ã§ã³ãšåºåã§ãã©ãŒããããæå®ãããŠããªãå Žå
filenameã¯ç»åãã¡ã€ã«åœ¢åŒãæå®ããimage2 muxerãèªåçã«éžæãããããã
åã®ã³ãã³ãã¯æ¬¡ã®ããã«æžãããšãã§ããŸãïŒ
ffmpeg -i in.avi -vsync 1 -r 1'img-ïŒ 03d.jpeg '
ãã¿ãŒã³ã«ã¯å¿ ããããïŒ dããŸãã¯ãïŒ 0ããå«ãŸããŠããå¿ èŠã¯ãªãããšã«ã泚æããŠãã ããNd "ãäŸãã°
åäžã®ç»åãã¡ã€ã«ãäœæãã img.jpeg å ¥åãããªããã次ã®ã³ãã³ãã䜿çšã§ããŸãã
ffmpeg -i in.avi -f image2 -framesïŒv 1 img.jpeg
ãã® ã¹ãã©ãã¿ã€ã ãªãã·ã§ã³ã䜿çšãããšãæ¥ä»ãšæå»ã®æ å ±ã䜿çšããŠãã¡ã€ã«åãå±éã§ããŸãã
æ§æã«ã€ããŠã¯ããstrftimeïŒïŒãé¢æ°ã®ããã¥ã¡ã³ãã確èªããŠãã ããã
ããšãã°ããstrftimeïŒïŒããïŒ Y-ïŒ m-ïŒ d_ïŒ H-ïŒ M-ïŒ Sããã¿ãŒã³ããç»åãã¡ã€ã«ãçæããã«ã¯ã
ãã©ããŒäž ffmpeg ã³ãã³ãã䜿çšã§ããŸã:
ffmpeg -f v4l2 -r 1 -i / dev / video0 -f image2 -strftime 1 "ïŒ Y-ïŒ m-ïŒ d_ïŒ H-ïŒ M-ïŒ S.jpg"
ãªãã·ã§ã³
éå§çªå·
æå®ãããçªå·ããã·ãŒã±ã³ã¹ãéå§ããŸãã ããã©ã«ãå€ã¯0ã§ãã
update
1ã«èšå®ãããšããã¡ã€ã«åã¯åžžã«ãã¡ã€ã«åãšããŠè§£éããã
ãã¿ãŒã³ãããã³å¯Ÿå¿ãããã¡ã€ã«ã¯æ°ããç»åã§ç¶ç¶çã«äžæžããããŸãã
ããã©ã«ãå€ã¯0ã§ãã
ã¹ãã©ãã¿ã€ã
1ã«èšå®ãããŠããå ŽåããstrftimeïŒïŒãããã®æ¥ä»ãšæå»ã®æ å ±ã§ãã¡ã€ã«åãå±éããŸãã
ããã©ã«ãå€ã¯0ã§ãã
ç»åãã«ããã¬ã¯ãµã¯ã.YUVç»åãã¡ã€ã«åœ¢åŒããµããŒãããŠããŸãã ãã®ãã©ãŒãããã¯ãã®ç¹ã§ç¹å¥ã§ã
åç»åãã¬ãŒã ã¯ãYUV420Pã³ã³ããŒãã³ãããšã«XNUMXã€ã®ãã¡ã€ã«ã§æ§æãããŠããŸãã èªããŸãã¯
ãã®ç»åãã¡ã€ã«åœ¢åŒãèšè¿°ããããYããã¡ã€ã«ã®ååãæå®ããŸãã ãã«ããã¬ã¯ãµã¯
å¿ èŠã«å¿ããŠãããUããã¡ã€ã«ãšã.Vããã¡ã€ã«ãèªåçã«éããŸãã
Matroskaã¯
Matroskaã³ã³ãããã«ããã¬ã¯ãµã
ãã®ãã«ããã¬ã¯ãµã¯ãmatroskaããã³webmã³ã³ããã®ä»æ§ãå®è£ ããŠããŸãã
ãã®ãã«ããã¬ã¯ãµã§èªèãããã¡ã¿ããŒã¿èšå®ã¯æ¬¡ã®ãšããã§ãã
ã¿ã€ãã«
XNUMXã€ã®ãã©ãã¯ã«æäŸãããã¿ã€ãã«åãèšå®ããŸãã
èšèª
Matroskaèšèªãã©ãŒã ã§ãã©ãã¯ã®èšèªãæå®ããŸãã
èšèªã¯ã3æåã®æžèªISO-639-2ïŒISO 639-2 / BïŒåœ¢åŒã®ããããã§ãã
ïŒãã©ã³ã¹èªã®ãfreããªã©ïŒããŸãã¯å°éåéã®åœã³ãŒããšæ··åãããèšèªã³ãŒã
èšèªïŒã«ãããã©ã³ã¹èªã®ãfre-caããªã©ïŒã
Stereo_mode
3ã€ã®ãããªãã©ãã¯ã§XNUMXã€ã®ãã¥ãŒã®ã¹ãã¬ãªXNUMXDãããªã¬ã€ã¢ãŠããèšå®ããŸãã
次ã®å€ãèªèãããŸãã
ã¢ã
ãããªã¯ã¹ãã¬ãªã§ã¯ãããŸãã
å·Šå³
äž¡æ¹ã®ãã¥ãŒã䞊ãã§é 眮ãããå·Šç®ãã¥ãŒãå·ŠåŽã«ãããŸã
ããã ããã
äž¡æ¹ã®ãã¥ãŒã¯äžäžæ¹åã«é 眮ãããå·Šç®ãã¥ãŒã¯äžã«ãããŸã
äž_äž
äž¡æ¹ã®ãã¥ãŒãäžäžæ¹åã«é 眮ãããå·Šç®ãã¥ãŒãäžã«ãªããŸã
ãã§ãã«ãŒããŒã_rl
åãã¥ãŒã¯ãã§ãã«ãŒããŒãã®ã€ã³ã¿ãŒãªãŒããã¿ãŒã³ã§é 眮ãããå·Šç®ãã¥ãŒã¯
æåã®
ãã§ãã«ãŒããŒã_lr
åãã¥ãŒã¯ãã§ãã«ãŒããŒãã®ã€ã³ã¿ãŒãªãŒããã¿ãŒã³ã§é 眮ãããå³ç®ãã¥ãŒã¯
æåã®
row_interleaved_rl
åãã¥ãŒã¯è¡ããŒã¹ã®ã€ã³ã¿ãŒãªãŒãã§æ§æãããå³ç®ãã¥ãŒã¯æåã®è¡ã§ã
row_interleaved_lr
åãã¥ãŒã¯è¡ããŒã¹ã®ã€ã³ã¿ãŒãªãŒãã§æ§æãããå·Šç®ãã¥ãŒã¯æåã®è¡ã§ã
Col_interleaved_rl
äž¡æ¹ã®ãã¥ãŒã¯åããŒã¹ã®ã€ã³ã¿ãŒãªãŒãæ¹åŒã§é 眮ãããå³ç®ãã¥ãŒã¯
æåã®å
Col_interleaved_lr
äž¡æ¹ã®ãã¥ãŒã¯åããŒã¹ã®ã€ã³ã¿ãŒãªãŒãæ¹åŒã§é 眮ãããå·Šç®ãã¥ãŒã¯
æåã®å
ã¢ãã°ãªã_ã·ã¢ã³_ã¬ãã
ãã¹ãŠã®ãã¬ãŒã ã¯ãèµ€ã·ã¢ã³ã®ãã£ã«ã¿ãŒãéããŠè¡šç€ºã§ããã¢ãã°ãªã圢åŒã§ãã
å³å·Š
äž¡æ¹ã®ãã¥ãŒã䞊ãã§é 眮ãããå³ç®ãã¥ãŒãå·ŠåŽã«ãããŸã
ã¢ãã°ãªã_ã°ãªãŒã³_ããŒã³ã¿
ãã¹ãŠã®ãã¬ãŒã ã¯ãã°ãªãŒã³ããŒã³ã¿ã®ãã£ã«ã¿ãŒãéããŠè¡šç€ºã§ããã¢ãã°ãªã圢åŒã§ãã
ãããã¯_lr
äž¡æ¹ã®ç®ãXNUMXã€ã®ãããã¯ã«ãŸãšããããå·Šç®ãã¥ãŒãæåã«ãªããŸã
ãããã¯rl
äž¡ç®ãXNUMXã€ã®ãããã¯ã«ã²ãã§ç· ããããå³ç®ãã¥ãŒãæåã§ã
ããšãã°ã3D WebMã¯ãªããã¯ã次ã®ã³ãã³ãã©ã€ã³ã䜿çšããŠäœæã§ããŸãã
ffmpeg -i sample_left_right_clip.mpg -an -cïŒv libvpx -metadata Stereo_mode = left_right -y Stereo_clip.webm
ãªãã·ã§ã³
ãã®ãã«ããã¬ã¯ãµã¯ã次ã®ãªãã·ã§ã³ããµããŒãããŠããŸãã
reserved_index_space
ããã©ã«ãã§ã¯ããã®ãã«ããã¬ã¯ãµã¯ã·ãŒã¯çšã®ã€ã³ããã¯ã¹ïŒMatroskaçšèªã§ã¯ãã¥ãŒãšåŒã°ããŸãïŒã次ã®å Žæã«æžã蟌ã¿ãŸãã
ãã¡ã€ã«ã®çµãããããã¯ããã¡ã€ã«ã®æ®ãã®ã¹ããŒã¹ãäºåã«ç¥ãããšãã§ããªãããã§ãã
ãã¡ã€ã«ã®å é ã«ããã€ã³ããã¯ã¹ã ãã ããäžéšã®ãŠãŒã¹ã±ãŒã¹ïŒã¹ããªãŒãã³ã°ãªã©ïŒã®å Žå
ã·ãŒã¯ã¯å¯èœã ãé ãå Žå-ã€ã³ããã¯ã¹ãæåã«çœ®ããšäŸ¿å©ã§ã
ãã¡ã€ã«ã®ã
ãã®ãªãã·ã§ã³ããŒã以å€ã®å€ã«èšå®ãããŠããå Žåããã«ããã¬ã¯ãµã¯æå®ãããéã®
ãã¡ã€ã«ããããŒã«ã¹ããŒã¹ãå ¥ããŠãããå€éåãããšãã«ããã«ãã¥ãŒãæžã蟌ãããšããŸã
çµäºããŸãã 䜿çšå¯èœãªã¹ããŒã¹ãååã§ãªãå Žåãå€éåã¯å€±æããŸãã ã®ããã®å®å šãªãµã€ãº
ã»ãšãã©ã®äœ¿çšäŸã¯ããããªã®50æéãããçŽXNUMXkBã§ããå¿ èŠããããŸãã
ãã¥ãŒã¯ãåºåãã·ãŒã¯å¯èœã§ããããã®ãªãã·ã§ã³ã«ã¯ãªãå Žåã«ã®ã¿æžã蟌ãŸããããšã«æ³šæããŠãã ãã
ããã§ãªãå Žåã®å¹æã
md5
MD5ãã¹ã圢åŒã
ãã®ãã«ããã¬ã¯ãµã¯ããã¹ãŠã®å ¥åãªãŒãã£ãªããã³ãããªãã¬ãŒã ã®MD5ããã·ã¥ãèšç®ããŠåºåããŸãã ã«
ããã©ã«ãã®ãªãŒãã£ãªãã¬ãŒã ã¯ã眲åããã16ãããã®rawãªãŒãã£ãªããã³ãããªãã¬ãŒã ã«å€æãããŸãã
ããã·ã¥ãèšç®ããåã®ãããªã
ãã«ããã¬ã¯ãµã®åºåã¯ã次ã®åœ¢åŒã®5è¡ã§æ§æãããŸããMDXNUMX=MD5ããã§ã MD5 ã
èšç®ãããMD5ããã·ã¥ãè¡šãXNUMXé²æ°ã
ããšãã°ãçã®ãªãŒãã£ãªãšãããªã«å€æãããå ¥åã®MD5ããã·ã¥ãèšç®ãã
ãã¡ã€ã«ã«ä¿åããŸã ã¢ãŠã.md5:
ffmpeg -i INPUT -f md5 out.md5
次ã®ã³ãã³ãã䜿çšããŠãMD5ãstdoutã«åºåã§ããŸãã
ffmpeg -i INPUT -fmd5-
åç §ããŠãã ãã ãã¬ãŒã md5 ãã«ããã¬ã¯ãµã
movã mp4ã ismv
MOV / MP4 / ISMVïŒã¹ã ãŒãºã¹ããªãŒãã³ã°ïŒãã«ããã¬ã¯ãµã
mov / mp4 / ismvãã«ããã¬ã¯ãµã¯ãã©ã°ã¡ã³ããŒã·ã§ã³ããµããŒãããŸãã éåžžãMOV / MP4ãã¡ã€ã«ã«ã¯ãã¹ãŠã®
XNUMXã€ã®å Žæã«ä¿åãããŠãããã¹ãŠã®ãã±ããã«é¢ããã¡ã¿ããŒã¿ïŒãã¡ã€ã«ã®æåŸã«æžã蟌ãŸããŸãã
è¿œå ããããšã§ããè¯ãåçã®ããã«æåã«ç§»åããŸã ãã¡ã¹ãã¹ã¿ãŒã ãã ã¢ããã©ã°ããŸãã¯ã䜿çšããŠ
ã qt-ãã¡ã¹ãã¹ã¿ãŒã éå ·ïŒã ãã©ã°ã¡ã³ãåããããã¡ã€ã«ã¯ããã±ãããå«ãŸããããã€ãã®ãã©ã°ã¡ã³ãã§æ§æãããŸãã
ãããã®ãã±ããã«é¢ããã¡ã¿ããŒã¿ã¯äžç·ã«ä¿åãããŸãã æçåããããã¡ã€ã«ã®æžã蟌ã¿ã«ã¯ã
æžã蟌ã¿ãäžæãããŠããã¡ã€ã«ããã³ãŒãå¯èœã§ãããšããå©ç¹ïŒéåžžã®å Žå
MOV / MP4ã¯ãé©åã«çµäºããŠããªãå Žåã¯ãã³ãŒãã§ããŸããïŒã
éåžžã«é·ããã¡ã€ã«ãæžã蟌ãïŒéåžžã®MOV / MP4ãã¡ã€ã«ãæžã蟌ããšããã¹ãŠã®ãã¡ã€ã«ã«é¢ããæ å ±ãä¿åãããããïŒ
ãã¡ã€ã«ãéãããããŸã§ã¡ã¢ãªå ã®ãã±ããïŒã æ¬ ç¹ã¯ãäºææ§ãäœãããšã§ã
ä»ã®ã¢ããªã±ãŒã·ã§ã³ã§ã
ãªãã·ã§ã³
æçåã¯ããã¡ã€ã«ã®åãåãæ¹æ³ãå®çŸ©ããAVOptionã®XNUMXã€ãèšå®ããããšã§æå¹ã«ãªããŸã
æçã«ïŒ
-moov_size ãã€ã
ãã¡ã€ã«ãé 眮ãã代ããã«ããã¡ã€ã«ã®å é ã«moovã¢ãã çšã®ã¹ããŒã¹ãäºçŽããŸã
æåŸã«moovã¢ãã ã äºçŽããã¹ããŒã¹ãäžè¶³ããŠããå Žåãå€éåã¯å€±æããŸãã
-movflags ãã©ã°ããŒãã¬ãŒã
åãããªããŒãã¬ãŒã ã§æ°ãããã©ã°ã¡ã³ããéå§ããŸãã
-frag_duration ãã¥ã¬ãŒã·ã§ã³
次ã®ãããªãã©ã°ã¡ã³ããäœæããŸã ãã¥ã¬ãŒã·ã§ã³ ãã€ã¯ãç§ã®é·ãã
-frag_size ãµã€ãº
æ倧ãå«ããã©ã°ã¡ã³ããäœæããŸã ãµã€ãº ãã€ããŒãããŒã¿ã®ãã€ãã
-movflags ãã©ã°ã«ã¹ã¿ã
åŒã³åºãå ãåŒã³åºãããšã«ããããã©ã°ã¡ã³ããã«ããããã¿ã€ãã³ã°ãæåã§éžæã§ããããã«ããŸã
ãav_write_frameïŒctxãNULLïŒãã¯ããããŸã§ã«æžã蟌ãŸãããã±ããã§ãã©ã°ã¡ã³ããæžã蟌ã¿ãŸãã ïŒãã®
libavformatãçµ±åããŠããä»ã®ã¢ããªã±ãŒã·ã§ã³ã§ã®ã¿åœ¹ç«ã¡ãŸãã ffmpeg.)
-min_frag_duration ãã¥ã¬ãŒã·ã§ã³
ããçããã©ã°ã¡ã³ããäœæããªãã§ãã ãã ãã¥ã¬ãŒã·ã§ã³ ãã€ã¯ãç§ã®é·ãã
è€æ°ã®æ¡ä»¶ãæå®ãããŠããå Žåãæå®ãããæ¡ä»¶ã®XNUMXã€ãæå®ããããšãã«ãã©ã°ã¡ã³ããã«ãããããŸã
æ¡ä»¶ãæºããããŠããŸãã ããã®äŸå€ã¯ã-min_frag_durationãã§ããã
é©çšããä»ã®æ¡ä»¶ã®ããããã«ã€ããŠæºããããŠããã
ããã«ãåºåãã¡ã€ã«ã®æžã蟌ã¿æ¹æ³ã¯ãä»ã®ããã€ãã®æ¹æ³ã§èª¿æŽã§ããŸãã
ãªãã·ã§ã³ïŒ
-movflags 空ã®ã ãŒã
ãã¡ã€ã«ã®å é ã«æåã®moovã¢ãã ããäœãèšè¿°ããã«çŽæ¥æžã蟌ã¿ãŸã
ãã®äžã®ãµã³ãã«ã éåžžãmdat / moovãã¢ã¯ããã¡ã€ã«ã®å é ã«æ¬¡ã®ããã«æžã蟌ãŸããŸãã
ãã¡ã€ã«ã®çãéšåã®ã¿ãå«ãéåžžã®MOV / MP4ãã¡ã€ã«ã ãã®ãªãã·ã§ã³ã§
ã»ããã§ã¯ãæåã®mdatã¢ãã ã¯ãªããmoovã¢ãã ã¯ãã©ãã¯ã®ã¿ãèšè¿°ããŸãã
æéã¯ãŒãã§ãã
ãã®ãªãã·ã§ã³ã¯ãismvïŒã¹ã ãŒãºã¹ããªãŒãã³ã°ïŒãã¡ã€ã«ãæžã蟌ããšãã«æé»çã«èšå®ãããŸãã
-movflags ã»ãã¬ãŒãã ãŒã
ãã©ãã¯ããšã«åå¥ã®moofïŒã ãŒããŒãã©ã°ã¡ã³ãïŒã¢ãã ãèšè¿°ããŸãã éåžžããã¹ãŠã®ãã±ãã
ãã©ãã¯ã¯moofã¢ãã ïŒå°ãå¹ççã§ãïŒã§æžãããŠããŸãããããã䜿çšãããš
ãªãã·ã§ã³ãèšå®ãããšãmuxerã¯ãã©ãã¯ããšã«XNUMXã€ã®moof / mdatãã¢ãæžã蟌ãããã次ã®æäœãç°¡åã«ãªããŸãã
å¥ã ã®ãã©ãã¯ã
ãã®ãªãã·ã§ã³ã¯ãismvïŒã¹ã ãŒãºã¹ããªãŒãã³ã°ïŒãã¡ã€ã«ãæžã蟌ããšãã«æé»çã«èšå®ãããŸãã
-movflags ãã¡ã¹ãã¹ã¿ãŒã
ã€ã³ããã¯ã¹ïŒmoovã¢ãã ïŒããã¡ã€ã«ã®å é ã«ç§»åããXNUMXçªç®ã®ãã¹ãå®è¡ããŸãã ãã®
æäœã«ã¯æéããããå Žåããããæçåãªã©ã®ããŸããŸãªç¶æ³ã§ã¯æ©èœããŸãã
åºåããããã£ãŠãããã©ã«ãã§ã¯æå¹ã«ãªã£ãŠããŸããã
-movflags rtphint
RTPãã³ããã©ãã¯ãåºåãã¡ã€ã«ã«è¿œå ããŸãã
-movflags ç¡å¹å_chpl
Neroãã£ãã¿ãŒããŒã«ãŒïŒchplã¢ãã ïŒãç¡å¹ã«ããŸãã éåžžãNeroã®ç« ãš
QuickTimeãã£ãã¿ãŒãã©ãã¯ããã¡ã€ã«ã«æžã蟌ãŸããŸãã ãã®ãªãã·ã§ã³ãèšå®ãããšã
QuickTimeãã£ãã¿ãŒãã©ãã¯ãæžã蟌ãŸããŸãã Neroãã£ãã¿ãŒã¯ã次ã®å Žåã«å€±æãåŒãèµ·ããå¯èœæ§ããããŸãã
ãã¡ã€ã«ã¯ãmp3Tag2.61aãiTunes11.3ãªã©ã®ç¹å®ã®ã¿ã°ä»ãããã°ã©ã ã§ååŠçãããŸãã
ã»ãšãã©ã®å Žåãä»ã®ããŒãžã§ã³ã圱é¿ãåããŸãã
-movflags çç¥_tfhd_offset
tfhdã¢ãã ã«çµ¶å¯Ÿbase_data_offsetãæžã蟌ãŸãªãã§ãã ããã ããã«ããããã©ã°ã¡ã³ãã®çµåãåé¿ãããŸã
ãã¡ã€ã«/ã¹ããªãŒã å ã®çµ¶å¯Ÿãã€ãäœçœ®ã«ã
-movflags ããã©ã«ã_ããŒã¹_ã ãŒã
omit_tfhd_offsetãšåæ§ã«ããã®ãã©ã°ã¯çµ¶å¯Ÿå€ã®æžã蟌ã¿ãåé¿ããŸã
tfhdã¢ãã ã®base_data_offsetãã£ãŒã«ãããã ããæ°ããdefault-base-is-ã䜿çšããŠãããè¡ããŸãã
代ããã«moofãã©ã°ã ãã®ãã©ã°ã¯14496-12ïŒ2012ããæ°ãããã®ã§ãã ããã¯æçãäœããããããŸãã
ç¹å®ã®ç¶æ³ã§ã®è§£æã容æïŒããŒã¹ãã©ãã¯ãã©ã°ã¡ã³ãã®å Žæãåé¿ïŒ
åã®ãã©ãã¯ãã©ã°ã¡ã³ãã®æé»ã®çµããã®èšç®ïŒã
äŸ
ããã«ãããã¹ã ãŒãºãªã¹ããªãŒãã³ã°ã³ã³ãã³ããIISã®å ¬éãã€ã³ãã«ãªã¢ã«ã¿ã€ã ã§ããã·ã¥ã§ããŸãã
ãã«ããã¬ã¯ãµã äŸïŒ
ffmpeg -re < > -movflags isml + frag_keyframe -f ismv http://server/publishingpoint.isml/StreamsïŒãšã³ã³ãŒããŒ1ïŒ
èããã AAX
å¯èŽAAXãã¡ã€ã«ã¯æå·åãããM4Bãã¡ã€ã«ã§ããã4ãæå®ããããšã§åŸ©å·åã§ããŸã
ãã€ãã¢ã¯ãã£ããŒã·ã§ã³ã·ãŒã¯ã¬ããã
ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -cïŒa copy output.mp4
mp3
MP3ãã«ããã¬ã¯ãµã¯ã次ã®ãªãã·ã§ã³æ©èœã䜿çšããŠçã®MP3ã¹ããªãŒã ãæžã蟌ã¿ãŸãã
ã»æåã®ID3v2ã¡ã¿ããŒã¿ããããŒïŒããã©ã«ãã§æå¹ïŒã ããŒãžã§ã³2.3ããã³2.4
ãµããŒããããŠããå Žåããid3v2_versionããã©ã€ããŒããªãã·ã§ã³ã¯ã©ã¡ãã䜿çšããããå¶åŸ¡ããŸãïŒ3ãŸãã¯4ïŒã
ãid3v2_versionãã0ã«èšå®ãããšãID3v2ããããŒãå®å šã«ç¡å¹ã«ãªããŸãã
ãã«ããã¬ã¯ãµã¯ãæ·»ä»ç»åïŒAPICãã¬ãŒã ïŒã®ID3v2ããããŒãžã®æžã蟌ã¿ããµããŒãããŠããŸãã NS
åçã¯ãåäžã®ãã±ãããå«ããããªã¹ããªãŒã ã®åœ¢åŒã§ãã«ããã¬ã¯ãµã«æäŸãããŸãã
ãããã®ã¹ããªãŒã ã¯ããã€ã§ãååšã§ãããããããåäžã®APICãã¬ãŒã ã«å¯Ÿå¿ããŸãã
ã¹ããªãŒã ã¡ã¿ããŒã¿ã¿ã° ã¿ã€ãã« ãš ã³ã¡ã³ã APICã«ããã 説æ ãš ç»å type
ããããã èŠãhttp://id3.org/id3v2.4.0-frames>èš±å¯ãããç»åã¿ã€ãã®å Žåã
APICãã¬ãŒã ã¯æåã«æžã蟌ãå¿ èŠãããããããã«ããã¬ã¯ãµã¯ãããã¡ãªã³ã°ããããšã«æ³šæããŠãã ãã
ãã¹ãŠã®ç»åãååŸãããŸã§ãªãŒãã£ãªãã¬ãŒã ã ãããã£ãŠãæäŸããããšããå§ãããŸã
é床ã®ãããã¡ãªã³ã°ãé¿ããããã«ãã§ããã ãæ©ãåçãã
ã»ID3v2ããããŒã®çŽåŸã®Xing / LAMEãã¬ãŒã ïŒååšããå ŽåïŒã ããã©ã«ãã§æå¹ã«ãªã£ãŠããŸããã
ãã ããåºåãã·ãŒã¯å¯èœã§ããå Žåã«ã®ã¿æžã蟌ãŸããŸãã ãwrite_xingããã©ã€ããŒããªãã·ã§ã³
ç¡å¹ã«ããããã«äœ¿çšã§ããŸãã ãã¬ãŒã ã«ã¯ã圹ç«ã€å¯èœæ§ã®ããããŸããŸãªæ å ±ãå«ãŸããŠããŸã
ãªãŒãã£ãªã®æç¶æéããšã³ã³ãŒãã®é 延ãªã©ããã³ãŒãã«éä¿¡ããŸãã
ã»ãã¡ã€ã«ã®æåŸã«ããã¬ã¬ã·ãŒID3v1ã¿ã°ïŒããã©ã«ãã§ã¯ç¡å¹ïŒã æå¹ã«ãªã£ãŠããå¯èœæ§ããããŸã
ãwrite_id3v1ããã©ã€ããŒããªãã·ã§ã³ã䜿çšããŸããããã®æ©èœã¯éåžžã«éãããŠããããã
䜿çšã¯ãå§ãããŸããã
äŸïŒ
ID3v3ããããŒãšID2.3v3ããã¿ãŒã䜿çšããŠmp1ãèšè¿°ããŸãã
ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
ç»åãmp3ãã¡ã€ã«ã«æ·»ä»ããã«ã¯ããªãŒãã£ãªãšç»åã¹ããªãŒã ã®äž¡æ¹ãéžæããŸãã
"å°å³"ïŒ
ffmpeg -i input.mp3 -i cover.png -c ã³ã㌠-map 0 -map 1
-metadataïŒsïŒv title = "ã¢ã«ãã ã«ããŒ" -metadataïŒsïŒv comment = "CoverïŒFrontïŒ" out.mp3
è¿œå æ©èœãªãã§ãã¯ãªãŒã³ãªãMP3ãäœæããŸãã
ffmpeg -i å ¥å.wav -write_xing 0 -id3v2_version 0 out.mp3
mpegt
MPEGãã©ã³ã¹ããŒãã¹ããªãŒã ãã«ããã¬ã¯ãµã
ãã®ãã«ããã¬ã¯ãµã¯ãISO13818-1ããã³ETSIEN 300ã®äžéšãå®è£ ããŠããŸãã
mpegts muxerã§èªèãããã¡ã¿ããŒã¿èšå®ã¯ããservice_providerããš
"ãµãŒãã¹å"ã ããããèšå®ãããŠããªãå Žåããservice_providerãã®ããã©ã«ãã¯ãFFmpegãã§ããã
ãservice_nameãã®ããã©ã«ãã¯ãService01ãã§ãã
ãªãã·ã§ã³
ãã«ããã¬ã¯ãµã®ãªãã·ã§ã³ã¯æ¬¡ã®ãšããã§ãã
-mpegts_original_network_id æ°
original_network_idïŒããã©ã«ãã¯0x0001ïŒãèšå®ããŸãã ããã¯ãããã¯ãŒã¯ã®äžæã®èå¥åã§ã
DVBã§ã ãã®äž»ãªçšéã¯ããã¹ãä»ãããµãŒãã¹ã®äžæã®èå¥ã§ãã
Original_Network_IDãTransport_Stream_IDã
-mpegts_transport_stream_id æ°
transport_stream_idãèšå®ããŸãïŒããã©ã«ãã¯0x0001ïŒã ããã«ãããDVBã®ãã©ã³ã¹ãã³ããèå¥ãããŸãã
-mpegts_service_id æ°
DVBã§ã¯ããã°ã©ã ãšãåŒã°ããservice_idïŒããã©ã«ãã¯0x0001ïŒãèšå®ããŸãã
-mpegts_service_type æ°
ããã°ã©ã service_typeãèšå®ããŸãïŒããã©ã«ã ããžã¿ã«ãã¬ãïŒã以äžã®äºåå®çŸ©ããããªã¹ããåç §ããŠãã ãã
å€ã
-mpegts_pmt_start_pid æ°
PMTã®æåã®PIDãèšå®ããŸãïŒããã©ã«ãã¯0x1000ãæ倧ã¯0x1f00ïŒã
-mpegts_start_pid æ°
ããŒã¿ãã±ããã®æåã®PIDãèšå®ããŸãïŒããã©ã«ãã¯0x0100ãæ倧ã¯0x0f00ïŒã
-mpegts_m2ts_mode æ°
2ã«èšå®ãããŠããå Žåã¯ãm1tsã¢ãŒããæå¹ã«ããŸããããã©ã«ãå€ã¯-1ã§ãm2tsã¢ãŒããç¡å¹ã«ããŸãã
-ããã¯ã¹ã¬ãŒã æ°
äžå®ã®muxrateïŒããã©ã«ãã®VBRïŒãèšå®ããŸãã
-pcr_æé æ°
ããã©ã«ãã®PCRåéä¿¡æéïŒããã©ã«ãã¯20msïŒããªãŒããŒã©ã€ãããå¯å€ã®å Žåã¯ç¡èŠããŸã
muxrateãéžæãããŠããŸãã
ãããæé æ°
PAT / PMTããŒãã«éã®æ倧æéïŒç§åäœïŒã
sdt_æé æ°
SDTããŒãã«éã®æ倧æéïŒç§åäœïŒã
-pes_payload_size æ°
æå°PESãã±ãããã€ããŒãããã€ãåäœã§èšå®ããŸãã
-mpegts_flags ãã©ã°
ãã©ã°ãèšå®ããŸãïŒä»¥äžãåç §ïŒã
-mpegts_copyts æ°
å€ã1ã«èšå®ãããŠããå Žåãå ã®ã¿ã€ã ã¹ã¿ã³ããä¿æããŸããããã©ã«ãå€ã¯-1ã§ãããçµæã¯-XNUMXã«ãªããŸãã
ã¿ã€ã ã¹ã¿ã³ãã0ããéå§ããããã«ã·ããããŸãã
-tables_version æ°
PATãPMTãããã³SDTã®ããŒãžã§ã³ãèšå®ããŸãïŒããã©ã«ãã¯0ãæå¹ãªå€ã¯0ãã31ãŸã§ã§ãïŒã
ãã®ãªãã·ã§ã³ã䜿çšãããšãã¹ããªãŒã æ§é ãæŽæ°ããŠãæšæºã®ã³ã³ã·ã¥ãŒããŒã
å€åããã ãããè¡ãã«ã¯ãåºåAVFormatContextãå床éããïŒAPIã䜿çšããå ŽåïŒãåèµ·åããŸã
ffmpegã€ã³ã¹ã¿ã³ã¹ãåšæçã«å€åããtables_versionå€ïŒ
ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udpïŒ//1.1.1.1ïŒ1111
ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udpïŒ//1.1.1.1ïŒ1111
...
ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udpïŒ//1.1.1.1ïŒ1111
ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udpïŒ//1.1.1.1ïŒ1111
ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udpïŒ//1.1.1.1ïŒ1111
...
ãªãã·ã§ã³mpegts_service_typeã¯ã次ã®å€ãåãå ¥ããŸãã
hex_value
ETSI 0ã§å®çŸ©ãããŠãã01x0ãã300xffãŸã§ã®ä»»æã®468é²å€ã
ããžã¿ã«ãã¬ã
ããžã¿ã«TVãµãŒãã¹ã
ããžã¿ã«ã©ãžãª
ããžã¿ã«ã©ãžãªãµãŒãã¹ã
ãã¬ããã¹ã
æåæŸéãµãŒãã¹ã
Advanced_codec_digital_radio
é«åºŠãªã³ãŒããã¯ããžã¿ã«ã©ãžãªãµãŒãã¹ã
mpeg2_ããžã¿ã«_hdtv
MPEG2ããžã¿ã«HDTVãµãŒãã¹ã
Advanced_codec_digital_sdtv
é«åºŠãªã³ãŒããã¯ããžã¿ã«SDTVãµãŒãã¹ã
Advanced_codec_digital_hdtv
é«åºŠãªã³ãŒããã¯ããžã¿ã«HDTVãµãŒãã¹ã
ãªãã·ã§ã³mpegts_flagsã¯ã次ã®ãããªãã©ã°ã®ã»ãããåãããšãã§ããŸãã
åéä¿¡ããããŒ
次ã®ãã±ãããæžã蟌ãåã«ãPAT / PMTãåéä¿¡ããŠãã ããã
緯床
AACã«ã¯LATMãã±ããåã䜿çšããŸãã
pat_pmt_at_frames
åãããªãã¬ãŒã ã§PATãšPMTãåéä¿¡ããŸãã
äŸ
ffmpeg -i file.mpg -c ã³ããŒ\
-mpegts_original_network_id 0x1122 \
-mpegts_transport_stream_id 0x3344 \
-mpegts_service_id 0x5566 \
-mpegts_pmt_start_pid 0x1500 \
-mpegts_start_pid 0x150 \
-metadata service_provider = "äžéšã®ãããã€ããŒ" \
-metadata service_name = "Some Channel" \
-y out.ts
mxfã mxf_d10
MXFãã«ããã¬ã¯ãµã
ãªãã·ã§ã³
ãã«ããã¬ã¯ãµã®ãªãã·ã§ã³ã¯æ¬¡ã®ãšããã§ãã
ã¹ãã¢_ãŠãŒã¶ãŒ_ã³ã¡ã³ã ããŒã«
ãŠãŒã¶ãŒã³ã¡ã³ããä¿åãããã䜿çšããªãããèšå®ããŸãã IRTD-10ã¯èš±å¯ããŸãã
ãŠãŒã¶ãŒã³ã¡ã³ãã ãããã£ãŠãããã©ã«ãã§ã¯ãmxfã«ã¯æžã蟌ã¿ãŸãããmxf_d10ã«ã¯æžã蟌ã¿ãŸããã
ãã«
ãã«ãã«ããã¬ã¯ãµã
ãã®ãã«ããã¬ã¯ãµã¯åºåãã¡ã€ã«ãçæããŸãããäž»ã«ãã¹ãã
ãã³ãããŒã¯ã®ç®çã
ããšãã°ãã§ãã³ãŒãããã³ãããŒã¯ãã ffmpeg 次ã®ã³ãã³ãã䜿çšã§ããŸãã
ffmpeg -benchmark -i INPUT -f null out.null
äžèšã®ã³ãã³ãã¯èªã¿åããŸãã¯æžã蟌ã¿ãè¡ããªãããšã«æ³šæããŠãã ãã out.null ãã¡ã€ã«ã§ããã
åºåãã¡ã€ã«ã¯ ffmpeg æ§æã
ãŸãã¯ã次ã®ããã«ã³ãã³ããèšè¿°ã§ããŸãã
ffmpeg -benchmark -i INPUT -f null-
ããã
-åæç¹ ãã©ã°
nutã§åæç¹ã®äœ¿çšæ³ãå€æŽããŸãã
ããã©ã«ã ã€ãããŸã ã éåžžã® äœãªãŒããŒããã ãæ±ãã AIDSã
ãªã do ã€ãããŸã ã åæç¹ at å šãŠã çž®å° ã ãªãŒããŒããã çç ã極床ã«æªçºéãéçºéã®ã³ãŒããŒã«ãŠãã¯ããã²ã³é žã®å³ãããžã®åœ±é¿ã¯åŒ·ããªããéå±ãæãããå³ãããšä¹ŸããããŠã¹ãã£ãŒã«ãæããããŸãã ã¡ã€ãã³ã° ã æµã
æ±ããããšã¯ã§ããŸããã
çµæã®ãã¡ã€ã«ã¯éåžžã«æå·ããŠããããããã®ãªãã·ã§ã³ã®äœ¿çšã¯ãå§ãããŸãã
ææã§ã·ãŒã¯ããããšã¯ã§ããŸããã ãŸããäžè¬çã«ããã®ãªãŒããŒããã
åæç¹ã¯ãããããã§ãã 泚ã-C 0ã䜿çšããŠç¡å¹ã«ããããšãã§ããŸã
å¢å€§ãããã¹ãŠã®ããŒã¿ããŒãã«ã«ãããéãããã¡ã¢ãªã§ç¡éã®ã¹ããªãŒã ãå€éåã§ããŸã
ãããŠãããã®äžå©ãªç¹ãªãã§ã
ã¿ã€ã ã¹ã¿ã³ãä»ã 䌞ã°ã ã åæç¹ ã a å£æèš ãã£ãŒã«ãã
ãã® ãªã ãš ã¿ã€ã ã¹ã¿ã³ãä»ã ãã©ã°ã¯å®éšçãªãã®ã§ãã
-write_index ããŒã«
æåŸã«ã€ã³ããã¯ã¹ãæžã蟌ã¿ãŸããããã©ã«ãã§ã¯ãã€ã³ããã¯ã¹ãæžã蟌ã¿ãŸãã
ffmpeg -i INPUT-f_strictå®éšç-syncpointsãªã-| ããã»ããµ
OGG
Oggã³ã³ãããã«ããã¬ã¯ãµã
-page_duration ãã¥ã¬ãŒã·ã§ã³
ãã€ã¯ãç§åäœã®åªå ããŒãžæéã ãã«ããã¬ã¯ãµã¯ã次ã®ãããªããŒãžãäœæããããšããŸã
ããããã§ã ãã¥ã¬ãŒã·ã§ã³ ãã€ã¯ãç§ã®é·ãã ããã«ããããŠãŒã¶ãŒã¯åŠ¥åããããšãã§ããŸã
ã·ãŒã¯ç²åºŠãšã³ã³ãããªãŒããŒãããã®éã ããã©ã«ãã¯1ç§ã§ãã å€0
ãã¹ãŠã®ã»ã°ã¡ã³ããåããããŒãžãã§ããã ã倧ããããŸãã å€ã1ã®å Žå
ã»ãšãã©ã®ç¶æ³ã§ããŒãžããšã«1ãã±ãããå¹æçã«äœ¿çšããã·ãŒã¯ã®ç²åºŠãå°ããããŸã
è¿œå ã®ã³ã³ãããªãŒããŒããããç ç²ã«ããŠã
-serial_offset å€
ã¹ããªãŒã ã®ã·ãªã¢ã«çªå·ãèšå®ããã·ãªã¢ã«å€ã å¥ã®èšå®ãš
ååã«å€§ããªå€ã¯ãçæãããoggãã¡ã€ã«ãå®å šã«ãã§ãŒã³ã§ããããšãä¿èšŒããŸãã
ã»ã°ã¡ã³ãã stream_segmentã ã»ã°ã¡ã³ã
åºæ¬çãªã¹ããªãŒã ã»ã°ã¡ã³ã¿ãŒã
ãã®ãã«ããã¬ã¯ãµã¯ãã»ãŒåºå®ãããæéã®å€æ°ã®åå¥ã®ãã¡ã€ã«ã«ã¹ããªãŒã ãåºåããŸãã åºå
ãã¡ã€ã«åã®ãã¿ãŒã³ã¯ã次ã®ãããªæ¹æ³ã§èšå®ã§ããŸãã image2ããŸãã¯ãstrftimeãã䜿çšããŠ
ãã³ãã¬ãŒãã®å Žå ã¹ãã©ãã¿ã€ã ãªãã·ã§ã³ã¯æå¹ã§ãã
ãstream_segmentãã¯ãã¹ããªãŒãã³ã°åºå圢åŒãžã®æžã蟌ã¿ã«äœ¿çšããããã«ããã¬ã¯ãµã®å€åœ¢ã§ãã
ã°ããŒãã«ããããŒãå¿ èŠãšãããMPEGãªã©ãžã®åºåã«æšå¥šãããŸã
ãã©ã³ã¹ããŒãã¹ããªãŒã ã»ã°ã¡ã³ãã ãssegmentãã¯ãstream_segmentãã®çããšã€ãªã¢ã¹ã§ãã
ãã¹ãŠã®ã»ã°ã¡ã³ãã¯ãéžæãããåç §ã¹ããªãŒã ã®ããŒãã¬ãŒã ã§å§ãŸããŸãã
ã¹ã«ãŒ åç §ã¹ããªãŒã ãªãã·ã§ã³ãéžæããŸãã
ãããªãã¡ã€ã«ãæ£ç¢ºã«åå²ãããå Žåã¯ãå ¥åããŒãäœæããå¿ èŠãããããšã«æ³šæããŠãã ãã
ãã¬ãŒã ã¯ãã»ã°ã¡ã³ããŒã·ã§ã³ãŸãã¯ã»ã°ã¡ã³ãã«ãã£ãŠäºæ³ãããæ£ç¢ºãªåå²æéã«å¯Ÿå¿ããŸã
muxerã¯ãæå®ãããéå§ã®æ¬¡ã«èŠã€ãã£ãããŒãã¬ãŒã ã§æ°ããã»ã°ã¡ã³ããéå§ããŸã
æéã
ã»ã°ã¡ã³ããã«ããã¬ã¯ãµã¯ãåäžã®äžå®ã®ãã¬ãŒã ã¬ãŒãã®ãããªã§æé©ã«æ©èœããŸãã
ãªãã·ã§ã³ã§ããªãã·ã§ã³ãèšå®ããããšã«ãããäœæãããã»ã°ã¡ã³ãã®ãªã¹ããçæã§ããŸã
ã»ã°ã¡ã³ããªã¹ãã ãªã¹ãã¿ã€ãã¯ã ã»ã°ã¡ã³ããªã¹ãã®çš®é¡ ãªãã·ã§ã³ã ãšã³ããª
ã»ã°ã¡ã³ããªã¹ãã®ãã¡ã€ã«åã¯ãããã©ã«ãã§å¯Ÿå¿ãã察å¿ããããŒã¹åã«èšå®ãããŸã
ã»ã°ã¡ã³ããã¡ã€ã«ã
åç §ããŠãã ãã hls muxerã¯ãHLSã®ããå ·äœçãªå®è£ ãæäŸããŸã
ã»ã°ã¡ã³ããŒã·ã§ã³ã
ãªãã·ã§ã³
ã»ã°ã¡ã³ããã«ããã¬ã¯ãµã¯ã次ã®ãªãã·ã§ã³ããµããŒãããŠããŸãã
åç §ã¹ããªãŒã æå®å
æååã§æå®ãããŠããããã«ãåç §ã¹ããªãŒã ãèšå®ããŸã æå®åã å Žå æå®å èšå®ãããŠãã
ãèªåãã«ãããšãåç §ãèªåçã«éžæãããŸãã ãã以å€ã®å Žåã¯ã¹ããªãŒã ã§ããå¿ èŠããããŸã
æå®åïŒffmpegããã¥ã¢ã«ã®ãã¹ããªãŒã æå®åãã®ç« ãåç §ïŒ
åç §ã¹ããªãŒã ã ããã©ã«ãå€ã¯ãautoãã§ãã
ã»ã°ã¡ã³ãåœ¢åŒ åœ¢åŒã§ã¢ãŒã«ã€ããããããžã§ã¯ããä¿åããŸãïŒ
å éšã³ã³ãã圢åŒããªãŒããŒã©ã€ãããŸããããã©ã«ãã§ã¯ããã¡ã€ã«åã«ãã£ãŠæšæž¬ãããŸãã
æ¡å€§ã
ã»ã°ã¡ã³ã圢åŒãªãã·ã§ã³ ãªãã·ã§ã³ãªã¹ã
key = valueãã©ã¡ãŒã¿ãŒã®ïŒ-åºåããªã¹ãã䜿çšããŠãåºåãã©ãŒããããªãã·ã§ã³ãèšå®ããŸãã å€
ãïŒããå«ãç¹æ®æåã¯ãšã¹ã±ãŒãããå¿ èŠããããŸãã
ã»ã°ã¡ã³ããªã¹ã å
次ã®ååã®ãªã¹ããã¡ã€ã«ãçæããŸã åã æå®ããªãå Žåããªã¹ããã¡ã€ã«ã¯çæãããŸããã
ã»ã°ã¡ã³ããªã¹ããã©ã° ãã©ã°
ã»ã°ã¡ã³ããªã¹ãã®çæã«åœ±é¿ãããã©ã°ãèšå®ããŸãã
çŸåšã次ã®ãã©ã°ããµããŒãããŠããŸãã
ãã£ãã·ã¥
ãã£ãã·ã¥ãèš±å¯ããŸãïŒM3U8ãªã¹ããã¡ã€ã«ã«ã®ã¿åœ±é¿ããŸãïŒã
ã©ã€ã
ã©ã€ããã¬ã³ããªãŒãªãã¡ã€ã«çæãèš±å¯ããŸãã
ã»ã°ã¡ã³ããªã¹ããµã€ãº ãµã€ãº
ãªã¹ããã¡ã€ã«ãæŽæ°ããŠãæ倧ã§å«ãŸããããã«ããŸã ãµã€ãº ã»ã°ã¡ã³ãã 0ã®å Žåããªã¹ããã¡ã€ã«
ãã¹ãŠã®ã»ã°ã¡ã³ããå«ãŸããŸãã ããã©ã«ãå€ã¯0ã§ãã
ã»ã°ã¡ã³ããªã¹ããšã³ããªãã¬ãã£ãã¯ã¹ æ¥é èŸ
ããªãã³ã æ¥é èŸ åãšã³ããªã«ã 絶察ãã¹ãçæããã®ã«äŸ¿å©ã§ãã ããã©ã«ãã§ã¯ãã¬ãã£ãã¯ã¹ãªã
é©çšãããã
ã»ã°ã¡ã³ããªã¹ãã®çš®é¡ type
ãªã¹ã圢åŒãéžæããŸãã
次ã®å€ãèªèãããŸãã
ãã©ãããª
äœæãããã»ã°ã¡ã³ãã®ãã©ãããªã¹ãããXNUMXè¡ã«XNUMXã»ã°ã¡ã³ããã€çæããŸãã
csvã EXT
äœæãããã»ã°ã¡ã³ãã®ãªã¹ããçæããŸããåè¡ãäžèŽãããè¡ããšã«XNUMXã€ã®ã»ã°ã¡ã³ãã§ãã
圢åŒïŒã«ã³ãåºåãå€ïŒïŒ
ã ã
ã»ã°ã¡ã³ã_ãã¡ã€ã«å ã¯ãmuxerã«ãã£ãŠçæãããåºåãã¡ã€ã«ã®ååã§ãã
æäŸããããã¿ãŒã³ã«ã CSVãšã¹ã±ãŒãïŒRFC4180ã«æºæ ïŒã¯ã次ã®å Žåã«é©çšãããŸãã
å¿ èŠã
ã»ã°ã¡ã³ãéå§æå» ãš ã»ã°ã¡ã³ãçµäºæé ã»ã°ã¡ã³ãã®éå§æå»ãšçµäºæå»ãæå®ããŸã
ç§åäœã§è¡šãããŸãã
æ¥å°ŸèŸãã.csvããŸãã¯ã.extãã®ãªã¹ããã¡ã€ã«ã¯ããã®åœ¢åŒãèªåéžæããŸãã
EXT è³æãŸãã¯éæšå¥šã§ã csvãã¡ã€ã«.
ffconcat
äœæããã»ã°ã¡ã³ãã®ffconcatãã¡ã€ã«ãçæããŸãã çµæã®ãã¡ã€ã«ãèªã¿åãããšãã§ããŸã
FFmpegã䜿çšãã é£çµ demuxerã
æ¥å°ŸèŸãã.ffcatããŸãã¯ã.ffconcatãã®ãªã¹ããã¡ã€ã«ã¯ããã®åœ¢åŒãèªåéžæããŸãã
m3u8
ã«æºæ ããæ¡åŒµM3U8ãã¡ã€ã«ããŒãžã§ã³3ãçæããŸã
<http://tools.ietf.org/id/draft-pantos-http-live-streaming>.
æ¥å°ŸèŸã.m3u8ããä»ãããªã¹ããã¡ã€ã«ã¯ããã®åœ¢åŒãèªåéžæããŸãã
æå®ããªãå Žåãã¿ã€ãã¯ãªã¹ããã¡ã€ã«åã®ãµãã£ãã¯ã¹ããæšæž¬ãããŸãã
ã»ã°ã¡ã³ãæé æé
ã»ã°ã¡ã³ãæéãã«èšå® æéãå€ã¯æéã®æå®ã§ããå¿ èŠããããŸãã ãã£ãã©ã«ã
å€ã¯ã2ãã§ãã ãåç §ããŠãã ãã ã»ã°ã¡ã³ãæé ãªãã·ã§ã³ãéžæããŸãã
åç §ã¹ããªãŒã ããŒã匷å¶ããªãéããåå²ã¯æ£ç¢ºã§ãªãå¯èœæ§ãããããšã«æ³šæããŠãã ãã-
æå®ãããæéã®ãã¬ãŒã ã 玹ä»éç¥ãšä»¥äžã®äŸãåç §ããŠãã ããã
ã»ã°ã¡ã³ãæå» 1 | 0
ã1ãã«èšå®ãããšã00ïŒ00ããå§ãŸãäžå®ã®æéééã§åå²ãããŸãã NS
æé ã§æå®ãããå€ ã»ã°ã¡ã³ãæé åå²ã®é·ããèšå®ããããã«äœ¿çšãããŸã
ééã
ããšãã° ã»ã°ã¡ã³ãæé ã900ãã«èšå®ãããšã次ã®å Žæã§ãã¡ã€ã«ãäœæã§ããŸãã
12æã00æ12åã15æ12åãªã©ã
ããã©ã«ãå€ã¯ã0ãã§ãã
ã»ã°ã¡ã³ãæéãã«ã¿ ãã«ã¿
ã»ã°ã¡ã³ãã®éå§æå»ãéžæãããšãã«ã粟床æéãæå®ããŸãã
æéã®æå®ã ããã©ã«ãå€ã¯ã0ãã§ãã
ãã«ã¿ãæå®ãããŠããå Žåããã®PTSãæ¡ä»¶ãæºããå ŽåãããŒãã¬ãŒã ã¯æ°ããã»ã°ã¡ã³ããéå§ããŸãã
é¢ä¿ïŒ
PTS> = start_time --time_delta
ãã®ãªãã·ã§ã³ã¯ãGOPã§åžžã«åå²ããããããªã³ã³ãã³ããåå²ãããšãã«åœ¹ç«ã¡ãŸã
æå®ãããåå²æéã®çŽåã«ããŒãã¬ãŒã ãèŠã€ãã£ãå Žåã®å¢çã
ç¹ã«ã ffmpeg ãªãã·ã§ã³ ãã©ãŒã¹ããŒãã¬ãŒã ãéžæããŸãã
ã«ãã£ãŠæå®ãããããŒãã¬ãŒã æé ãã©ãŒã¹ããŒãã¬ãŒã ã®ãããæ£ç¢ºã«èšå®ã§ããªãå ŽåããããŸã
äžžãã®åé¡ããã®çµæãããŒãã¬ãŒã æéãçŽåã«èšå®ãããå¯èœæ§ããããŸãã
æå®ãããæéã äžå®ã®ãã¬ãŒã ã¬ãŒãã®ãããªã®å Žåãå€ã¯1 /ïŒ2 *ãã¬ãŒã ã¬ãŒã) ãã¹ã
æå®ãããæéãšã«ãã£ãŠèšå®ãããæéã®éã®ææªã®å Žåã®äžäžèŽã«å¯ŸåŠããŸã
ãã©ãŒã¹ããŒãã¬ãŒã .
ã»ã°ã¡ã³ãæé <font style="vertical-align: inherit;">åæ°</font>
åå²ç¹ã®ãªã¹ããæå®ããŸãã <font style="vertical-align: inherit;">åæ°</font> ã«ã³ãåºåãã®æéã®ãªã¹ããå«ãŸããŠããŸã
ä»æ§ãæé ã ãåç §ããŠãã ãã ã»ã°ã¡ã³ãæé ãªãã·ã§ã³ãéžæããŸãã
ã»ã°ã¡ã³ã_ãã¬ãŒã ãã¬ãŒã
åå²ãããªãã¬ãŒã çªå·ã®ãªã¹ããæå®ããŸãã ãã¬ãŒã ã«ã³ãåºåãã®ãªã¹ããå«ãŸããŠããŸã
æŽæ°ãæé ã
ãã®ãªãã·ã§ã³ã¯ãåç §ã¹ããªãŒã ã®ããŒãã¬ãŒã ã
ãèŠã€ããããã¬ãŒã ã®é£ç¶çªå·ïŒ0ããéå§ïŒã次ã®å€ä»¥äžã§ãã
ãªã¹ãå ã®æ¬¡ã®å€ã
ã»ã°ã¡ã³ã_ã©ãã å¶é
ã»ã°ã¡ã³ãã€ã³ããã¯ã¹ã«å°éããããã©ããã¢ã©ãŠã³ãããŸã å¶é.
ã»ã°ã¡ã³ãéå§çªå· æ°
æåã®ã»ã°ã¡ã³ãã®ã·ãŒã±ã³ã¹çªå·ãèšå®ããŸãã ããã©ã«ãã¯0ã§ãã
ã¹ãã©ãã¿ã€ã 1 | 0
ãstrftimeãé¢æ°ã䜿çšããŠãæžã蟌ãæ°ããã»ã°ã¡ã³ãã®ååãå®çŸ©ããŸãã ãããªã
ãéžæãããŠããå Žåãåºåã»ã°ã¡ã³ãåã«ã¯ãstrftimeãé¢æ°ãã³ãã¬ãŒããå«ãŸããŠããå¿ èŠããããŸãã
ããã©ã«ãå€ã¯0ã§ãã
ãã¬ãŒã¯éããŒãã¬ãŒã 1 | 0
æå¹ã«ãªã£ãŠããå Žåã¯ãããŒãã¬ãŒã 以å€ã®ãã¬ãŒã ã§ã»ã°ã¡ã³ããéå§ã§ããããã«ããŸãã ããã¯æ¹åããŸã
ããŒãã¬ãŒã éã®æéãäžè²«ããŠããªãå Žåã®äžéšã®ãã¬ãŒã€ãŒã®åäœ
ä»ã®äººã«ãšã£ãŠã¯äºæ ãæªåããã·ãŒã¯äžã«å¥åŠãªããšãèµ·ããå¯èœæ§ããããŸãã ããã©ã«ãã¯0ã§ãã
ãªã»ããã¿ã€ã ã¹ã¿ã³ã 1 | 0
åã»ã°ã¡ã³ãã®å é ã§ã¿ã€ã ã¹ã¿ã³ãããªã»ããããŠãåã»ã°ã¡ã³ããã§å§ãŸãããã«ããŸã
ã»ãŒãŒãã®ã¿ã€ã ã¹ã¿ã³ãã ããã¯ãçæãããã»ã°ã¡ã³ãã®åçã容æã«ããããšãç®çãšããŠããŸãã XNUMXæ
ãã«ããã¬ã¯ãµ/ã³ãŒããã¯ã®ããã€ãã®çµã¿åããã§ã¯æ©èœããŸããã ããã©ã«ãã§ã¯0ã«èšå®ãããŠããŸãã
åæãªãã»ãã ãªãã»ãã
åºåãã±ããã®ã¿ã€ã ã¹ã¿ã³ãã«é©çšããã¿ã€ã ã¹ã¿ã³ããªãã»ãããæå®ããŸãã åŒæ°ã¯ããå¿ èŠããããŸã
æéã®æå®ã§ãããããã©ã«ãã¯0ã§ãã
äŸ
ã»ãã¡ã€ã«ã®å 容ãåå€éåãã in.mkv ã»ã°ã¡ã³ãã®ãªã¹ãã« out-000.nut, out-001.nutãªã©
çæãããã»ã°ã¡ã³ãã®ãªã¹ããã«æžã蟌ã¿ãŸã ã¢ãŠããªã¹ã:
ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.list outïŒ 03d.nut
ã»ã»ã°ã¡ã³ãå ¥åããã³åºåã»ã°ã¡ã³ãã®åºåãã©ãŒããããªãã·ã§ã³ã®èšå®ïŒ
ffmpeg -i in.mkv -f segment -segment_time 10 -segment_format_options movflags = + faststart outïŒ 03d.mp4
ã»æå®ãããåå²ç¹ã«åŸã£ãŠå ¥åãã¡ã€ã«ãã»ã°ã¡ã³ãåããŸãã ã»ã°ã¡ã³ãæé
ãªãã·ã§ã³ïŒ
ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 outïŒ 03d.nut
ã» äœ¿çš ffmpeg ãã©ãŒã¹ããŒãã¬ãŒã ã§å ¥åã«ããŒãã¬ãŒã ã匷å¶ãããªãã·ã§ã³
æå®ãããå Žæãšã»ã°ã¡ã³ããªãã·ã§ã³ ã»ã°ã¡ã³ãæéãã«ã¿ ã説æãã
ããŒãã¬ãŒã æéãèšå®ãããšãã«æäœãããå¯èœæ§ã®ããäžžãã
ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -codecïŒv mpeg4 -codecïŒa pcm_s16le -map 0 \
-f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 outïŒ 03d.nut
å ¥åãã¡ã€ã«ã«ããŒãã¬ãŒã ã匷å¶ããã«ã¯ããã©ã³ã¹ã³ãŒãã£ã³ã°ãå¿ èŠã§ãã
ã»ãã¬ãŒã çªå·ã«åŸã£ãŠå ¥åãã¡ã€ã«ãåå²ããããšã«ãããå ¥åãã¡ã€ã«ãã»ã°ã¡ã³ãåããŸã
ã§æå®ãããã·ãŒã±ã³ã¹ ã»ã°ã¡ã³ã_ãã¬ãŒã ãªãã·ã§ã³ïŒ
ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_frames 100,200,300,500,800 outïŒ 03d.nut
ã»å€æ in.mkv ãlibx264ãããã³ãlibfaacããšã³ã³ãŒããŒã䜿çšããŠTSã»ã°ã¡ã³ãã«ïŒ
ffmpeg -i in.mkv -map 0 -codecïŒv libx264 -codecïŒa libfaac -f ssegment -segment_list out.list outïŒ 03d.ts
ã»å ¥åãã¡ã€ã«ãã»ã°ã¡ã³ãåããM3U8ã©ã€ããã¬ã€ãªã¹ããäœæããŸãïŒã©ã€ãHLSãšããŠäœ¿çšã§ããŸãïŒ
ãœãŒã¹ïŒïŒ
ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_listplaylist.m3u8 \
-segment_list_flags + live -segment_time 10 outïŒ 03d.mkv
ã¹ã ãŒãºã¹ããªãŒãã³ã°
Smooth Streaming muxerã¯ãé ä¿¡ã«é©ããäžé£ã®ãã¡ã€ã«ïŒãããã§ã¹ãããã£ã³ã¯ïŒãçæããŸã
åŸæ¥ã®WebãµãŒããŒã§ã
ãŠã£ã³ããŠãµã€ãº
ãããã§ã¹ãã«ä¿æããããã©ã°ã¡ã³ãã®æ°ãæå®ããŸãã ããã©ã«ãã¯0ïŒãã¹ãŠä¿æïŒã
ãšã¯ã¹ãã©ãŠã£ã³ããŠãµã€ãº
ãããã§ã¹ãããåé€ããåã«ãããã§ã¹ãã®å€éšã«ä¿æããããã©ã°ã¡ã³ãã®æ°ãæå®ããŸã
ãã£ã¹ã¯ã ããã©ã«ã5ã
å èªã¿åæ°
å èªã¿ãã©ã°ã¡ã³ãã®æ°ãæå®ããŸãã ããã©ã«ã2ã
min_frag_duration
æå°ãã©ã°ã¡ã³ãæéïŒãã€ã¯ãç§åäœïŒãæå®ããŸãã ããã©ã«ãã¯5000000ã§ãã
åºå£ã§åé€
çµäºæã«ãã¹ãŠã®ãã©ã°ã¡ã³ããåé€ãããã©ãããæå®ããŸãã ããã©ã«ãã¯0ïŒåé€ããªãã§ãã ããïŒã
tee
ãã£ãŒãã«ããã¬ã¯ãµã䜿çšããŠãåãããŒã¿ãè€æ°ã®ãã¡ã€ã«ãŸãã¯ãã®ä»ã®çš®é¡ã®ãã¡ã€ã«ã«æžã蟌ãããšãã§ããŸã
ãã«ããã¬ã¯ãµã ããšãã°ããããªããããã¯ãŒã¯ã«ã¹ããªãŒãã³ã°ããããä¿åãããããããã«äœ¿çšã§ããŸãã
åæã«ãã£ã¹ã¯ã
ããã¯ãè€æ°ã®åºåãæå®ããããšãšã¯ç°ãªããŸãã ffmpeg ã³ãã³ãã©ã€ã³ããŒã«ã®çç±
ãªãŒãã£ãªããã³ãããªããŒã¿ã¯ããã£ãŒãã«ããã¬ã¯ãµã§XNUMXåã ããšã³ã³ãŒããããŸãã ãšã³ã³ãŒãã£ã³ã°ã¯
éåžžã«é«äŸ¡ãªããã»ã¹ã libavformat APIãçŽæ¥äœ¿çšããå Žåã¯ã圹ã«ç«ããªãããã§ãã
ãã®åŸãåããã±ãããè€æ°ã®ãã«ããã¬ã¯ãµã«çŽæ¥ãã£ãŒãããããšãã§ããŸãã
ã¹ã¬ãŒãåºåã¯ããã«ããã¬ã¯ãµã«ä»ãããããã¡ã€ã«åã§ã|ãã§åºåãããŠæå®ãããŸãã ããã
ã¹ã¬ãŒãåã®ããããã«ã|ããå«ãŸããŠããŸãã»ãã¬ãŒã¿ãå é ãŸãã¯æ«å°Ÿã®ã¹ããŒã¹ããŸãã¯
ç¹æ®æåããšã¹ã±ãŒãããå¿ èŠããããŸãïŒãåç §ïŒ ã ãåŒçš ãš éããã in ã
ffmpeg-utils(1) ããã¥ã¢ã«).
Muxerãªãã·ã§ã³ã¯ãã¹ã¬ãŒãããšã«ãªã¹ããšããŠè¿œå ããããšã§æå®ã§ããŸãã ããŒ=å€
è§ãã£ãã§å²ãŸãããïŒãã§åºåããããã¢ã ãªãã·ã§ã³å€ã«ç¹å¥ãªå€ãå«ãŸããŠããå Žå
æåãŸã㯠'ïŒ'åºåãæåããããã¯ãšã¹ã±ãŒãããå¿ èŠããããŸãã ããã¯ç¬¬XNUMXã¬ãã«ã§ããããšã«æ³šæããŠãã ãã
è±åºã
次ã®ç¹å¥ãªãªãã·ã§ã³ãèªèãããŸãã
f ãã©ãŒãããåãæå®ããŸãã åºååã®ãµãã£ãã¯ã¹ããæšæž¬ã§ããªãå Žåã«äŸ¿å©ã§ãã
bsfs [/ã¹ããã¯]
æå®ãããåºåã«é©çšãããããã¹ããªãŒã ãã£ã«ã¿ãŒã®ãªã¹ããæå®ããŸãã
ç¹å®ã®ãããã¹ããªãŒã ãã£ã«ã¿ãŒãé©çšããã¹ããªãŒã ãæå®ããããšãã§ããŸãã
ã/ãã§åºåããããªãã·ã§ã³ã«ã¹ããªãŒã æå®åãè¿œå ããŸãã ã¹ãã㯠ã¹ããªãŒã ã§ããå¿ èŠããããŸã
æå®åïŒãåç §ïŒ ãã©ãŒããã æµã æå®åïŒã ã¹ããªãŒã æå®åãæå®ãããŠããªãå Žåã
ãããã¹ããªãŒã ãã£ã«ã¿ãŒã¯ãåºåå ã®ãã¹ãŠã®ã¹ããªãŒã ã«é©çšãããŸãã
ãããã§åºåã£ãŠãããã€ãã®ãããã¹ããªãŒã ãã£ã«ã¿ãŒãæå®ã§ããŸãã
select
ã¹ããªãŒã ã§æå®ããããã¹ã¬ãŒãåºåã«ãããããå¿ èŠãããã¹ããªãŒã ãéžæããŸã
æå®åã æå®ããªãå Žåãããã¯ããã©ã«ãã§ãã¹ãŠã®å ¥åã¹ããªãŒã ã«ãªããŸãã
äŸ
ã»äœãããšã³ã³ãŒãããWebMãã¡ã€ã«ã«ã¢ãŒã«ã€ãããŠMPEG-TS overUDPãšããŠã¹ããªãŒãã³ã°ãã
ïŒã¹ããªãŒã ã¯æ瀺çã«ãããã³ã°ããå¿ èŠããããŸãïŒïŒ
ffmpeg -i ... -cïŒv libx264 -cïŒa mp2 -f tee -map 0ïŒv -map 0ïŒa
"archive-20121107.mkv | [f = mpegts] udpïŒ//10.0.1.255ïŒ1234 /"
㻠䜿çšãã ffmpeg å ¥åããšã³ã³ãŒãããåºåãXNUMXã€ã®ç°ãªãå®å ã«éä¿¡ããŸãã
ãdump_extraããããã¹ããªãŒã ãã£ã«ã¿ãŒã¯ããã¹ãŠã®
MPEG-TS圢åŒã®èŠæ±ã«å¿ããŠããããªããŒãã¬ãŒã ãã±ãããåºåããŸãã éžæãªãã·ã§ã³
ã«é©çšãããŸã out.aac ãªãŒãã£ãªãã±ããã®ã¿ãå«ããããã
ffmpeg -i ... -map 0 -flags + global_header -cïŒv libx264 -cïŒa aac -strict Experimental
-f tee "[bsfs / v = dump_extra] out.ts | [movflags = + faststart] out.mp4 | [select = a] out.aac"
ã»ä»¥äžã®ãšããã§ããããªãŒãã£ãªåºåã«ã¯ã¹ããªãŒã ãaïŒ1ãã®ã¿ãéžæããŠãã ããã XNUMXçªç®ã®ã¬ãã«ã«æ³šæããŠãã ãã
ãïŒãã¯ãªãã·ã§ã³ãåºåãããã«äœ¿çšãããç¹æ®æåã§ããããããšã¹ã±ãŒããå®è¡ããå¿ èŠããããŸãã
ffmpeg -i ... -map 0 -flags + global_header -cïŒv libx264 -cïŒa aac -strict Experimental
-f tee "[bsfs / v = dump_extra] out.ts | [movflags = + faststart] out.mp4 | [select = \ 'aïŒ1 \'] out.aac"
泚ïŒäžéšã®ã³ãŒããã¯ã§ã¯ãåºå圢åŒã«å¿ããŠç°ãªããªãã·ã§ã³ãå¿ èŠã«ãªãå ŽåããããŸãã èªå-
ããã®æ€åºã¯ãã£ãŒãã«ããã¬ã¯ãµã§ã¯æ©èœããŸããã äž»ãªäŸã¯ ã°ããŒãã«ããããŒ
ãã©ã°ã
webm_dash_manifest
WebMDASHãããã§ã¹ããã«ããã¬ã¯ãµã
ãã®ãã«ããã¬ã¯ãµã¯ãWebM DASHãããã§ã¹ãä»æ§ãå®è£ ããŠãDASHãããã§ã¹ããçæããŸã
XMLã ãŸããDASHã©ã€ãã¹ããªãŒã ã®ãããã§ã¹ãçæããµããŒãããŠããŸãã
詳现ã«ã€ããŠã¯ã以äžãåç §ããŠãã ããã
ã»WebM DASHä»æ§ïŒ
<https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification>
ã»ISO DASHä»æ§ïŒ
<http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip>
ãªãã·ã§ã³
ãã®ãã«ããã¬ã¯ãµã¯ã次ã®ãªãã·ã§ã³ããµããŒãããŠããŸãã
Adaptation_sets
ãã®ãªãã·ã§ã³ã®æ§æã¯æ¬¡ã®ãšããã§ãã "id = xãstreams = aãbãc id = yãstreams = dãe"ããã§ãx
ããã³yã¯é©å¿ã»ããã®äžæã®èå¥åã§ãããaãbãcãdããã³eã¯
察å¿ãããªãŒãã£ãªããã³ãããªã¹ããªãŒã ã®ã€ã³ããã¯ã¹ã ä»»æã®æ°ã®é©å¿ã»ãã
ãã®ãªãã·ã§ã³ã䜿çšããŠè¿œå ã§ããŸãã
ã©ã€ã
ããã1ã«èšå®ãããšãã©ã€ãã¹ããªãŒã ã®DASHãããã§ã¹ããäœæãããŸãã ããã©ã«ãïŒ0ã
ãã£ã³ã¯ã¹ã¿ãŒãã€ã³ããã¯ã¹
æåã®ãã£ã³ã¯ã®éå§ã€ã³ããã¯ã¹ã ãã㯠éå§çªå· ã®å±æ§
ã»ã°ã¡ã³ã ãã³ãã¬ãŒã ãããã§ã¹ãã®èŠçŽ ã ããã©ã«ãïŒ0ã
ãã£ã³ã¯ãã¥ã¬ãŒã·ã§ã³_ms
ããªç§åäœã®åãã£ã³ã¯ã®æéã ãã㯠ãã¥ã¬ãŒã·ã§ã³ ã®å±æ§
ã»ã°ã¡ã³ã ãã³ãã¬ãŒã ãããã§ã¹ãã®èŠçŽ ã ããã©ã«ãïŒ1000ã
utc_timing_url
UTCã¿ã€ã ã¹ã¿ã³ããISO圢åŒã§è¿ãããŒãžã®URLã ããã¯
å€ ã®å±æ§ UTCã¿ã€ãã³ã° ãããã§ã¹ãã®èŠçŽ ã ããã©ã«ãïŒãªãã
time_shift_buffer_ Depth
è¡šçŸãä¿èšŒãããŠããæå°æéïŒç§åäœïŒã®ã·ãããããã¡ãŒ
å©çšå¯èœã«ãªããŸãã ãã㯠ã¿ã€ã ã·ãããããã¡æ·±åºŠ ã®å±æ§ MPD
ãšã¬ã¡ã³ãã ããã©ã«ãïŒ60ã
æå°æŽæ°æé
ãããã§ã¹ãã®æå°æŽæ°æéïŒç§åäœïŒã ããã¯
æå°æŽæ°æé ã®å±æ§ MPD ãšã¬ã¡ã³ãã ããã©ã«ãïŒ0ã
äŸ
ffmpeg -f webm_dash_manifest -i video1.webm \
-f webm_dash_manifest -i video2.webm \
-f webm_dash_manifest -i audio1.webm \
-f webm_dash_manifest -i audio2.webm \
-ããã 0 -ããã 1 -ããã 2 -ããã 3 \
-cã³ããŒ\
-f webm_dash_manifest \
-adaptation_sets "id = 0ãstreams = 0,1 id = 1ãstreams = 2,3" \
ãããã§ã¹ã.xml
webm_chunk
WebM Live ChunkMuxerã
ãã®ãã«ããã¬ã¯ãµã¯ãWebMããããŒãšãã£ã³ã¯ãåå¥ã®ãã¡ã€ã«ãšããŠæžãåºããŸãã
DASHãä»ããŠWebMã©ã€ãã¹ããªãŒã ããµããŒãããã¯ã©ã€ã¢ã³ãã
ãªãã·ã§ã³
ãã®ãã«ããã¬ã¯ãµã¯ã次ã®ãªãã·ã§ã³ããµããŒãããŠããŸãã
ãã£ã³ã¯ã¹ã¿ãŒãã€ã³ããã¯ã¹
æåã®ãã£ã³ã¯ã®ã€ã³ããã¯ã¹ïŒããã©ã«ãã¯0ïŒã
ããã
åæåããŒã¿ãæžã蟌ãŸããããããŒã®ãã¡ã€ã«åã
audio_chunk_duration
ããªç§åäœã®åãªãŒãã£ãªãã£ã³ã¯ã®ç¶ç¶æéïŒããã©ã«ãã¯5000ïŒã
äŸ
ffmpeg -f v4l2 -i / dev / video0 \
-f alsa -i hwïŒ0 \
-ããã0ïŒ0 \
-cïŒv libvpx-vp9 \
-s 640x360 -keyint_min 30 -g 30 \
-f webm_chunk \
-ããããŒwebm_live_video_360.hdr\
-chunk_start_index 1 \
webm_live_video_360_ïŒ d.chk \
-ããã1ïŒ0 \
-cïŒa libvorbis \
-bïŒa 128k \
-f webm_chunk \
-ããããŒwebm_live_audio_128.hdr\
-chunk_start_index 1 \
-audio_chunk_duration 1000 \
webm_live_audio_128_ïŒ d.chk
METADATA
FFmpegã¯ãã¡ãã£ã¢ãã¡ã€ã«ããåçŽãªUTF-8ã§ãšã³ã³ãŒããããINIã®ãããªããã¹ãã«ã¡ã¿ããŒã¿ããã³ãããããšãã§ããŸã
ãã¡ã€ã«ãäœæããã¡ã¿ããŒã¿muxer / demuxerã䜿çšããŠããŒããçŽããŸãã
ãã¡ã€ã«åœ¢åŒã¯æ¬¡ã®ãšããã§ãã
1.ãã¡ã€ã«ã¯ãããããŒãšãã»ã¯ã·ã§ã³ã«åå²ãããããã€ãã®ã¡ã¿ããŒã¿ã¿ã°ã§æ§æãããŸãã
ç¬èªã®ã©ã€ã³ã§ã
2.ããããŒã¯ ; FFMETADATA æååã®åŸã«ããŒãžã§ã³çªå·ïŒçŸåšã¯1ïŒãç¶ããŸãã
3.ã¡ã¿ããŒã¿ã¿ã°ã®åœ¢åŒã¯ key = value
4.ããããŒãã°ããŒãã«ã¡ã¿ããŒã¿ã«ç¶ãçŽåŸ
5.ã°ããŒãã«ã¡ã¿ããŒã¿ã®åŸã«ãã¹ããªãŒã ããš/ãã£ãã¿ãŒããšã®ã¡ã¿ããŒã¿ãæã€ã»ã¯ã·ã§ã³ãååšããå ŽåããããŸãã
6.ã»ã¯ã·ã§ã³ã¯ã倧æåã®ã»ã¯ã·ã§ã³åïŒSTREAMãŸãã¯CHAPTERïŒã§å§ãŸããŸãã
è§ãã£ãïŒ[, ]ïŒãããŠæ¬¡ã®ã»ã¯ã·ã§ã³ãŸãã¯ãã¡ã€ã«ã®çµããã§çµãããŸãã
7.ç« ã®ã»ã¯ã·ã§ã³ã®åé ã«ã次ã®ç®çã§äœ¿çšããããªãã·ã§ã³ã®ã¿ã€ã ããŒã¹ãããå ŽåããããŸãã
éå§/çµäºå€ã ããã¯åœ¢ã§ãªããã°ãªããŸãã ã¿ã€ã ããŒã¹=NUM/æ¥ããã§ã NUM ãš æ¥ ã¯æŽæ°ã§ãã
ã¿ã€ã ããŒã¹ãæ¬ èœããŠããå Žåãéå§/çµäºæéã¯ããªç§åäœã§ãããšèŠãªãããŸãã
次ã«ããã£ãã¿ãŒã»ã¯ã·ã§ã³ã«ã¯ããã£ãã¿ãŒã®éå§æå»ãšçµäºæå»ããã©ãŒã ã«å«ãŸããŠããå¿ èŠããããŸã =ã¹ã¿ãŒãNUM,
END =NUMããã§ã NUM ã¯æ£ã®æŽæ°ã§ãã
8.空ã®è¡ãšã§å§ãŸãè¡ ; or # ç¡èŠãããŸãã
9.ã¡ã¿ããŒã¿ããŒãŸãã¯ç¹æ®æåãå«ãå€ïŒ=, ;, #, \ ããã³æ¹è¡ïŒã¯
ããã¯ã¹ã©ãã·ã¥ã§ãšã¹ã±ãŒããã \.
10.ã¡ã¿ããŒã¿ã®ç©ºçœã«æ³šæããŠãã ããïŒäŸïŒ foo = ããŒïŒã¯ã®äžéšãšèŠãªãããŸã
ã¿ã°ïŒäžèšã®äŸã§ã¯ãããŒã¯ foo ãå€ã¯
ããŒ).
ffmetadataãã¡ã€ã«ã¯æ¬¡ã®ããã«ãªããŸãã
; FFMETADATA1
title = Bike \\ shed
;ããã¯ã³ã¡ã³ãã§ã
ã¢ãŒãã£ã¹ã= FFmpegãããŒã«ããŒã
[ç« ]
ã¿ã€ã ããŒã¹= 1/1000
START = 0
#chapterã¯0:01:00ã«çµäºããŸã
END = 60000
ã¿ã€ãã«=ç« \ïŒ1
[ã¹ããªãŒã ]
title = multi \
ã©ã€ã³
ffmetadata muxerãšdemuxerã䜿çšããããšã«ãããå ¥åããã¡ã¿ããŒã¿ãæœåºããããšãã§ããŸãã
ãã¡ã€ã«ãffmetadataãã¡ã€ã«ã«å€æããŠããããã¡ã€ã«ãåºåãã¡ã€ã«ã«ãã©ã³ã¹ã³ãŒãããŸãã
ffmetadataãã¡ã€ã«ãç·šéããŸããã
ã§ffmetadataãã¡ã€ã«ãæœåºãã ffmpeg 次ã®ããã«ãªããŸãïŒ
ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
ç·šéããã¡ã¿ããŒã¿æ å ±ãFFMETADATAFILEãã¡ã€ã«ããåæ¿å ¥ããã«ã¯ã次ã®ããã«ããŸãã
ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
onworks.net ãµãŒãã¹ã䜿çšããŠãªã³ã©ã€ã³ã§ ffmpeg 圢åŒã䜿çšãã