Is there a way to get the Name of current playing program, from a DVB recording in .TS format?
In VLC I can see it in Tile Bar, and also in "Now Playing", but in MediaInfo it shows many hours and programs, and not only what is being played.
Is it possible to get that Title from VLC CLI, and pass it to a var from a BATCH file?
I use Mediainfo CLI to pass others parameters, but if I look for it in the "Menu" section:
%mediainfo% "%~1" "--Inform=Menu; %%Title%%"
nothing shows, and I can't find the right parameter to get the Title of the TV Show (although maybe it will show all the hours and programs and not the current).
So, I'd like to know if I can do it with VLC CLI, MediaInfo CLI, or another CLI software.
Thanks!
If you have recorded a TV stream there must be DVB tables in it.
The information you want is hidden in these tables:
SDT: Service Description Table (~ channel description: scrambled/clear, status, ...)
EIT: Event Information Table (~ program description: name, length, ...)
Both of these tables are used to build an EPG.
Unfortunately I don't know a direct way to achieve what you want but you might want to try libdvbpsi, ffmpeg or dvbsnoop : this tools can analyse, and extract information from TS files.
Related
I've recently made a Python program using the Youtube api v3 where, given a playlist id, it fetches certain information from every video in the playlist. However, through both the output of this code and this post on Google, it's pretty clear that information on videos that were either privated or deleted is not available through the Youtube api.
Is there an alternative program or resource that I can use to extract information from these unavailable videos, in particular their video ids?
The only solution I can think of now is to access the HTML of the display Youtube and search through it for certain strings (like "[deleted video]") and to then extract the id corresponding to that string. But, I've never dealt with HTML and, if I understand HTML correctly, I'd have to load a new page for every 50 videos in the playlist, which for playlists with thousands of videos, becomes rather inefficient and laborious.
I was hoping to use something like PyTube, but that couldn't handle unavailable videos either.
Edit
Here is the code that extracts the video ids:
from googleapiclient.discovery import build
api_key = "AI~~~" #get from yt (private key)
yt = build("youtube", "v3", developerKey = api_key)
plst_id = "PLorw3mfu-J0ipF4Ss0XgR8IxcwP-JzNKC" #unique yt playlist id
plst_req = yt.playlistItems().list( #request for info from yt api
part = "contentDetails",
playlistId = plst_id,
maxResults = 50
)
plst = plst_req.execute()
vid_ids = [] #available video ids taken from current playlist
for vid in plst['items']:
vid_ids.append(vid['contentDetails']['videoId'])
print(vid_ids)
print(plst['pageInfo']['totalResults'])
The first line printed contains the video ids of every available video in the playlist. The second line printed gives the number of videos in the playlist, including available and unavailable ones.
The playlist used in the code above is given here. It contains 10 total videos, of which one of them is unavailable.
In this case, the output is (with a valid api key)
['bv_cEeDlop0', 'mRKTOZmX2cE', '5ACvKdx1nns', 'wSNhP8b_Avo', 's56cHgokPlE', 'E4IHMWnQiMw', 'sCDkPShADSc', 'EVwgeUVVDYU', 'Z8Mqw0b9ADs']
10
Youtube still treats unavailable videos as an element of the playlist, but does not give out it's video id. In this particular instance, the video id of the unavailable video is "t83zUmjr05I", which is not hard to find manually: copy the link address of the deleted video and extract the part after the "v=".
But, on a larger scale manual extraction becomes tedious.
Here's a permanent fix to that!
You can try tube_dl.
pip install tube_dl
It uses modular approach and is up to date
More about this can be found at : https://github.com/shekharchander/tube_dl/
Maybe, the playlist module can help you with that. It uses regex to grab all video IDs not JSON. Please let me know if the problem is fixed or not, I will update module accordingly.
Edit
Here's the working code
from tube_dl import Playlist
p = Playlist('https://youtube.com/playlist?list=PLorw3mfu-J0ipF4Ss0XgR8IxcwP-JzNKC').videos
print(p)
I am trying to retrieve RIFF data from AVI file in my iOS app. I tried to convert AVI file to NSDATA and then i have converted to NSASCIIStringEncoding and i am getting all tag as string but how to retrieve particular tag,in this case I am getting all data but as there is lots data inside it, it is tough to get data from specific tags. I want to retrieve specific data from the specific tag. Here I have enclosed screenshot which shows how data looks like on Windows computer. I have used software named AVI master to see RIFF data in windows computer .As you can see in the screenshot, I will need data associated with 03tx tag.
I tried all possible ways to read chunk by chunk and also tried Libavformat library, but no success. Is there any other way to get RIFF data associated with AVI file?
Please advise.
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.
I'm managing a Filemaker Pro 12 solution to create purchase orders and send them via email for the iPad but the iOS Platform doesn't allow to export Excel files.
Currently we are sending the orders as a .pdf file but the warehouse has to manually approve each order. The solution we were thinking of is to send a .csv file attached to an email so that the warehouse has less work.
I'm using 3 different tables to create a order. A table that stores the products, a container table (to set the quantity, discount etc.) and a table for the order itself. So you can for example create three product-A and two Product-B in an order which works fine. My PDF solution uses an extra Layout and works fine. On a PC or Mac you can export Excel files with a script and the "Save Records as Excel" function, but this is not available on iOS, so I'm looking for alternatives.
The script I came up with to send the .csv file via email looks like this:
Set Error Capture [On]
Freeze Window
Go to Related Record [Show only related records; From table "Orders_Container"; Using Layout: "MailLayout" (Orders_Container); New Window]
If( Get (LastError) = 0)
Sort Records[ Restore; No dialog]
Set Variable[ $FILE; Value:Get (TemporaryPath ) & "file.csv" ]
Export Records [No dialog; "$FILE"; Windows(ANSI)]
Send Mail[Send via E-mail Client; To: "customer#web.com"; Subject: "Order"; "$FILE"]
End If
Close Windows [Current Window]
I tried to use the function "Export Records" but it exports all records of the current customer instead of the 'Records being browsed' which is only available for the PDF export. I've tried to do this but on iOS you can't create a new file to export and I can't come up with something else. I don't want the users to use Menu -> Export -> E-Mail because they will have to enter 3-4 Email addresses each time which is way to time consuming (this also exports all records instead of the ones which are currently being browsed). Is there any way to export the records that are currently open, save those in a .csv file and send a mail with the file attached? Thanks in advance.
EDIT: Ironically after some testing with different scripts, the script I posted here works now correctly.
The Export Records function exports the current found set - the same as Records Being Browsed. This indicates that other issues are keeping your script from working.
You might want to look at the Related Record and which set is found. Use a temporarily pause just before the Import Records function is called to see what set is present.
Also, keep in mind that if there is an error with your Go to Related Record call, nothing happens. A record created by a previous export would then remain in place and this then might show a different set of records than you would expect.
I'm trying to figure out how I can specify a custom end time for an embedded YouTube video. I know that I can customize the start time by adding &start=30, but I haven't seen anything relating to the end time.
I need to be able to do this for a web app I'm building, so if there is no way provided by YouTube, how might I be able to accomplish this anyway?
I've skimmed over the documentation to no avail. Thanks!
I just found out that the following works:
https://www.youtube.com/embed/[video_id]?start=[start_at_second]&end=[end_at_second]
Note: the time must be an integer number of seconds (e.g. 119, not 1m59s).
I tried the method of #mystic11 ( https://stackoverflow.com/a/11422551/506073 ) and got redirected around. Here is a working example URL:
http://youtube.googleapis.com/v/WA8sLsM3McU?start=15&end=20&version=3
If the version=3 parameter is omitted, the video starts at the correct place but runs all the way to the end. From the documentation for the end parameter I am guessing version=3 asks for the AS3 player to be used. See:
end (supported players: AS3, HTML5)
Additional Experiments
Autoplay
Autoplay of the clipped video portion works:
http://youtube.googleapis.com/v/WA8sLsM3McU?start=15&end=20&version=3&autoplay=1
Looping
Adding looping as per the documentation unfortunately starts the second and subsequent iterations at the beginning of the video:
http://youtube.googleapis.com/v/WA8sLsM3McU?start=15&end=20&version=3&loop=1&playlist=WA8sLsM3McU
To do this properly, you probably need to set enablejsapi=1 and use the javascript API.
FYI, the above video looped: http://www.infinitelooper.com/?v=WA8sLsM3McU&p=n#/15;19
Remove Branding and Related Videos
To get rid of the Youtube logo and the list of videos to click on to at the end of playing the video you want to watch, add these (&modestBranding=1&rel=0) parameters:
http://youtube.googleapis.com/v/WA8sLsM3McU?start=15&end=20&version=3&autoplay=1&modestBranding=1&rel=0
Remove the uploader info with showinfo=0:
http://youtube.googleapis.com/v/WA8sLsM3McU?start=15&end=20&version=3&autoplay=1&modestBranding=1&rel=0&showinfo=0
This eliminates the thin strip with video title, up and down thumbs, and info icon at the top of the video. The final version produced is fairly clean and doesn't have the downside of giving your viewers an exit into unproductive clicking around Youtube at the end of watching the video portion that you wanted them to see.
Use parameters(seconds) i.e. youtube.com/v/VIDEO_ID?start=4&end=117
Live DEMO:
https://puvox.software/software/youtube_trimmer.php
Youtube doesn't provide any option for an end time, but there alternative sites that provide this, like
Tubechop. Otherwise try writing a function that either pauses video/skips to next
when your when your video has played its desired duration.
OR: using the Youtube Javascript player API, you could do something like this:
function onPlayerStateChange(evt) {
if (evt.data == YT.PlayerState.PLAYING && !done) {
setTimeout(stopVideo, 6000);
done = true;
}
}
Youtube API blog
Today I found, that the old ways are not working very well.
So I used:
"Customize YouTube Start and End Time - Acetrot.com"
from http://www.youtubestartend.com/
They provide a link into
https://xxxx.app.goo.gl/yyyyyyyyyy
e.g. https://v637g.app.goo.gl/Cs2SV9NEeoweNGGy9
Link contain forward to format like this
https://www.youtube.com/embed/xyzabc123?start=17&end=21&version=3&autoplay=1
I was just trying to look up how and found there is a CLIP feature now added by Youtube right under the video that I had never noticed before!
I use this signature:
youtube.com/embed/[YOUR_VIDEO_ID]?start=[TIME_IN_SEC]&end=[TIME_IN_SEC]&autoplay=1
https://www.youtube.com/embed/2EWejmkKlxs?start=1230&end=1246&autoplay=1