zoukankan      html  css  js  c++  java
  • VLC添加水印

    Name: LibVLC control API
    Description: VLC media player external control library
    Version: 2.1.3

    参照:https://stackoverflow.com/questions/15992874/logo-appears-for-only-a-second-and-then-disappears

    http://blog.csdn.net/myaccella/article/details/7027962?locationNum=8

    QWidget *m_widgetPlayer;

    libvlc_media_player_t *mp;
    libvlc_instance_t * inst;

    libvlc_media_t *m;

    //preparation of the vlc command
    QString pluginDir = QString("--plugin-path=") + QCoreApplication::applicationDirPath() + QString("/plugins/");

    const char * const vlc_args[] = {
    "-I", "dummy", /* Don't use any interface */
    //"--sub-filter=logo{file=c:\mediaport.png}:rss{urls=http://www.bbc.co.uk/persian/index.xml,length=120,size=23,title=0,speed=300000,x=-10,y=-30,position=8}",
    //"--sub-filter=logo{file=dummy}",
    //"--no-rss-images",
    "--sub-filter=logo",//必须要设置
    "--verbose", "0",
    //"--verbose-objects=+filter",
    //"-vvv",
    //"--sout=#duplicate{dst=std{access=mmsh,mux=asfh,dst=0.0.0.0:8080},dst=display}",
    "--ignore-config",
    //"--loop",
    //"--repeat",
    //"-R",
    "--no-video-title-show",
    //"--network-caching 20000",
    //":mmsh-caching=20000",
    pluginDir.toAscii()
    };

    int vlc_argc = sizeof(vlc_args) / sizeof(*vlc_args);

    inst = libvlc_new(vlc_argc, vlc_args);

    m = libvlc_media_new_path (inst, "cuc_ieschool.flv");
    mp = libvlc_media_player_new_from_media (m);

    libvlc_media_release (m);

    libvlc_media_player_set_hwnd (mp,winId);

    int x=libvlc_media_player_play (mp);

    connect(m_pbtPlay,SIGNAL(clicked()),this, SLOT(slot_FullScreen()));

    Sleep(1000);//必须要设置

    libvlc_video_set_logo_string(mp,libvlc_logo_file,"c:\audio.png");//Logo 文件名
    libvlc_video_set_logo_int(mp,libvlc_logo_x,0);  //logo的 X 坐标。
    libvlc_video_set_logo_int(mp,libvlc_logo_y,0); // logo的 Y 坐标。
    //libvlc_video_set_logo_int(mp,libvlc_logo_delay , 20);//标志的间隔图像时间为毫秒,图像显示间隔时间 0 - 60000 毫秒。
    libvlc_video_set_logo_int(mp,libvlc_logo_repeat, -1); // 标志logo的循环,  标志动画的循环数量。-1 = 继续, 0 = 关闭
    libvlc_video_set_logo_int(mp,libvlc_logo_opacity,122); // logo 透明度 (数值介于 0(完全透明) 与 255(完全不透明)
    //libvlc_video_set_logo_int(mp,libvlc_logo_position,0);//1 (左), 2 (右), 4 (顶部), 8 (底部), 5 (左上), 6 (右上), 9 (左下), 10 (右下),您也可以混合使用这些值,例如 6=4+2
              表示右上)。

    libvlc_video_set_logo_int(mp,libvlc_logo_enable, 1);//设置允许添加logo

  • 相关阅读:
    正则表达式
    内涵函数二
    内置函数
    生成器的推导式 表达式
    函数的闭包 迭代器的使用
    函数的动态参数,命名空间
    函数
    文件的操作
    set 集合 拷贝的操作
    u-boot简介
  • 原文地址:https://www.cnblogs.com/zhangxuan/p/7802992.html
Copyright © 2011-2022 走看看