Dynamically change overlay of HTTP stream - streaming

I need to http stream a source file (*.ts) with a logo or subtitle track, that can dynamically be changed (on server side) during run-time. The stream will be viewed on an iPad. A static logo is quite easy to implement with VLC, however not a dynamic one...
I found an old VLC wiki page were this is described for logo changing:
vlc -I rc --logo-file nonexistent_dummy.png --sout "#transcode{vcodec=...,vb=...,sfilter=logo}:duplicate{dst=display,dst=std{...}}"
# Once the program has started
add video.avi
# If using VLC 0.9.0 or newer (see NEWS for details about the new syntax):
#logo logo-file logo.png
It seems that the #logo command was removed in the more recent versions of RC Interface. Is it possible to change logo filter during run time by another Interface or the standard GUI?
Is there any other free or open source solutions to stream and change overlay during run-time?
Thank you.

Related

Import .ai (illustrator file) in Unity and display them

I want to load an illustrator file in my game. Unity should recognize different layers, colors, and forms, and layers with text and display them in a 2d canvas.
The goal is that the players can click on different forms and that unity recognize them as individual forms. Do you know any unity asset or a way to make this possible?
For example when you import an image like this as an illustrator file -> https://www.mandala-bilder.de/mandala/erwachsenemandalas/mandala-ideen-erwachsene.pdf
I thought about an SVG file but then I can´t use the different layers.
Illustrator has a proprietary file format, it has no publicly available documentation for newer versions. While you can dig out old specifications (this is why some programs only support AI files saved in ancient versions) http://www.idea2ic.com/File_Formats/Adobe%20Illustrator%20File%20Format.pdf I do not think you can just go in and start supporting a 2021 variant without requesting (and motivating) the spec from Adobe. They might also want to charge you for it.
SVG on the other hand is free and it's spec is public so there is much widely spread support. also SVG supports groups which can get your around the need for layers
Vector Express is a free conversion API you should be able to use. (requires a network connection, though)
https://github.com/smidyo/vectorexpress-api
You should be able to POST a request (https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.Post.html) to this endpoint, with the raw AI file as the body:
POST https://vector.express/api/v2/public/convert/ai/gs/pdf/psd2svg/svg/
This will return a JSON object with a link to an SVG file that you can then download and display.

Media player for linux (ideally for ARM architecture) with web based frontend that plays the media on the server rather than on the client

I am looking for an ideally open source application for my next DIY smart-home-project, that frontend is web-based and plays the media on the server rather than on the client. The application would ideally be platform independent, for example java based web application, as my server would be either an ARM based or an Intel based SBC with linux as an operating system. Storage can be anything, like FS or DB, does not matter.
My use case: When I open 'http://my.media.local' from my phone's browser and select a media file, for example an audio file to play, then the media file is played on the server rather than on my mobile phone or in the browser of my mobile so that the sound/video/picture comes out from my server's audio/display output rather than from my phone's audio/display output. Obviously it would come with other basic features, like volume control and equalizer et cetera.
Is there anything like this on the market? I have found a few media library but not sure how they work. Any advise would be welcomed.
A potential solution is VLC (https://www.videolan.org/). VLC has an optional web based frontend, where the media player can be controlled, that is running on the server. It is very basic but plays the audio file. If you know other solutions then please leave another answer.
How to enable the VLC WEB frontend:
Open 'Preferences' from the menu
At the bottom-left, click 'Show All'. This will show you all VLC configuration
Select 'Interface'/'Main Interface' from the list
Tick the 'Web'
Select 'Interface'/'Main Interface'/'Lua' from the list
Add a Password under 'Lua HTTP'. You will use this password without user name - yes, I did not find a way to set user name but password is mandatory - to access the web frontend.
Re-start your VLC
Open a browser from a device from your LAN
Enter the 'http://your_IP:8080' to your browser. For example, http://192.168.1.2:8080
Enter your password that you set at step 6., but leave the user name blank
I have tested it with:
Server: Raspberry PI 3
OS: Raspbian GNU/Linux 10 (buster)
VLC: 3.0.11 Vetinari
Works with VLC running as GUI application (/usr/bin/vlc)
Works with VLC running as a background process (/usr/bin/cvlc/)
Sound: Well, my screen has some sort-of speaker. Audio was coming out it via the HDMI of my RPI
Client, where the VLC was successfully controlled from
My laptop
My smartphone
Some pros:
Free, open-source
Configuration and startup is easy
Frontend is available for both desktop and mobile
Some cons:
Equalizer is not yet supported
Frontend is very basic
Volume cannot be properly controlled from phone: could not slide the slider, but sets the volume to the position where you click on the slider
Phone: Cannot play all media files in a folder when the folder is clicked. It just played the first, so had to write some shell script to generate playlist files for each and every folder
Did not find a configuration within VLC to change the default port from 8080 to 80 or to 443 for SSL.
Further guidance for customisation:
The files for web frontend are stored in /usr/share/vlc/lua/http folder. It uses html, json, xml, js, jquery and this sort of stuff so you should be able to customize it for yourself given you understand the basics of these technologies and languages.
There is a button on web-frontend that shows you all your files in your home folder. You can navigate to anywhere with it, that raises security concerns. Well, and it is not too nice to wander away from your media files.
Here you can set your default folder: /usr/share/vlc/lua/http/js/controllers.js
#197: dir = dir == undefined ? 'file:///path/to/my/default/folder' : dir;
Here you can disable the navigation to go to the parent of your default folder (I know-I know, but it works and it is more user-friendly in this way with minimal effort :)): /usr/share/vlc/lua/http/js/common.js
#79: if( type == "dir" && name == '..' ) {
#80: icon = "Back-48.png";
#81: if (dir == "file:///path/to/my/default/folder/..")
#82: dir = "file:///path/to/my/default/folder";
#83: }
#84: else ...

Alfresco PDF thumbnail previews unreadable

Not sure this is the right stackexchange site but seems to be the place with the most question about Alfresco I can find so here goes.
Have Alfresco Community Edition 4.2.d installed on a RHEL5 64bit box (mainly default install bar using MySQL as a database locally). Uploading PDFs to the documentLibrary is fine and thumbnail previews and flash previews are generating. If the PDF has been processed by ABBYY OCR (which we have running on a separate server and is used to OCR scanned PDFs) then the flash preview generates fine but the thumbnail is incredibly dark and looks as if it has been attacked by a can of spray paint.
I initially thought it could be a ghostscript issue but have updated that to 9.14 and still getting this issue. I have also tried playing around with ImageMagik but I can't get a nice clear thumbnail to generate. I am guessing it is a switch in the convert command that Alfresco is using but I am struggling to work out a combination of switches that will work and then where Alfresco would store these parameters. Or indeed what switches are currently being used.
I was wondering if anyone had seen this behaviour before with ImageMagik previews in Alfresco 4.2.d? It seems something unique to PDFs that have been through the OCR process so I am guessing I will need to create a separate transformation for them at a later stage.
EDIT: So it was suggested that a later version of ImageMagick and GS should resolve it. I have therefore installed GS 9.14 and IM 6.8.9-0 (both compiled form source). Running the following from a command line:
convert /root/test1.pdf[0] /root/test1.png
results in a crystal clear image thumbnail preview. Thinking I was on to a winner I have amended the following lines in alfresco-global.properties to point to the system location of GS and IM:
img.root=/usr
img.dyn=${img.root}/lib
img.exe=${img.root}/bin/convert
img.gslib = /usr/local/share/ghostscript/9.14/lib/
and alfresco loads. However the thumbnail preview generated by Alfresco using the new version of IM and GS does not result in nice clean previews.
I am guessing that Alfresco is passing some command line switch during the conversion that is undoing the good work of the later versions of these programs. Does anyone know where the switches for thumbnail creation might be stored in Alfresco?
I guess it's related to transparency and default background black. I didn't find an easy way to add the required parameters to the script except to register a new transformer supporting more parameters like:
-fill white -opaque none

Can't see source code, converting PNG to SWF

So I'm following this tutorial and in the part, "Getting graphics there", the guy/girl says to, and I quote, "We’ll start with what I consider the best one, an swf. Make a new directory in the root of your project folder called assets and save this nice picture of a leek in there."
In the linked webpage there was no copy or save as... option when right-clicking, so I googled how to copy swf from websites and it said to view source code, and to do so by hitting CTRL + U on chrome. I did and nothing. So I tried going on the top right corner > Tools > Developer Tools and it gave me the page HTML, but in the code, where the HTML was getting the image from was the webpage link itself, so... help? ^^".
Maybe I'm suposed to save the link/location to that image and FlashDevelop will get it from there?
(I can't print screen it because I'll get the white background by doing so when I believe the file is the leek only, with no background.)
The problem can also be solved in another way since getting this particular leek is not important, I do have an image I made in photoshop and I could use it aswell, although it's PNG and not SWF as he says in the tutorial... :P
Are there any online png to swf converters? How can it be done properly?
I just need help getting an swf image
An SWF file is a compiled Adobe Flash "movie." It's not really an image. Flash movies can be interactive, dynamic, static, etc., much like a Java applet. For this reason, there is no way to "convert" a PNG file to an SWF file. If you had Adobe Flash, you could create an SWF yourself, but chances are you do not.
In the case of your leek, it appears to be just a simple static image embedded in the SWF. The reason you didn't see "copy" or "save as" when right-clicking was that Adobe Flash player has its own context menu. Ctrl-U didn't work either because Flash player traps keystrokes. If you want to save it, you can use your browser's file menu. That would be the easiest way. The reason your search results suggested viewing the source was that usually when people want to save SWF files, they are taking them out of existing web pages. By contrast, you are looking directly at the SWF file - you don't have to try to find the url in a web page's source because you're already at that url.

Is there a way to programmatically download a web page, for offline viewing, using WebKit?

What I'd like to be able to do is download any web page, and be able to view it offline.
It seems like html WebKit views cannot be converted to PDFs (on the Mac, you could 'print' a PDF, but that isn't possible on iPhone?).
So, the only way is to save the actual resources - save the html, the step thru each image, css, js file and save it locally. Then maybe alter the urls within the code so they point to the right place...etc ...etc...
Is there a standard way to do this?
Or, is there an open source project (in any programming lang) which does this kind of thing?
There's an excellent webkit html to pdf converter appropriately called wkhtmltopdf. Given the reources available on the iphone and its toolkits, I think it'd be easy to compile a version for the i-Phone ('think' being the operative word). We've managed to use the tool in a Windows, Linux and Solaris environment with absolutely no bugs. Here's the link:
http://code.google.com/p/wkhtmltopdf/