Creating dataset by scraping YouTube?
According to this: http://tubularinsights.com/youtube-copyright-ownership/

People / Entities / Conglomerates still retain at least some rights to their own videos most of the time. 

So yes, if you come across any licensed material, for eg. grabbing frames from videos of movies etc without seeking permission first and the original owners find out, then you could get into trouble.

You could handpick videos / create playlists that you want to scrape making sure that their content is not commercially licensed or is used with permission of the original creators (I think you typically do this with the publication that follows / describes your dataset, if you choose to do that)