A
A
AlexBabin2013-04-09 03:30:24
YouTube
AlexBabin, 2013-04-09 03:30:24

The tenth day the pages are on fire, or how to take a screenshot from the Youtube player

The villages are burning and brains are melting. We are trying to get a screenshot of a flash application built on the basis of the YouTube Player SDK, or a fragment of a given area, a given frame of a YouTube video. We've been scratching our heads over this for a long time. So far, nothing works.

Below are the methods that we have already tried:

1) Getting a screenshot using Flash methods. This option does not work. YouTube prohibits access to its player beyond the methods allowed in the YouTube Player SDK (attempts to access the application itself are prohibited by the crossdomain.xml policy files on YouTube's servers). In the YouTube Player SDK bug tracker, a request to remove such security restrictions was rejected with a Won't fix resolution:

2) Client-side photography using JS methods using the html2canvas library (and similar). html2canvas and similar libraries do not photograph Flash applications.

3) Server-side photography with server-side WebKit. The solution is not suitable, because on the server side, it is not possible to set the correct frame of the video (YouTube player allows you to position only up to a keyframe, this is not suitable because you need more accuracy, since the object may already have shifted).

4) Getting a screenshot from an RTSP stream received using the YouTube API. Allows you to get a screenshot only up to the keyframe. which is not suitable for us. (need more precision)

The situation is already entering the "evil sporting interest" mode. I know that they will help us on Habré and I don’t want it to look like an attempt at additional motivation, but as a personal thank you, we will give a new ipad or any other similar tablet to choose from to those who help us solve this “mystery”. And also express our sincere gratitude and admiration.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
A
alexk24, 2013-04-09
@alexk24

What did you try to get RTSP?
RTSP from YouTube API + ffmpeg should give the right frame.

P
pomeo, 2013-04-09
@pomeo

cvlc rtsp://v7.cache4.c.youtube.com/CiILENy73wIaGQlTJ8ZFBv0wtxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp --start-time=31 --run-time=1 --vout=dummy --aout=dummy --video-filter=scene --scene-format=jpeg --scene-replace --scene-ratio=1 --scene-prefix=snapshot --scene-path=/directory/
output is a screenshot of 31 seconds in / directory/snapshot.jpg
--start-time from what second to start
--run-time after a second to stop, can be replaced with --stop-time

I
int03e, 2013-04-09
@int03e

Assumed something similar (youtube was abused in the past). However, the quote

As I mentioned before, if you want to select a thumbnail that best represents your video then become a partner. If you think your channel isn't suitable then work on it to make it more attractive to partnership.
.

N
Nikolai Turnaviotov, 2013-04-10
@foxmuldercp

Win7 -> Scissors, full screen print

A
AlexBabin, 2013-04-10
@AlexBabin

Unfortunately no, these options are not suitable.
1. In ffmpeg/VCL, the frame decoding method differs from the flash one, so we will never get to the right frame. Of course, you can give out several frames from a second interval, but we need automatism, without the user selecting a frame.
2. Working on the server in advance is bad because, depending on the number of users and the time period on the video where you need to take a screenshot, the processing time will multiply. Those. users will start to queue up and it will be first seconds, and then minutes with super-large volumes. We want to get an image in less than a second, for any number of requests.

A
Andrey Matsovkin, 2015-08-18
@macik_spb

How did the topic end?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question