I was wondering if it was possible to get the location of the file of the video with the new API?
I don't want https://www.youtube.com/watch?v=EikPnyG7cfc
I want the actual video file.
No, the YouTube API doesn't provide this because YouTube doesn't want people hotlinking their videos outside of their player and ad system. You'll have to look for something outside the API. Note this appears to be prohibited in their TOS:
https://developers.google.com/youtube/terms
I'm not really sure what you're asking, since your "I don't want" link points to a YouTube video, and not API or location information.
Every video contains a recordingDetails object which contains a string description of the video, as well as the geolocation information associated with the video.
If this is not what you are looking for, you could potentially check the fileDetails object on the video which contains a recordingLocation on from the file metadata.
I seem to have misunderstood your question:
You can use a tool such as youtube-dl to download the mp4 file from YouTube.
Install youtube-dl using a package manager or the installation guide. Running the program with no parameters gets the highest quality video and audio for download:
youtube-dl https://www.youtube.com/watch?v=EikPnyG7cfc
Example output:
➜ ~ youtube-dl https://www.youtube.com/watch\?v\=EikPnyG7cfc
[youtube] EikPnyG7cfc: Downloading webpage
[youtube] EikPnyG7cfc: Downloading video info webpage
[youtube] EikPnyG7cfc: Extracting video information
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[download] Destination: Soda Stereo - Ella Usó Mi Cabeza Como un Revólver-EikPnyG7cfc.f135.mp4
[download] 100% of 17.82MiB in 00:00
[download] Destination: Soda Stereo - Ella Usó Mi Cabeza Como un Revólver-EikPnyG7cfc.f251.webm
[download] 100% of 4.25MiB in 00:00
[ffmpeg] Merging formats into "Soda Stereo - Ella Usó Mi Cabeza Como un Revólver-EikPnyG7cfc.mkv"
Deleting original file Soda Stereo - Ella Usó Mi Cabeza Como un Revólver-EikPnyG7cfc.f135.mp4 (pass -k to keep)
Deleting original file Soda Stereo - Ella Usó Mi Cabeza Como un Revólver-EikPnyG7cfc.f251.webm (pass -k to keep)
➜ ~
Related
I want extract video source for example for this movie.
https://www.cda.pl/video/53956781/vfilm
There are hidden video sources. And there is something like security steps to unable do it.
I opened it in firefox with Video Download Helper and I got:
headers
[...
]
id
network-probe:5f8a4b2c
isPrivate
false
length
831760944
pageUrl
https://www.cda.pl/video/53956781/vfilm
referrer
https://www.cda.pl/video/53956781/vfilm
running
0
status
active
tabId
36
thumbnailUrl
https://icdn.2cda.pl/vid/premium/539567/frames/620x365/e86f6548543225cf0f1b61f1e9d730be.jpg
title
Istnienie (2013) Lektor PL 720p - CDA
topUrl
https://www.cda.pl/video/53956781/vfilm
type
video
url
https://vwaw607.cda.pl/539567/v_lq_lq5250559bd547af6bad2eb78dacaf5df4.mp4
urlFilename
v_lq_lq5250559bd547af6bad2eb78dacaf5df4
So there is an video source but If I go to https://vwaw607.cda.pl/539567/v_lq_lq5250559bd547af6bad2eb78dacaf5df4.mp4
it says video cannot be loaded. File is damaged
Could you give me an idea how to extract video url. Thanks
I just want to get a audio file(opus codec used) only in webm file.
I try to search what is webm format, how to parse, but I cant get info well.
I check that webm format is from mkv, then should I check the mkv first?
there is just one github code, but I cant find way how parse the audio from webm.
https://github.com/webmproject/libwebm/tree/master/webm_parser
You're really going to want the MKVToolNix. These include the tool mkvextract in another answer.
The MKVToolNix is actually a series of tools (mkvmerge, mkvinfo, mkvextract, mkvpropedit). First you asked how to parse the info. You can find the details using:
mkvinfo file.webm
mkvinfo file.webm -a
The first command will parse the overall structure. The second gives the detail of each frame. Use the --help switch if you want all commands.
To extract the audio, do
mkvextract file.webm tracks X:newfile.opus
Where X is the track number that you've identified as wanted from mkvinfo previously. Webm and MKV can have multiple tracks. "newfile.opus" is the new file that you want to create, choose the name you want.
There is also a mkvtoolnix gui, but I've never used that.
mkvextract can extract audio for you, and I recommend having a look at the mkvtoolsnix source code.
For example, you can extract audio from a WebM file into an Ogg Opus file like this:
$ mkvextract ~/audio/bubbles.webm tracks 0:audio.opus
Extracting track 0 with the CodecID 'A_OPUS' to the file 'audio.opus'. Container format: Ogg (Opus in Ogg)
Progress: 100%
I want to play subtitles from url.
I tried creating an .m3u playlist, but the subtitle doesn't load:
http://localhost:1111/1.srt
http://localhost:1111/1.mkv
Can VLC load a subtitle (url) from inside the playlist?
If not, I'm thinking of creating a .lua plugin for VLC to search the playlist for "http" access & ".srt" string.
If found I want to Download & use it.
I never created a VLC Plugin... Any help would be awesome...
I did a work around index.php(list files in dir) + javascript(to download files):
download subtitle CoolVideo.srt (if subtitle exists)
generate & download stream.m3u (+ subtitle if exists)
stream.m3u + Subtitle content:
#EXTM3U
#EXTINF:-1,STREAM: Cool Video Name
#EXTVLCOPT:sub-file=CoolVideo.srt
#EXTVLCOPT:subsdec-encoding=System Default
#EXTVLCOPT:subsdec-align=0
#EXTVLCOPT:freetype-rel-fontsize=16
#EXTVLCOPT:sub-fps=0
#EXTVLCOPT:sub-delay=0
http://localhost:1111/CoolVideo.mkv
stream.m3u (No Subtitle) content:
#EXTM3U
#EXTINF:-1,STREAM: Cool Video Name
http://localhost:1111/CoolVideo.mkv
INFO stream.m3u:
It's best to use encodeURI("http://localhost:1111/CoolVideo.mkv"); for the video path just in case it contains empty spaces or other characters, otherwise VLC will not open the stream.
Because stream.m3u is in the same folder as CoolVideo.srt, VLC will load the subtitle
Open the stream.m3u on PC, & enjoy almost any video format :)
BUGS: The subtitle does not auto load on Android
l try to read the following video, downloaded from http://www.sample-videos.com/
which is http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_5mb.mp4
Here is my code :
import cv2
cap = cv2.VideoCapture('big_buck_bunny_720p_5mb.mp4')
if(cap.isOpened()== False):
print("Error opening video stream or file")
count = 0
while (cap.isOpened()):
# capture frame by frame :
ret, frame = cap.read()
if ret==True:
# Display the resulting frame
cv2.imshow('Frame', frame)
cv2.imwrite("frame%d.jpg" % count, frame)
count +=1
print(count)
However l get Error opening video stream or file at cap = cv2.VideoCapture('big_buck_bunny_720p_5mb.mp4')
and ret equals False always
My OpenCV version is 3.1.0
There may be the following issue with your machine:
configure the video path
check the permission to access the file
install an additional codec
You might have installed opencv but there are some prerequisites needs to be installed while reading a .mp4 video file using open cv.
You can verify that by simply reading an .avi format file and .mp4 file
[it could read .avi file but not .mp4 file]
To read a mp4 .file
Install ffmpeg package compiled with H.264 codec:
H.264/MPEG-4 Part 10 or AVC (Advanced Video Coding) is a standard for video compression, and is currently one of the most commonly used formats for the recording, compression, and distribution of high definition video.
Ref : https://www.debiantutorials.com/how-to-install-ffmpeg-with-h-264mpeg-4-avc/
Few suggestions to make sure all prerequisites are available
1. check ffmpeg package compiled with H.264 is already installed in the machine using the command below.
ffmpeg -version
2. Installation of open-cv in anaconda will reduce the stress to install ffmpeg package compiled with H.264
3. Make sure that the user created in the machine has got enough privilege to read and write in specific application related directories
a. Check the read and write permission using the command below
ls -ld <folder-path>
or
namei -mo <folder-path>
b. Alter the access writes based on the user privilege required (sudo access needed else we need to engage admin to alter the permission)
eg : sudo chmod -R 740 <folder-path>** [ Recursive rwx for user ,r for group ]
I used
user#ubuntu:~/Arbeitsfläche$ sudo youtube-dl -citw ytuser: raz\ malca
to download all videos from this channel. But it wodnloads only one:
user#ubuntu:~/Arbeitsfläche$ sudo youtube-dl -citw ytuser: raz\ malca
[generic] ytuser:: Requesting header
ERROR: Invalid URL protocol; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update.
WARNING: Falling back to youtube search for raz malca . Set --default-search to "auto" to suppress this warning.
[youtube:search] query "raz malca": Downloading page 1
[download] Downloading playlist: raz malca
[youtube:search] playlist raz malca: Collected 1 video ids (downloading 1 of them)
[download] Downloading video #1 of 1
[youtube] Setting language
[youtube] R72vpqqNSDw: Downloading webpage
[youtube] R72vpqqNSDw: Downloading video info webpage
[youtube] R72vpqqNSDw: Extracting video information
I use the newest version of this programm.
My system is ubuntu 13.10 :)
Has anyone a idea ?
First of all, don't run youtube-dl with sudo - normal user rights suffice. There is also absolutely no need to pass in -ctw. But the main problem is that your command line contains a superfluous space after ytuser:. In any case, even if the space weren't there, raz malca is not a valid YouTube user ID. There is, however, a channel named so. Simply pass in that channel's URL into youtube-dl:
youtube-dl -i https://www.youtube.com/channel/UCnmQSqOPhkawAdndZgjfanA
to find out the channel's URL, do an inspect on the user that created the channel. E.g. for the channel mix - o grande amor (Tom Jobim) - Solo Guitar by Chiba Kosei, right click (in Firefox) on Chiba Kosei and select inspect element. Notice that the channel is in the href part. So copy that and your final channel-url is https://youtube.com/channel/UC5q9SrhlCJ4YciPTLLNTR5w
a href="/channel/UC5q9SrhlCJ4YciPTLLNTR5w" class="yt-uix-sessionlink g-hovercard spf-link " data-ytid="UC5q9SrhlCJ4YciPTLLNTR5w" data-sessionlink="itct=CDIQ4TkiEwjBvtSO7v3KAhWPnr4KHUYMDbko-B0">Chiba Kosei