首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何用节点JS和角JS实时显示水印

如何用节点JS和角JS实时显示水印
EN

Stack Overflow用户
提问于 2015-06-23 09:32:47
回答 1查看 1.8K关注 0票数 3

我和芬伯一起工作。我已经处理过由ffmpeg水印。在我的过程中,我保存了那个视频(它被标记为水印)&然后我能够显示那个视频。但我想实时显示水印。我怎么能做到这一点?这个实时节目需要帮助。

这是我的代码:

代码语言:javascript
运行
复制
        try {
            var process = new ffmpeg('public/'+req.body.video);
            process.then(function (video) {
              console.log('The video is ready to be processed');
              var watermarkPath = 'public/images/logo.png',
                newFilepath = 'public/videos/watermarked/'+name,
                settings = {
                    position        : "SC"      // Position: NE NC NW SE SC SW C CE CW
                  , margin_nord     : null      // Margin nord
                  , margin_sud      : null      // Margin sud
                  , margin_east     : null      // Margin east
                  , margin_west     : null      // Margin west
                };
              var callback = function (error, files) {
                if(error){
                  console.log('ERROR: ', error);
                }
                else{
                  console.log('TERMINOU', files);
                  res.send('videos/watermarked/'+name)
                }
              }
              //add watermark
              video.fnAddWatermark(watermarkPath, newFilepath, settings, callback)

            }, function (err) {
              console.log('Error: ' + err);
            });
          } catch (e) {
            console.log(e.code);
            console.log(e.msg);
          }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-08-05 20:04:14

代码语言:javascript
运行
复制
var process = new ffmpeg('public/'+req.body.video);
                    process.then(function (video) {
                        // console.log('The video is ready to be processed');
                        var watermarkPath = 'public/images/logo_2.png',
                            newFilepath = 'public/videos/watermarked/'+name,
                            settings = {
                                position        : "SC"      // Position: NE NC NW SE SC SW C CE CW
                                , margin_nord     : null      // Margin nord
                                , margin_sud      : null      // Margin sud
                                , margin_east     : null      // Margin east
                                , margin_west     : null      // Margin west
                            };
                        var callback = function (error, files) {
                            if(error){
                                console.log('ERROR: ', error);
                            }
                            else{
                                // console.log('TERMINOU', files);
                                res.send('videos/watermarked/'+name)
                            }
                        }
                        //add watermark
                        video.fnAddWatermark(watermarkPath, newFilepath, settings, callback)

                    }, function (err) {
                        console.log('Error: ' + err);
                    });
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30999052

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档