1
00:00:00,450 --> 00:00:00,900
All right.

2
00:00:00,930 --> 00:00:07,110
Hi, and welcome back to the seventh chapter in this section called looking at videos where we're going

3
00:00:07,110 --> 00:00:10,850
to import a YouTube video and process it using open TV.

4
00:00:11,400 --> 00:00:14,580
So let's take a look at that notebook's let's open it up.

5
00:00:14,670 --> 00:00:17,160
I already had it open here, but it's very open it anyway.

6
00:00:18,360 --> 00:00:20,180
And this one is an interesting lesson.

7
00:00:20,220 --> 00:00:21,150
So let's zoom in.

8
00:00:21,330 --> 00:00:25,560
So we're going to use two libraries here called Puffy and YouTube.

9
00:00:25,560 --> 00:00:26,490
Download the demo.

10
00:00:26,490 --> 00:00:27,240
Two different things.

11
00:00:27,660 --> 00:00:32,370
Puffy is the one that we're going to use to load a YouTube stream of life here.

12
00:00:32,550 --> 00:00:35,150
So to do that, we import Puffy.

13
00:00:35,160 --> 00:00:36,770
We pointed YouTube URL.

14
00:00:36,780 --> 00:00:38,790
That's the URL for the video that you want to open.

15
00:00:39,450 --> 00:00:41,160
Pointed to puffy dot new here.

16
00:00:41,670 --> 00:00:46,260
So this is this creates this video object, which has functions called Get this get.

17
00:00:46,260 --> 00:00:52,560
This gives you the highest quality YouTube video encoding for that video because remember, it is true

18
00:00:52,890 --> 00:00:58,320
p 480p seven 2010 and sometimes even 4K sometimes and different frame rates.

19
00:00:58,860 --> 00:01:05,190
So again, this allows you to get the highest quality stream of that video, and you can set a preferred

20
00:01:05,190 --> 00:01:09,720
type to MPEG four as well, because that's easy to process with OpenCV.

21
00:01:10,530 --> 00:01:16,860
And then what we do, we create a video capture object here and we use to capture that open and we feed

22
00:01:16,860 --> 00:01:18,690
this in best of URL here.

23
00:01:19,290 --> 00:01:27,030
And that allows us know to use capture that read to read frames from that video as it plays in the back

24
00:01:27,030 --> 00:01:27,240
end.

25
00:01:27,780 --> 00:01:32,550
So let's run all of this code and see what happens.

26
00:01:32,700 --> 00:01:38,400
And probably, OK, it's working right now.

27
00:01:38,910 --> 00:01:42,540
However, that's because I edited some files in dysfunction.

28
00:01:43,170 --> 00:01:46,470
Normally, you should have seen an error, most likely.

29
00:01:46,920 --> 00:01:50,520
That said, an error error related to dislike count.

30
00:01:51,180 --> 00:01:56,030
And that's because YouTube recently changed their dislike like they removed.

31
00:01:56,030 --> 00:02:02,340
The display can be a feature from the videos, so people can can see no longer see dislikes because

32
00:02:02,340 --> 00:02:07,160
apparently it was creating negativity but different video videos.

33
00:02:07,170 --> 00:02:11,360
And I'm not sure exactly what the social aspect of that was and what the reason.

34
00:02:11,370 --> 00:02:17,160
I don't fully agree with it because I think it's good to have that data, but nevertheless it was removed

35
00:02:17,160 --> 00:02:17,760
from YouTube.

36
00:02:18,840 --> 00:02:25,770
But the Party Library didn't update, so to do that, I had to open this file in the party library called

37
00:02:25,770 --> 00:02:26,910
back in YouTube.

38
00:02:27,060 --> 00:02:30,060
Download and use the text editor in Mac.

39
00:02:30,100 --> 00:02:35,340
You can open this with any text, and it's all you want, like sublime or atom or voice could just use

40
00:02:35,340 --> 00:02:41,640
this one for simplicity, and there's a line of code here called Dislikes, which you will need to comment

41
00:02:41,640 --> 00:02:42,150
out here.

42
00:02:42,300 --> 00:02:45,240
So it does with commented out here now.

43
00:02:45,270 --> 00:02:50,880
It wasn't commented up before, but that's because it was using previous saved version of party in his

44
00:02:50,880 --> 00:02:51,240
library.

45
00:02:52,050 --> 00:02:54,840
So you need to come and out there.

46
00:02:55,080 --> 00:02:56,220
Take a look at that file again.

47
00:02:56,760 --> 00:03:01,920
You can scroll down this link is going to delete this line or this comment out the line if you want,

48
00:03:02,490 --> 00:03:06,270
and that should allow this library to work.

49
00:03:07,290 --> 00:03:11,490
So now let's use that sympathy to get metadata from this video.

50
00:03:12,120 --> 00:03:14,490
So let's take a look at this so you can see the title.

51
00:03:14,910 --> 00:03:18,120
The video we playing is video for by Param Local in it fun.

52
00:03:18,630 --> 00:03:20,190
It's pretty nice songs, and you can check it out.

53
00:03:20,340 --> 00:03:25,260
It's not the best song, but it's just one I was listening to at a time when I created this lesson.

54
00:03:26,370 --> 00:03:28,140
You can get to reading, which is pretty cool.

55
00:03:28,290 --> 00:03:36,360
The view count, which is 146 million water lengths and seconds duration in terms of like minutes and

56
00:03:36,360 --> 00:03:37,140
seconds as well.

57
00:03:37,920 --> 00:03:40,500
So you can do a lot of analytics here.

58
00:03:40,520 --> 00:03:45,330
You can imagine processing different videos, getting the average song length for an artist, average

59
00:03:45,330 --> 00:03:50,010
rating for different songs, so it's pretty cool to use this to extract that information.

60
00:03:50,850 --> 00:03:56,270
So let's take a look at the streams, because remember, I told you we were getting the best stream.

61
00:03:56,280 --> 00:03:57,370
So let's take a look at this.

62
00:03:57,390 --> 00:03:58,950
What is this we're doing to us here?

63
00:03:59,670 --> 00:04:02,970
This is returning the URL for that bass stream right now.

64
00:04:03,360 --> 00:04:06,870
So the best stream for that video was 6:40.

65
00:04:06,870 --> 00:04:13,170
This is recording here and this is a file size, so this allows us to inspect the streams in more detail

66
00:04:13,500 --> 00:04:16,440
in case you wanted to risk, resize accordingly.

67
00:04:16,560 --> 00:04:16,890
OK.

68
00:04:17,760 --> 00:04:20,400
And how do you get the highest quality stream?

69
00:04:20,460 --> 00:04:22,100
Remember to we got get bass.

70
00:04:22,740 --> 00:04:28,020
This gives us here the outputs of what the best resolution is and the best extension.

71
00:04:28,740 --> 00:04:31,860
So and this is the best direct URL for that video as well.

72
00:04:32,760 --> 00:04:37,650
And you can download videos as well quite easily get just download them here.

73
00:04:38,790 --> 00:04:44,970
Quiet equals false means it's going to download in the background of let's take a look to have a find

74
00:04:44,970 --> 00:04:46,200
a way to open the way to it.

75
00:04:46,980 --> 00:04:52,740
So let me just navigate to that screen and I'll bring it back to you here.

76
00:04:55,010 --> 00:05:00,830
So you can see it would have downloaded this video here, so this video wasn't downloaded today is actually

77
00:05:00,830 --> 00:05:01,080
was.

78
00:05:01,100 --> 00:05:03,050
I'm not sure why it's is 2019.

79
00:05:03,050 --> 00:05:10,070
It didn't do that that long ago, but yeah, it would have downloaded that video here, but actually

80
00:05:10,070 --> 00:05:13,340
do believe you need it to run these prior.

81
00:05:13,850 --> 00:05:14,600
And that's it.

82
00:05:15,170 --> 00:05:20,960
So, no, you can actually get it done with audio from streams so you can extract the audio here by

83
00:05:20,960 --> 00:05:23,690
running that and you can actually get the bitrate of them there.

84
00:05:24,230 --> 00:05:27,680
So and if you wants to download it, you can just run the stream if you want.

85
00:05:28,910 --> 00:05:33,800
There are different streams because there are different audio recordings as well, and this would allow

86
00:05:33,800 --> 00:05:35,090
us to download the stream here.

87
00:05:35,690 --> 00:05:42,260
So that's this is one of these is yeah, this is a video audio streaming system, Web M file.

88
00:05:42,920 --> 00:05:44,530
So that's it for this lesson.

89
00:05:44,540 --> 00:05:47,540
I hope you enjoyed these lessons here.

90
00:05:47,810 --> 00:05:53,840
They were quite enjoyable to do for me to make, and I do use them occasionally in my computer vision

91
00:05:53,840 --> 00:05:54,140
work.

92
00:05:54,620 --> 00:05:59,340
And I hope you do too and your projects so in your work place or whatever you're doing.

93
00:05:59,600 --> 00:06:00,500
I hope you enjoy it.

94
00:06:00,500 --> 00:06:05,620
And if you have any questions, feel free to contact me where this more.

95
00:06:05,630 --> 00:06:08,840
This concludes the open sea view section of this course.

96
00:06:10,010 --> 00:06:14,960
We may occasionally go back to simple functions in the next section, but this is the core.

97
00:06:15,230 --> 00:06:22,250
The Open V. Lesson here will now start the deep learning aspect of the course, which is the actual

98
00:06:22,250 --> 00:06:26,030
very cool part which I'm looking forward to sharing with you guys.

99
00:06:26,540 --> 00:06:32,090
So welcome into the next section of the course, which starts on a deep learning computer vision, of

100
00:06:32,090 --> 00:06:32,510
course.

101
00:06:33,110 --> 00:06:33,530
Thank you.
