ChinaFFmpeg

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 12482|回复: 4

[Windows] 怎么才能让水印滚动呢

[复制链接]
发表于 2016-4-18 00:17:01 | 显示全部楼层 |阅读模式
本帖最后由 hy945 于 2016-4-18 00:18 编辑

ffplay -i jidu.mp4  -vf "movie=logo.png[logo];[in][logo]overlay=x='if(gte(t\,2)\,((t-2)*80)-w\,NAN)':y=0 [out]" -c:v libx264 -c:a copy drawtext.mp4 用这个命令 一直报X轴参数错误@孙悟空



[overlay @ 031e7e40] [Eval @ 0028dd08] Undefined constant or missing '(' in 't-2)*80)-w\,NAN)'
Error when evaluating the expression 'x=if(gte(t\,2)\,((t-2)*80)-w\,NAN)'
Error opening filters!

回复

使用道具 举报

发表于 2016-4-19 18:49:45 | 显示全部楼层
[AppleScript] 纯文本查看 复制代码
ffmpeg -i ~/Movies/objectC/facebook.mp4 -i ~/Movies/guanlangaoshou.mp4 -vcodec libx264 -an -filter_complex "overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0" -s 320x240 output.mp4


输出内容如下:

[AppleScript] 纯文本查看 复制代码
[[email]StevenLiu@bbs.chiaffmpeg.com[/email] ffmpeg]$ ffmpeg -i ~/Movies/objectC/facebook.mp4 -i ~/Movies/guanlangaoshou.mp4 -vcodec libx264 -an -filter_complex "overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0" -s 320x240 output.mp4
ffmpeg version N-79068-g6b7ce0e Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --enable-libass --enable-opengl --enable-libx265 --enable-libx264 --enable-libmp3lame --enable-gpl --enable-libfaac --enable-nonfree --prefix=/usr/local
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 28.103 / 57. 28.103
  libavformat    57. 28.102 / 57. 28.102
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 39.102 /  6. 39.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/StevenLiu/Movies/objectC/facebook.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.22.102
    description     : This File is Created by Easy RealMedia Tools@!
  Duration: 02:00:27.85, start: 0.000000, bitrate: 893 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480, 797 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 87 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/StevenLiu/Movies/guanlangaoshou.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.36.100
  Duration: 00:05:29.67, start: 0.000000, bitrate: 1195 kb/s
    Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 480x268, 1038 kb/s, 24 fps, 24 tbr, 90k tbn, 48 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 148 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
File 'output.mp4' already exists. Overwrite ? [y/N] Y
[libx264 @ 0x7fd4a281d200] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x7fd4a281d200] profile High, level 1.3
[libx264 @ 0x7fd4a281d200] 264 - core 133 r2334M a3ac64b - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - [url]http://www.videolan.org/x264.html[/url] - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    description     : This File is Created by Easy RealMedia Tools@!
    encoder         : Lavf57.28.102
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 320x240, q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      encoder         : Lavc57.28.103 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream mapping:
  Stream #0:0 (h264) -> overlay:main
  Stream #1:0 (h264) -> overlay:overlay
  overlay -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
frame=  648 fps=288 q=-1.0 Lsize=     382kB time=00:00:25.84 bitrate= 121.2kbits/s speed=11.5x   


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 支持 反对

使用道具 举报

 楼主| 发表于 2016-4-20 02:26:56 | 显示全部楼层
本帖最后由 hy945 于 2016-4-20 02:31 编辑
孙悟空 发表于 2016-4-19 18:49
[mw_shl_code=applescript,true]ffmpeg -i ~/Movies/objectC/facebook.mp4 -i ~/Movies/guanlangaoshou.mp4 ...

谢谢大师兄,调试通过了,然后借鉴你发的图片转视频的帖子测试了下,jpg的图片可以通过,但是PNG的图片会显示下面用红色标注的错误信息,我主要想做一个透明的水印,能让他在视频上自定义地点滚动一段时间
C:\Users\Administrator>C:\Users\Administrator\Desktop\videocuty\ffmpeg -r 25 -lo
op 1 -y -i C:\Users\Administrator\Desktop\dd\333.png -pix_fmt yuv420p -vcodec li
bx264 -b:v 600k -r:v 25 -preset medium -crf 30 -s 720x576 -vframes 250 -r 25 -t
10 C:\Users\Administrator\Desktop\dd\123.mp4
ffmpeg version N-66352-g33c752b Copyright (c) 2000-2014 the FFmpeg developers
  built on Sep 19 2014 23:14:53 with gcc 4.9.1 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-lib
modplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge
r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --en
able-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-
libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.101 / 56.  1.101
  libavformat    56.  4.102 / 56.  4.102
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.101 /  5.  1.101
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
Input #0, png_pipe, from 'C:\Users\Administrator\Desktop\dd\333.png':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: png, rgba, 220x100 [SAR 11811:11811 DAR 11:5], 25 tbr, 2
5 tbn, 25 tbc
[libx264 @ 02b7d8e0] using SAR=44/25
[libx264 @ 02b7d8e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP
FMA4 FMA3 LZCNT BMI1
[libx264 @ 02b7d8e0] profile High, level 3.0
[libx264 @ 02b7d8e0] 264 - core 142 r2479 dd79a61 - H.264/MPEG-4 AVC codec - Cop
yleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deb
lock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 m
e_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chro
ma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1
interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scene
cut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=30.0 qcomp=0.60 qpmin
=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'C:\Users\Administrator\Desktop\dd\123.mp4':
  Metadata:
    encoder         : Lavf56.4.102
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 720x57
6 [SAR 44:25 DAR 11:5], q=-1--1, 600 kb/s, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.1.101 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> h264 (libx264))
Press [q] to stop, [?] for help
C:\Users\Administrator\Desktop\dd\333.png: Input/output error
    Last message repeated 1 times
frame=    1 fps=0.0 q=35.0 Lsize=       2kB time=00:00:00.04 bitrate= 354.4kbits
/s
video:1kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing ove
rhead: 85.939140%
[libx264 @ 02b7d8e0] frame I:1     Avg QP:21.29  size:   263
[libx264 @ 02b7d8e0] mb I  I16..4: 99.0%  0.9%  0.1%
[libx264 @ 02b7d8e0] 8x8 transform intra:0.9%
[libx264 @ 02b7d8e0] coded y,uvDC,uvAC intra: 0.4% 0.0% 0.0%
[libx264 @ 02b7d8e0] i16 v,h,dc,p: 89%  8%  3%  0%
[libx264 @ 02b7d8e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 40% 18% 23%  3%  2%  3%  7%
2%  2%
[libx264 @ 02b7d8e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 75% 12%  0%  6%  0%  0%  0%
6%  0%
[libx264 @ 02b7d8e0] i8c dc,h,v,p: 100%  0%  0%  0%
[libx264 @ 02b7d8e0] kb/s:52.6

回复 支持 反对

使用道具 举报

发表于 2016-4-20 10:05:27 | 显示全部楼层
hy945 发表于 2016-4-20 02:26
谢谢大师兄,调试通过了,然后借鉴你发的图片转视频的帖子测试了下,jpg的图片可以通过,但是PNG的图片会 ...

ffmpeg 为视频加入png半透明水印
http://bbs.chinaffmpeg.com/forum ... d=271&fromuid=3
(出处: ChinaFFmpeg)


参考一下这个
回复 支持 反对

使用道具 举报

 楼主| 发表于 2016-4-23 20:15:11 | 显示全部楼层
@孙悟空 大师兄 设置字体水印里面有没有给字体加粗或者描边的参数,翻译了官方文档,好乱看不懂了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|Archiver|ChinaFFmpeg

GMT+8, 2024-12-27 13:38 , Processed in 0.066777 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表