VideoRecorderAppState videos cannot be above 2gb?

Hello all,

I was taking some videos with the VideoRecorder and any video that was above 2gb would give me an error, and I couldn’t open. I was also using the “Advanced” video option, and that says

2.) If the filename ends in “.avi” then the frames will be encoded as a RAW stream inside an AVI 1.0 container. The resulting file will be quite large and you will probably want to re-encode it to your preferred container/codec format. Be advised that some video payers cannot process AVI with a RAW stream, and that AVI 1.0 files generated by this method that exceed 2.0GB are invalid according to the AVI 1.0 spec (but many programs can still deal with them.) Thanks to Werner Randelshofer for his excellent work which made the AVI file writer option possible.

Now I’m not sure if this how the VideoRecorderAppState does it, but I didn’t think there would be a size limitation. Is there any way to get around this, or am I having some weird error that might be linked to the “Advanced” way for video recording.

I’m trying to open this file in “Premiere Pro” and get “Unsupported or Damaged File…”

I do believe this was the error message I got when I tried to import the other avi’s above 2gb…

So I’m curious what I should do? I could lower the quality (I’m using 1.0, I did notice 0.8 is default), but would like the best quality possible, but not sure if there’s much if a difference overall at certain values…

Thanks all

try to convert it with a encoder before
ffmpeg -i yourfile.avi out.mp4

1 Like

Good suggestion by Empire, try that first!
Never used VideoRecorderAppState, but … can’t you just record multiple 2 Gb video snippets and then cut them together in Premiere? I mean, automatically? (slightly modified AppState)

I think so, yes, you could proabably make it stop and restart recording every X minutes.

Thanks, I’m not sure what you mean by “ffmpeg -i yourfile.avi out.mp4” Is this the command in order to convert a file using ffmpeg? EDIT; Saw the code on their page :stuck_out_tongue:

Also, figured that PP would have an encoder/decoder built in for this, but it doesn’t work.

But why exactly does this happen in the first place? I have users who will want to take videos, and this is a big limitation…

I’ve seen ffmpeg before, but never looked at it fully. Could I just use this library fully instead of JMonkey to record…?

Or would it be easier to record the video, convert in program, and then output for users to do what they want?

It’s a shame the video recording itself is slow, but to limit the size is also a big issue, so hopefully this will solve it, thanks :slight_smile:

Not sure how I would do this “automatically,” but you make a good point, though there’s a decent amount of code in the video recorder…

But why exactly does this happen in the first place? I have users who will want to take videos, and this is a big limitation…

Is there a way to change the video output to be something other than AVI? Not sure why this was the choice (AVI 1.0), and not another AVI Version or another format…??


This is something you run on the command line. If you prefer a gui - perhaps you use windows - Handbrake might help. If handbrake can’t process it, then its unprocessable :stuck_out_tongue:

the ffmpeg code that is? Called from the application that runs on the command line?

I’ve used handbrake before actually, I forgot exactly why I needed it though… Something with weird stuff and video recording or something.

I just really need something that I can convert in my application so the video doesn’t need additional pass throughs, or “extra work” involved in it :).

Just weird… 2 gbs…

No - you would open the command line and type

ffmpeg -i yourfile.avi out.mp4

If you are using linux, then you probably already know what that means. That leads me to believe you are using windows. If you really want to use ffmpeg on windows, I am unsure I can help as I try to avoid windows if I can…

Instead of using ffmpeg, use handbrake - open handbrake, open yourfile.avi as a source, and set the output format to mp4. Its pretty self explanatory :slight_smile:

Edit: as someone mentioned before, the 2GB limit is in the avi spec itself. I believe its because avi’s uses 32bit pointers internally, and that combined with other windows related bollocks means 2GB limit. I don’t know the full story - if you find out, post it here :smile:

You should be able to run command line arguments in Java though…?

I’m using Windows.

Again I don’t really have the option of doing this manually, if I’m going to allow other users to use the in-game recording.

According to the spec, the limit is on AVI 1.0. Why would you use the AVI spec and not another one for this purpose, with such a limitation? is AVI easier to use in this case…?

I’lll check it out and see how it goes, but not sure if this is going to be a project for a later time, or not…:(.

ffmpeg is a ncie library though, I’ve seen if used a lot.

Well you can run an executable from java if you really want to:

Runtime rt = Runtime.getRuntime();
Process ps = rt.exec("c:\Program Files\ffmpeg\bin\ffmpeg.exe");

but its pretty ew.

I would probably look at making many 2 GB files rather than 1 massive file. There must be a way to stitch them together, perhaps there is a java library that will do that for you without an expensive transcode.

1 Like

hmm, thanks. Yeah I saw about runtime and processes, but saw it was for reading the output, and I don’t care about that.

I could use the program to also stitch the videos together, but TBH stopping and then starting is a pain. I have a button that allows “auto-walk” and if I have another key pressed and try to shut off auto-walk it doesn’t stop and if I cancel the video before stopping the way then I walk an extra few steps and it messes up the video… I have to fix the autowalk issue with keys. Is there a Jmonkey issue with pressing multiple keys?> I sometimes notice that if I try pressing 3 keys at once it wont work, and it seems if I press 1 key (analog) and then turn off auto-walk (action), it doesn’t work sometimes…



Also, I found this for Java Xuggler someone had mentioned it’s integrated heavily with FFMPEG? Any comments on the xuggle? :stuck_out_tongue:

I have no comments on that, apart from its GPL so that is good.

Hihi … is jME bad because it is not GPL? :chimpanzee_wink:

Yeah, so user KonradZuse wants an automatic solution and I think I have pointed KonradZuse to the right direction - use a modified VideoRecorderAppState that starts a new video file every X seconds and then stitch together (maybe use a tool like ffmpeg to automatically stitch together the video files).

Writing raw (.avi) seems to be the best idea, because the grafix card does already use a serious amount of its power to render your 3d scene, so encoding the movie (e.g. mp4 or mpeg) might put another burden on the grafix card (depends on the actual hardware layout).

You want to use quality 100% (1.0) instead of 80% (0.8) - that’s okay too. It might even speed up things. Or it might slow down things. Don’t know for sure.

Just try what we suggested - I guess it can be done with only a few steps. You could even post it as open source so that other users can use large and uncompressed video too.

I might take a look at the VideoRecorderAppState (did never hear of this class before). Maybe it has already the feature to write out compressed videos (and hopefully not too slow).

(btw what a big name - I would never dare to use such a big name, but okay, if you think so… Zuse would probably not have any problems implementing the things we suggested :chimpanzee_wink:).

LOL good point, I am generally in favour of most open source licences be it GPL or BSD

There are a few “work around” solutions, but would like to hear from a “Core member” about what the future brings with this.

I don’t mind doing a mini-project myself, and then making the code available for others either, when that will happen is the question.

I’m not sure of the different formats, but the AppState itself takes a lot of resources and slows the scene down. I don’t see how AFTER the video is done recording, that it couldn’t encode into the new format, and do it decently fast. I would assume the video recording itself is what takes up the most time.

Also, I wonder how it would be if ffmpeg or Xuggler were used to record video. Not sure how it would differ compared to the appstate itself.

100% quality will be slower due to it being better quality, I would assume it would be slower anyways.

Not sure what “compressed” or “uncompressed” video would be…

Yeah, decently big name ofr an appstate, I thought you were talking about my name, since yours is 4 letters LOL.

I’ll take a look at it and see what’s going on.

There are many “Open Source” licenses. GPL/2 MIT, BSD, etc Not sure what the differences are with each.

Fundamental differences:
-you must distribute the source with the binaries or at least make it available.
-if you use the code then all of your code is also GPL (it’s viral)
-other restrictions about the use of patents, etc. that would affect the viralness of the derivative works.

-you can’t claim you wrote it
-you can’t claim the author endorses your product
-you can’t sue the author because your nuclear reactor melted down due to using it
-else you can do anything

Thus, if you like the politics of GPL then you go ahead and release code “with strings attached”… thus limiting your audience to a subset.

If you want everyone possible to use your code and not take advantage of you then you go with BSD.

Hm, yeah, I think I know what you mean. Things are quite unorganized now.
I really would like to have an overview of all contributions / plugins and some meta info for each.
E.g. somethings similar to this:

So you’re essentially saying that any code that is “GPL licensed” is technically theirs, and if we use any GPL code in our application “essentially” all of our code is theirs…???

Does this include applications you’re writing, or only code you distribute?

Doesn’t sound like fun to me lol…

I better check out which licenses run with which libraries/frameworks I’m using, or does it not really matter? Is there a list somewhere of what uses what license I wonder?

So people can get taken advantaged of with the MIT license, so BSD is the better choice? or is MIT and BSD the same thing, and you were talking about the GPL license???

I was trying to look up the GPL license and apparently there are 2 of them. one for “proprietary software” and one for “free software.”

Couldn’t you get your own licenses for code you write, or is that just a lot of money and legal crap that a lot of people don’t care to go through???

thanks for the info.