Recording movie with PhantomJS

2,351 views
Skip to first unread message

Eugene Dzhurinsky

unread,
May 16, 2013, 1:44:32 PM5/16/13
to phan...@googlegroups.com
Hello!

Is there any way to record a movie with PhantomJS? I need to get it in various formats like animated GIF, AVI etc.

Perhaps there's something ready-to-use available?

Please advice.

Thanks!

Bryan Bishop

unread,
May 16, 2013, 1:53:09 PM5/16/13
to phan...@googlegroups.com, Bryan Bishop, Eugene Dzhurinsky
On Thu, May 16, 2013 at 12:44 PM, Eugene Dzhurinsky <jdev...@gmail.com> wrote:
Is there any way to record a movie with PhantomJS? I need to get it in various formats like animated GIF, AVI etc.

You can dump multiple screenshots to png, then you can convert to gif or use ffmpeg/avconv to generate movies. If you are streaming video into phantomjs, then I recommend just ripping the video stream directly instead of rendering inside of a browser.

- Bryan
http://heybryan.org/
1 512 203 0507

James Greene

unread,
May 16, 2013, 2:20:51 PM5/16/13
to phan...@googlegroups.com
Just to note that it will depend on the type of movie: Flash support was dropped in PhantomJS 1.5, and I'm honestly not positive if we support HTML5 `video` elements yet... guessing probably not.

Sincerely,
    James Greene



--
You received this message because you are subscribed to the Google Groups "phantomjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phantomjs+...@googlegroups.com.
Visit this group at http://groups.google.com/group/phantomjs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Eugene Dzhurinsky

unread,
May 16, 2013, 2:25:33 PM5/16/13
to phan...@googlegroups.com, Bryan Bishop, Eugene Dzhurinsky
That's what I was l looking for, so looks like version 1.9 allows to generate images to stdout, so I can pipe it to ffmpeg.



Thanks!

Eugene Dzhurinsky

unread,
May 16, 2013, 2:26:22 PM5/16/13
to phan...@googlegroups.com
I need to get set of images from website and create a 'movies' from those images.

Bryan Bishop

unread,
May 16, 2013, 2:27:03 PM5/16/13
to Eugene Dzhurinsky, Bryan Bishop, phan...@googlegroups.com
On Thu, May 16, 2013 at 1:25 PM, Eugene Dzhurinsky <jdev...@gmail.com> wrote:
That's what I was l looking for, so looks like version 1.9 allows to generate images to stdout, so I can pipe it to ffmpeg.

But why would you do that? Is there any particular reason to do that in phantomjs? How about load the page in phantomjs, extract the video url, then pipe that to something that downloads the video on its own. Then you can split the video up into however many images you like. A browser is not the most efficient way to get thumbnails or screenshots from a video stream..

Eugene Dzhurinsky

unread,
May 16, 2013, 2:31:09 PM5/16/13
to phan...@googlegroups.com, Eugene Dzhurinsky, Bryan Bishop
It's not about recording a movie, embedded into the page. It's about recording the movie from website dynamic content, e.g JavaScript game.

James Greene

unread,
May 16, 2013, 2:41:34 PM5/16/13
to phan...@googlegroups.com
Then yes, it should work very well for this, just like in the other Google Groups thread you referenced. :)
~~James



On Thu, May 16, 2013 at 1:31 PM, Eugene Dzhurinsky <jdev...@gmail.com> wrote:
It's not about recording a movie, embedded into the page. It's about recording the movie from website dynamic content, e.g JavaScript game.

--

Colin Kinsella

unread,
Mar 10, 2016, 12:19:00 PM3/10/16
to phantomjs
I have a similar requirement to the OP, and would appreciate if someone could give me a broad overview of the steps to end up with a video recording preferably h.264 720p or 1080p format.

Preference is that the script will run on my Linux server, target pages may be on same server or different.

I am not a programmer (and will not be coding this), however I know enough about code that once I understand what is possible with a script / application I can create a spec and have a reasonably sensible conversation with a developer.

My site will allow users to upload panoramic images (1 per page), when others visit the page it will be coded to automatically smoothly pan from left to right in about 15 seconds, users can then manually pan and zoom.

All I want to do is, as soon as the page is created is for a script to visit that URL, record the ~15 seconds of movement and save a video.

Creating a PNG sequence using phantomjs or one of the related scripts listed below seems like a suitable solution.

I am not sure what fps I need yet, probably 12 to 25fps

Bryan Bishop suggests "You can dump multiple screenshots to png, then you can convert to gif or use ffmpeg/avconv to generate movies"

Once I have the PNG in images is ffmpeg likely to be the most suitable to create the video?

Is phantomjs suitable for creating the PNG sequence? Or should I look at one of the related utilities below?

Is there an alternative script that can directly record video from a web page?

http://phantomjs.org/related-projects.html

Several page capture projects utilizing PhantomJS:

command-line
capturejs (Node.js)
DeckTape a CLI to capture screenshots and export high-quality PDF documents of slides from any HTML presentation frameworks like impress.js, reveal.js, ...
pageres - get screenshots of website(s) in few different resolutions to make sure they are responsive (Node.js)
phantomjs-screenshots, a system for running screenshot tasks defined in JSON format (Node.js)

web-service
manet (Node.js)
screenshot-app (Node.js)
screenshot-as-a-service (Node.js)
screenshot-service a pure phantomJS project to capture screenshot of any page with various configuration options
screenshot (Dancer)
screenshot-webservice (Play2)
pyshotx a screenshot server using multiple phantomJS processes and queues (Gevent, Redis)
htmlshots a screenshot server based on the WebServer module that accepts both URLs and HTML file uploads

Message has been deleted

Colin Kinsella

unread,
Mar 16, 2016, 8:49:06 AM3/16/16
to phantomjs, jdev...@gmail.com
Any input would be appreciated
Reply all
Reply to author
Forward
0 new messages