Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (744)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (825)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Recording movie files from Java  (Read 4757 times)
0 Members and 1 Guest are viewing this topic.
Offline Elf7of9

Senior Newbie


Exp: 16 years


Java games rock!


« Posted 2016-02-23 19:13:23 »

Aside from deploying JMF, is there an easier and slimmer way to generate movie files from Java?
Offline delt0r

JGO Wizard


Medals: 139
Exp: 18 years


Computers can do that?


« Reply #1 - Posted 2016-02-23 19:35:21 »

Well you can always grab the frame/pixel buffer and use ImageIO or whatever to save lots of frames, then encode with mplayer or something.

Or do you mean playback? in which case i would recommend Rivens player that uses pipes and external code.

I have no special talents. I am only passionately curious.--Albert Einstein
Offline philfrei
« Reply #2 - Posted 2016-02-23 19:39:05 »

Riven posted some good info on making animated gifs. I don't know how different it would be to make .mov files.
http://www.java-gaming.org/topics/generate-animated-gifs/24196/view.html

music and music apps: http://adonax.com
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Cero
« Reply #3 - Posted 2016-02-23 20:18:28 »

If you just want to record, you can just take any software, I'm not sure what you mean.
Developing your own screen capture software in java ?

Offline Elf7of9

Senior Newbie


Exp: 16 years


Java games rock!


« Reply #4 - Posted 2016-02-23 20:55:25 »

I mean have the Java program directly save a video to an AVI file for instance.
Offline basil_

« JGO Bitwise Duke »


Medals: 418
Exp: 13 years



« Reply #5 - Posted 2016-02-23 23:19:44 »

didn't try it by myself but https://github.com/artclarke/humble-video still looks promising.
Offline delt0r

JGO Wizard


Medals: 139
Exp: 18 years


Computers can do that?


« Reply #6 - Posted 2016-02-25 20:35:10 »

One does not simply "save as a AVI". You have to encode it with a codec then pack it into a container. AVI is a container that could have content encoded from a number of different codecs.

So the short answer is no you can't do that with a few simple calls in java. However in most OS there are tools available that can take a stack of images and encode and pack them for you. mencoder or mplayer for example. Or VLC. Java never really sorted out any properly standard lib support for it.

I have no special talents. I am only passionately curious.--Albert Einstein
Offline nsigma
« Reply #7 - Posted 2016-02-26 10:28:32 »

GStreamer can do this, but you'll have to get down and dirty with pipeline configuration - https://github.com/gstreamer-java.  There are some Processing examples for recording AVI using GStreamer 0.10 - I'm not sure if the GStreamer 1.x bindings will work for this yet (and if not it's my issue to fix it  persecutioncomplex )

One project that might be worth looking at is https://github.com/sarxos/webcam-capture  It'll give you some idea of various video libraries that are available, and it does have an example for recording to file (not tried it!)

I've also seen code that claims to write an MJPEG AVI in pure Java - check out the AVIWriter class on this page - http://www.randelshofer.ch/monte/

Praxis LIVE - hybrid visual IDE for (live) creative coding
Offline delt0r

JGO Wizard


Medals: 139
Exp: 18 years


Computers can do that?


« Reply #8 - Posted 2016-02-27 07:48:57 »

GStreamer is absolutely horrible. Just use mencoder or VLC and be done i 5 min instead of having nothing but problems for days.

I have no special talents. I am only passionately curious.--Albert Einstein
Offline basil_

« JGO Bitwise Duke »


Medals: 418
Exp: 13 years



« Reply #9 - Posted 2016-02-27 10:41:38 »

http://www.virtualdub.org is also a good tool for frame-stiching and encoding.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline nsigma
« Reply #10 - Posted 2016-02-27 11:04:21 »

GStreamer is absolutely horrible. Just use mencoder or VLC and be done i 5 min instead of having nothing but problems for days.

GStreamer has a learning curve!  Tongue  Encoding a sequence of images is not always the best option for this, though - depends what the OP wants to do.  Mind you, another option coming from what you said - VLCJ probably allows you to feed a pipeline directly with image data too (https://github.com/caprica/vlcj)

btw, while you're right that Java has never developed a proper standard lib for writing video files, you know that the new standard lib for playing them is based on GStreamer, right?  persecutioncomplex

Praxis LIVE - hybrid visual IDE for (live) creative coding
Online jonjava
« Reply #11 - Posted 2016-02-27 13:26:23 »

Why not use ffmpeg or libav?

Offline Cero
« Reply #12 - Posted 2016-02-27 16:49:53 »

I mean have the Java program directly save a video to an AVI file for instance.
Why? What for? D:
I hate to be that guy, that asks for why, but unless you are developing stuff that nsigma does, or like a screencapture proram, video converter or video editing software... why would you need that?

Offline nsigma
« Reply #13 - Posted 2016-02-27 18:43:10 »

Why? What for? D:
I hate to be that guy, that asks for why, but unless you are developing stuff that nsigma does ..

Good question!  Smiley In fact, I haven't implemented video rendering to file in my stuff so far either - the reason, because if you have the stuff on screen, and particularly if it's OpenGL / accelerated rendering, you'll likely get better performance from a screen capture software designed for gaming than you will from something internal (without a lot of work).

Praxis LIVE - hybrid visual IDE for (live) creative coding
Pages: [1]
  ignore  |  Print  
 
 

 
Ecumene (149 views)
2017-09-30 02:57:34

theagentd (222 views)
2017-09-26 18:23:31

cybrmynd (301 views)
2017-08-02 12:28:51

cybrmynd (288 views)
2017-08-02 12:19:43

cybrmynd (297 views)
2017-08-02 12:18:09

Sralse (291 views)
2017-07-25 17:13:48

Archive (977 views)
2017-04-27 17:45:51

buddyBro (1102 views)
2017-04-05 03:38:00

CopyableCougar4 (1678 views)
2017-03-24 15:39:42

theagentd (1430 views)
2017-03-24 15:32:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!