marquee stops working after add_option duplicate

This forum is about all development around libVLC.
skippyV
New Cone
New Cone
Posts: 5
Joined: 15 Mar 2015 20:29

marquee stops working after add_option duplicate

Postby skippyV » 09 Apr 2015 16:45

Hello, I posted this question in a different forum on videolan.org but it got no responses. Perhaps this question is more suited for this forum.

Using version libVLC 2.0.6 (x64 on Windows 7) to capture an RTSP camera stream and display it in a C# WPF app.
Goal is to play the video on the app while recording it to file and to put a custom marquee on the video.

If I uncomment the code for libvlc_media_add_option, then I get the video stream recorded to the file but I see no marquee.
Without the add_option I have no file (of course) but the marquee works as expected on the rendered stream.

So both functionalities work - just not together. I can see video rendered with the marquee OR I see video rendered and it's saved to file - but no marquee.

Here is a simple C Console Application version of the code made with Visual Studio.

Code: Select all

// Vlc_ConsoleApp.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <vlc/vlc.h> #include <windows.h> int _tmain(int argc, _TCHAR* argv[]) { libvlc_instance_t * inst; libvlc_media_player_t *mp; libvlc_media_t *m; char* arguments[] = { "-I", "dummy", "--ignore-config", "--no-video-title", "--sub-filter=marq", "--plugin-path=C:/Software_Development/Software_Libraries/VLC/vlc-2.0.6_x64/plugins"}; // you'll need to adjust this // you may need to adjust the output path char* duplicateStreamOption = ":sout=#stream_out_duplicate{dst=display,dst=std{access=file,sub-filter=marq,mux=ts,dst=c:/temp/test_go.mpg}}"; /* Load the VLC engine */ inst = libvlc_new (6, arguments); /* Create a new item */ m = libvlc_media_new_location (inst, "rtsp://@192.168.2.168"); // you'll need to change this to some media you have /* add option to record duplicate stream to file */ /* if I comment this out - then marquee works */ //libvlc_media_add_option(m, duplicateStreamOption); /* Create a media player playing environement */ mp = libvlc_media_player_new_from_media (m); /* No need to keep the media now */ libvlc_media_release (m); /* play the media_player */ libvlc_media_player_play (mp); Sleep (10000); /* Let it play for 10 seconds */ /* throw up a marquee */ libvlc_video_set_marquee_int(mp, libvlc_marquee_Enable, 1); libvlc_video_set_marquee_string(mp, libvlc_marquee_Text, "Hello- Marquee"); libvlc_video_set_marquee_int(mp, libvlc_marquee_Opacity, 50); libvlc_video_set_marquee_int(mp, libvlc_marquee_X, 10); libvlc_video_set_marquee_int(mp, libvlc_marquee_Y, 10); libvlc_video_set_marquee_int(mp, libvlc_marquee_Timeout, 4000); // 4 secs libvlc_video_set_marquee_int(mp, libvlc_marquee_Size, 40); libvlc_video_set_marquee_int(mp, libvlc_marquee_Color, 0xFF0000); Sleep (10000); /* play some more */ /* Stop playing */ libvlc_media_player_stop (mp); /* Free the media_player */ libvlc_media_player_release (mp); libvlc_release (inst); return 0; }
I've tried the 32bit versions of both 2.2.0 and 2.0.6.
With 32bit 2.0.6 the results were the same as described above.
With 2.2.0 (both 64 and 32 bit) there is no video rendered and an output file size 0 bytes is produced.

Has anyone tried to render a stream while overlaying it and simultaneously recording the stream?

Thanks

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: marquee stops working after add_option duplicate

Postby Rémi Denis-Courmont » 09 Apr 2015 17:26

You can' t apply a filter if you don't decode the video. Intrinsically.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

skippyV
New Cone
New Cone
Posts: 5
Joined: 15 Mar 2015 20:29

Re: marquee stops working after add_option duplicate

Postby skippyV » 09 Apr 2015 18:31

Can you point me to a tutorial or sample that demonstrates decoding the video while applying a filter - intrinsically?

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: marquee stops working after add_option duplicate

Postby Rémi Denis-Courmont » 09 Apr 2015 20:45

The question makes little to no sense. The video must be decoded before it gets filtered, because filters operate on decoded frames. That is all. Incidentally, VLC only cares about the value of --sub-filter when playing back locally, not when streaming.

You need to transcode. See the streaming howto.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

skippyV
New Cone
New Cone
Posts: 5
Joined: 15 Mar 2015 20:29

Re: marquee stops working after add_option duplicate

Postby skippyV » 09 Apr 2015 21:20

Granted I am a newbie to libVLC and video processing in general - but I thought the question was quite clear.
Maybe some background will make it clearer.

I have an IP camera streaming video over the LAN where my computer - running the application of the code above - displays the output stream.
If I uncomment this line:

Code: Select all

libvlc_media_add_option(m, duplicateStreamOption);
Then the output stream is displayed with the marquee. But no file is saved.
If I comment out the 'add_option' line - then I get an output file but there is no marquee (of course).
The question was "why can't I get this code to save a file *and* display the marquee.

Perhaps from your background the question makes no sense. But from the background of a new user - the question is coherent (IMHO).


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 40 guests