这篇文章的原文地址是:http://www.videoproductionslondon.com/blog/scene-change-detection-during-encoding-key-frame-extraction-code
里面主要介绍了如何提取视频关键帧,以及视频关键帧的时间点信息,这样就能做出各大视频网站的那种:点击视频下方进度条,显示该时间点附近关键帧图片的效果。
老外还是太牛,真心是佩服。
部分代码:
<span class="notranslate" onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">ffmpeg -vf select="eq(pict_type\,PICT_TYPE_I)" -i yourvideo.mp4 -vsync 2 -s 73x41 -f image2 thumbnails-%02d.jpeg</span> ffmpeg的-vf选择=“EQ(pict_type \,PICT_TYPE_I)”-i yourvideo.mp4 -vsync 2 -s -f 73x41 IMAGE2 thumbnails-%02d.jpeg</span>
<span class="notranslate" onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">-loglevel debug 2>&1 | grep "pict_type:I -> select:1" | cut -d " " -f 6 - > keyframe-timecodes.txt</span> -loglevel调试2>&1 | grep的“pict_type:我 - >选择:1”|切-d“”-f 6 - >关键帧timecodes.txt</span>
<span class="notranslate" onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">[select @ 0000000001A88BE0] n:0 pts:0 t:0.000000 pos:1953 interlace_type:P key:0 pict_type:I -> select:1.000000</span> [选择@ 0000000001A88BE0] N:0分:0 T:0.000000 POS:1953年interlace_type:P键:0 pict_type:我 - >选择:1.000000</span>
<span class="notranslate" onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">[select @ 0000000001A88BE0] n:1 pts:40000 t:0.040000 pos:4202 interlace_type:P key:0 pict_type:P -> select:0.000000</span> [选择@ 0000000001A88BE0] N:1点:40000电话:0.040000 POS:4202 interlace_type:P键:0 pict_type:P - >选择:0.000000</span>
<span class="notranslate" onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">t:0.000000</span> T:0.000000</span>
<span class="notranslate" onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">t:1.360000</span> T:1.360000</span>
<
span
class
=
"notranslate"
onmouseover
=
"_tipon(this)"
onmouseout
=
"_tipoff()"
><
span
class
=
"google-src-text"
style
=
"direction: ltr; text-align: left"
><
a
onclick
=
"jwplayer().seek(0); return false"
href
=
"#"
><
img
src
=
"thumbnails-01.jpeg"
></
a
></
span
> <
a
onclick
=
"jwplayer().seek(0);返回false"
href
=
"#"
> <
IMG
SRC =“缩略图-01.jpeg”> </
A
></
span
>
<
span
class
=
"notranslate"
onmouseover
=
"_tipon(this)"
onmouseout
=
"_tipoff()"
><
span
class
=
"google-src-text"
style
=
"direction: ltr; text-align: left"
><
a
onclick
=
"jwplayer().seek(1.36); return false"
href
=
"#"
><
img
src
=
"thumbnails-02.jpeg"
></
a
></
span
> <
a
onclick
=
"jwplayer().seek(1.36);返回false"
href
=
"#"
> <
IMG
SRC =“缩略图-02.jpeg”> </
A
></
span
>
|