Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (761)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (846)
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  
  Encode a sequence of images into video  (Read 1503 times)
0 Members and 1 Guest are viewing this topic.
Offline lisandroCT

Innocent Bystander





« Posted 2015-10-19 14:02:17 »

Hi! A key feature in my current game is recording videos of the screen. I've already manage to build a pretty decent library that is able to save screenshots at certain fps without affecting the game performance at all. Now I need to encode those stills into a video.
What do you consider the best way to follow? I need a cross platform solution that can do all the job inside the app, not depending on external apps or program.
I've consider ffmpeg but it's not Java and I think it wouldn't be so trivial to wrap it in Java and port it to Android and iOS.
There is a (not so good) Java library called JCodec that runs on desktop and Android, too. But I don't know how well it will behave on iOS and it's pretty limited.
And I've even consider using gdx-video because I think it wraps some of ffmpeg functionality, but if i'm not wrong it's only able to decode and I don't know if it runs on iOS (and there isn't so much documentation)
Do you know any almost native solutions for each platform? What path would you take?

Thank you in advance! Any idea (even vague) will be appreciate!
Offline KaiHH

JGO Kernel


Medals: 521



« Reply #1 - Posted 2015-10-19 14:38:56 »

If you are familiar with how to write JNI libraries, I would recommend making a binding for libx265/HEVC, if you don't need a whole array of different video/audio/subtitle codecs in your game and want to keep things small. libx265 has a very decent build process, also working out of the box on Windows/msvc. No other library I know of has this ability. Smiley
If you need multiple such codecs then FFmpeg really is the best shot there is.
libav is not worth talking about. It is goddamn slow.
If you choose FFmpeg then there is Xuggler, which provides a JNI binding more or less with a custom API for FFmpeg.
And you would need to build FFmpeg for each of your target platforms.
For iOS there seems to be: https://github.com/kewlbear/FFmpeg-iOS-build-script
For Windows this one is great: https://github.com/rdp/ffmpeg-windows-build-helpers
Or if you don't want to build yourself on Windows, then Zeranoe is of course the solution: http://ffmpeg.zeranoe.com/builds/
Offline KevinWorkman

« JGO Plugged Duke »


Medals: 283
Projects: 12
Exp: 12 years


HappyCoding.io - Coding Tutorials!


« Reply #2 - Posted 2015-10-19 15:57:51 »

I've used FFMpeg to do pretty much exactly what you're describing. It wasn't very hard. Here is an explanation of what I did. You'd just need to get rid of all my OpenCV stuff and substitute your own screenshots in.

HappyCoding.io - Coding Tutorials!
Happy Coding forum - Come say hello!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline basil_

« JGO Bitwise Duke »


Medals: 418
Exp: 13 years



« Reply #3 - Posted 2015-10-20 18:26:50 »

i still have to try it out by myself .. last time i looked for java flick encoding i ran into https://github.com/artclarke/humble-video which looks pretty interesting.

o/
Pages: [1]
  ignore  |  Print  
 
 

 
EgonOlsen (351 views)
2018-06-10 19:43:48

EgonOlsen (344 views)
2018-06-10 19:43:44

EgonOlsen (292 views)
2018-06-10 19:43:20

DesertCoockie (516 views)
2018-05-13 18:23:11

nelsongames (843 views)
2018-04-24 18:15:36

nelsongames (829 views)
2018-04-24 18:14:32

ivj94 (1251 views)
2018-03-24 14:47:39

ivj94 (395 views)
2018-03-24 14:46:31

ivj94 (1058 views)
2018-03-24 14:43:53

Solater (413 views)
2018-03-17 05:04: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!