VLC/VLM output string duplicate module - vlc

i'd need to stream a subset of elementary stream within a videoclip using VLM as "Video On Demand" media type. Usually i do transcoding so my output stream is something like that
#duplicate{dst="transcode{<options>}, select="es=x,es=y,..."}
in the case of no transcoding, i would like to use "duplicate" module but with an empty (or passthrought ) "dst" chain. Is it possible still to use "duplicate" or i have to use "es" module to select elementary streams instead?
in that case, i have some problems with the "es" module...could someone help me?
thanks in advice, excuse me for my bad english

duplicate{dst=std{access=udp{ttl=10},mux=ts,dst=239.192.15.15:1234},dst=rtp{ttl=10,mux=ts,dst=10.0.0.4,port=5004}}
An example on how to address the dst. you must send it somewhere right?
Regarding the ES I think you're on the right track
es=: duplicate only the elementary stream with the selected id.
VLC Duplicate help

Related

"ASFUnicodeAttribute" problem when printing wma song titles with mutagen

Hey guys I recently started working with mutagen and I'm facing a very annoying problem.
Let´s say I´m trying to print the title of a wma file with mutagen:
from mutagen.asf import ASF
song=r"C:\Users\j2the\Music\The One and Only\Rammstein\Made In Germany\03 Keine Lust.wma"
song_wma=ASF(song)
print(song_wma["Title"])
The code may work fine, but when printing the title of the wma file, python always adds the extension [ASFUnicodeAttribute...] to the actual filename:
[ASFUnicodeAttribute('Keine Lust')]
Is there any way to have the code return only the actual title of the song?
Thanks in advance for your help!
Ok I eventually figured out the solution myself. It's actually very simple. All you have to do is iterate over the title tag and voilà: You´re left with only the title of the song:
for e in song_wma["Title"]:
print(e)
Outcome:
Keine Lust
And by the way, if anybody is loooking for an easy tagging module for mp3, wma, flac files etc., I would recommend the tinytag module, which is much less complicated to work with than the mutagen module. Just my personal opinion though.

OCR validations with Rails building a business card scanner

My goal is to write a validation class for Rails that is capable of using an OCR recognised text from a business card and is able to detect string snippets and assign them to the correct attributes. I know this cannot be probably 100% perfect but I want to get as close as possible. Here is my approach so far:
I scan business cards via jquery's navigator.mediaDevices
I send the scanned image to a third party API Service, called OCRSpace (a gem is available here: https://github.com/suyesh/ocr_space)
I then get a unformatted array of recognised text snippets back, for example:
result = [['John Doe'], ['+49 160 123456'], ['Mainstr. 45a'], ['12345 Berlin'], ['CEO'], ['johndoe#business-website.de'], ['www.business-website.de']]
I then iterate through the array and do some checks, for example
Using the people library (https://github.com/mericson/people)
to split the name in firstname and lastname (additionally the title
or middlenames) Using the phonelib library
(https://github.com/daddyz/phonelib) to look up a valid phone number
and format it in an international string
Doing a basic regex check on the email address and store it
What I miss now is:
How can I find out what the name-string would possibly be? Right now I let the user choose it (in my example he defines "John Doe" as the name and then the library does the rest). I'm sure I would run into conflicts when using a regex as strings like "Main Street" would then also be recognized as a name?
How do I regex a combination of ZIP-Code and City name? I'm not a regex expert, do you know any good sources that would help? Couldn't find any so far except some regex-checkers in general.
In general: Do you like my approach or is this way too complicated? And do you know some best-practices that look better?
Don't consider this a full answer, but it was too much to make it a comment.
Your way of working seems Ok but I wouldn't use the OCR Service since there are other ways , Tesseract is the best known.
If you do and all the results are comparible presented it seems not too difficult since every piece of info has it's own characteristics.
You can identify the name part because it won't have numbers in it, the rest does, also you can expect to contain it "Mr." or "Mrs." or the such and not "Str.", "street" and so on. You could also use Google Maps to check for correct adresses, there are Ruby gems but have no experience with them.
Your people gem could also help.
You could guess all of this, present the results in you webpage and let the user confirm or adjust.
You could also RegExpr the post-city combination by looking fo a number and string combination in either order but you could also use a gem like ZipCodes to help.
I'm sorry, don't have the time now to test some Regular Expressions now and I don't publish code without testing.
Hope this was some help, success !

Get closed caption "cc" for Youtube video

Does any one know how to get the CC for any Youtube video that has the caption available? I know on the API 2.0 documentation mentions that it is only available for the owner of the video... but I was able to get some of the video's caption even though I'm not the owner of any....
There are two APIs (or links to API) can be used. they both rout to timpedtext API.
before I mention them we should note the parameters the API need. which are:
lang: {en, fr,...} required.
v: {video ID} required.
name: the track name, Required only if it is set. (and with this is my problem.)
tlang: translation to language. optional (should be set if you like to translate the CC to other language.
The API links are:
http://video.google.com/timedtext?lang=fr&v=PILzP-bIeLo&name=french
Note the above example would return nothing if you remove the name=French or set it to something else...
http://www.youtube.com/api/timedtext?v=zzfCVBSsvqA&lang=en
Note this example would return nothing if you set the name=...
http://www.youtube.com/api/timedtext?v=ZdP0KM49IVk&lang=en
yet the actual video has caption.
Example 3 does not return the CC data.
So I'm guessing that example 3 need to have the name parameter set. and my main problem is how do I find the name parameter if it is set or not. and if it is set how do I know what is it?
[update]: This was the preferred method until google recently discontinued it (writing as of dec 2021).
Your first example should work without the name= part.
This did the job for me:
video.google.com/timedtext?lang={languageID}&v={videoId}
To fetch the english CC version from the previous answer, it would look like this:
http://video.google.com/timedtext?lang=en&v=zzfCVBSsvqA
You can get the list of available captions with http://video.google.com/timedtext?type=list&v=zzfCVBSsvqA request.
Your 3rd video has only automatically generated captions, which you cannot fetch easily.
Here my suggestions after spending some time:
Js library: https://github.com/syzer/youtube-captions-scraper => support auto-generated caption.
2 quick methods below not support auto-generated caption
Get a list of subtitles: http://video.google.com/timedtext?type=list&v=lT3vGaOLWqE
Get subtitle with track id: http://video.google.com/timedtext?type=track&v=lT3vGaOLWqE&id=0&lang=en
Quick download:
http://downsub.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dag_EJRhMfOM
If video.google.com does not fetch your closed caption file OR you don't want your file in XML format, but would rather SRT (see note below), try:
CC SUBS
NOTE: SRT can be transformed into virtually ANY format - either using free subtitling tools OR
by replacing \n\n with |, \n with ; and then | into \n, you get a CSV file that can be opened in a spreadsheet, for example.

Specify a language when embedding a Spotify playlist using an iframe

Is there a query string parameter (or a special path, or subdomain) that can be used with standard localization codes (e.g. es, nl, de, etc) in conjunction with a url like this https://embed.spotify.com/?uri=spotify:track:4bz7uB4edifWKJXSDxwHcs that will localize the content from Spotify?
EDIT:
I am referring specifically to the options menu as pictured below as the rest of the text is just artist and track title.
No. In this case Spotify doesn't offer any localization codes. But there is no reason for it because it just give you general information title/artist/album etc.
You have to tell us more specific what you want.
If you want to grab data from this url use web-api instead.
https://developer.spotify.com/technologies/web-api/
Use Lookup if you have a special title/artist/album etc. but you need spotify url!
https://developer.spotify.com/technologies/web-api/lookup/
If I would interpret your question in another way:
You can look up 'availability' for certain 'territories'
Just for you to know there is a rate limiting 10 requests per ip/second!
Hope I could helpya! If you need something else or want more help tell us or write me a message ;)

Capturing Field Name Metadata from a CSV File in Altova MapForce

I've been asked to prototype a replacement "file transformation process" (that currently is a mess of SQL) using Altova's MapForce. My input is a CSV file with headers. My problem is that I need to capture both the data AND the column name to use in downstream processing.
I need to have MapForce feed a C# method (imported as that takes two parameters: fieldName and value. I can access the value trivially, but after hours pouring over the manual (1000 pages!) I haven't found any examples of how to access the field name as an output.
The reason each output needs the field name and the value has to do with how all our mappings/transformations are currently managed - on a database. The .NET code jumps in at this point and does any necessary database lookups.
For example, if I had the following file:
"Symbol", "Account", "Price", ...
"FOO", "10101", "1.23", ...
"BAR", "10201, "13.56", ...
And a static method string TransformField( string fieldName, string value ),
I'd like to map the CSV file's Symbol data output to the method's value parameter and the Field Name "Symbol" to the method's fieldName parameter.
Some limitations:
I need to keep the "wiring" visible in the MapForce GUI. I'll have non-programmers maintaining the mappings in the future. So doing all this in code is not an option.
MapForce is the tool of choice by the company. Part of the reason our original process is such a mess is because the original programmer rolled his own mapping/transformation tool (out of TSQL no less - ouch).
We can treat all inputs/outputs to the method call as strings. Conversions will happen later.
I would like to avoid using scalar literals as inputs. I already have the column names from the file - I do not want to re-type each one and feed it to my method.
I'm not sure how many users out there have experience with this tool, but after 3 days of tinkering with it, I see much potential. If only I can get past this current sticking point, I think the company will have a solid alternative to their current mess.
Thanks for any/all suggestions.
I solved my issue and, for future reference, want to post a solution. I handled my problem by using MapForce's FlexText. This allowed me to extract the header from the CSV file and "invert" the column names as data inputs to the transformation process. Once I knew the approach to take, I was able to find more information directly from Altova.
I found a couple helpful tutorials while digging through their website:
Altova Online Videos
Web Tutorial
Hope this can help someone else in the future!

Resources