VideoRecorderAppState videos cannot be above 2gb?

Well the JMonkey VideoRecorder is slow too… (or maybe it’s the taking of the pictures)???

Why would ffmpeg be faster, because it’s using command line, and possibly assembly lower level code?

I’m curious how Jcodec works compared to “VideoRecorderAppState…”

I’ll test it out, and report back.

I’ll have to also dig through the VideoRecorderAppState and copy it.

There’s a few things I’m not exactly sure what’s going on, but it seems to need the “VideoProcessor” and the SceneProcessor? It also seems to run on multiple threads, and counts the number of “cpus,” I’m assuming that variable is meant as “Cores,” or threads (which would make more sense).

Lots of stuff in this file…

I just don’t see why we couldn’t just take a bunch of screen shots and put them together? I see it uses the “ScreenShots” class, but it does a bunch of other stuff too…

public void addImage(Renderer renderer, FrameBuffer out) {
            if (freeItems == null) {
                return;
            }
            try {
                final WorkItem item = freeItems.take();
                usedItems.add(item);
                item.buffer.clear();
                renderer.readFrameBuffer(out, item.buffer);
                executor.submit(new Callable<Void>() {

                    public Void call() throws Exception {
                        Screenshots.convertScreenShot(item.buffer, item.image);
                        item.data = writer.writeImageToBytes(item.image, quality);
                        while (usedItems.peek() != item) {
                            Thread.sleep(1);
                        }
                        writer.addImage(item.data);
                        usedItems.poll();
                        freeItems.add(item);
                        return null;
                    }
                });
            } catch (InterruptedException ex) {
                Logger.getLogger(VideoRecorderAppState.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

it seems like some of it has to do with “workItems” so I’m assuming that’s for threads.

HMMMM…

Lots of I/O versus more CPU also there to tip the scales. So no telling what the outcome is :slight_smile:

simply put, bulk math operations is the one part where c /c++ is really faster than java from my point of expirience.
Reason is simply that java does a lot of bound checks, while c just omits them. (Every pixel access results in multiple bound checks)

I just edited my above post, so you guys should check out the edits.

Also weird error… I clicked “submit edit” and I got dialog that said "Okay 429" with an okay button, which closed it but didn’t submit my edit. After clicking “Save edit” again it saved… weird…???

We will see :smile:

Thanks, yeah if ffmpeg uses c/c++? Not sure what it uses 100%

If the code is structured right then hotspot can and will remove these checks.

It still only runs around the speed of C code with debug mode on. (wich is probably cause java kinda has it force on always)

With full optimization, you strip the debug info out of class files, too… then your stack traces no longer have line numbers and stuff. Hotspot will work either way, though.

It’s funny how this thread derailed at least twice (licenses and c/c++) :chimpanzee_closedlaugh:
Did not read everything, but here are my comments:

1 - LGPL is a nice license in my view. Not as open as jME, but still nice.

2 - codecs…

Yes, I can confirm that. Had studied that topic a while ago. No exact rules and it depends how much revenue your project makes and how many videos you make, theoretically the makers of the codecs / algorithms could collect money from everyone using it. The open source implementations like vorbis are a gray area, but most people agree, that these are still illegal codecs and kind of “underground culture”.

One day people are going to look back on this thread once the fix for this is out, and wonder why the thread is 150 messages long…

  1. I cannot comment much on how good it is, maybe for open source, and for those who need the license, but for those who want “Freedom” I don’t think it’s very good.

  2. Care to shed some light on the area of codec usage since you “had studied the topic awhile ago.”

What exactly are they looking to charge for? Just the usage of the codec by means of converting to/from it?

If the codec was purchased from another library, how does that work for us? I.e., did ffmpeg/Jcodec buy the license for the codec in order to implement it, or why are they able to use it…???

I’m curious what options we have for JMonkey, to make the VideoRecorderAppState better? I would like to implement the code I found from JCodec, but I’m not sure about licenses and shizz…

Coding to some is complicated, but these licenses and knowing what’s what gets annoying, granted you’re supposed to read what you’re using and the licenses before buying, (or before clicking accept :P).

  1. LGPL only demands a library to be viral which your project is using, but not your project itself. So it’s not just for open source projects and a good way to enforce that contributions to a much used library to be open source.

  2. is extremely complex, but everything is bad.
    Here are some things that I remember:

  • if you want to sell or give away videos: it depends on the number of videos that you make - there is some discount mechanic for heavy users that sell 100.000 videos or more (but it’s still very expensive).
  • if you write a software that uses a codec, you have to pay license fees to patent pools like MPEG LA and others. examples for expensive codecs are H.264 (mp4) and especially H.265 (next-gen video standard, first implementations are in beta or recently released)
  • as I interpret this, not only the implementation but the whole idea is patented, so writing your own H.265 codec is possible, but the patent of the algorithm itself is protected (someone has done the research and develop of that algorithm and a lot of brain smarts was put into it - and that was expensive), so it is a software patent and software patents are usually registered in the USA (in our country you can’t patent a software algorithm yet … but TTIP is on the way to “harmonize” that too).
  • for truly free codecs - the actual thruth is: there is none! Example: Google tried a free alternative with VP8 and lost a long and stressful lawsuit and finally paid the MPEG LA patent pool licenses. Cisco has a H.264 codec and “under certain circumstances” you can use this codec “for free” (but Cisco will actually pay the license fee for you in that case).
  • there are some things being worked on, for example “Cisco Thor”, but it is difficult to create something from scratch and avoid using results of the last 20 years of research and development (today’s video compression techniques are extremely efficient compared to those from the 1990s).
  • of course, if you use uncompressed video (not really a codec) you can get away with it - at the cost of having extremely large .avi files

:chimpanzee_sad:

EDIT: I did not remember some details correctly. The number 100.000 appears, but in a different context. And hosting videos with less than 12 minutes length is generally free. For anyone looking for the details for the H.264 standard: http://www.zdnet.com/article/a-closer-look-at-the-costs-and-fine-print-of-h-264-licenses/

Phew… I just read until post #41 and it is really tough to not start skipping text. :chimpanzee_wink:

Addition to the whole “can I use patents” and “will I need to pay licenses” etc:

  • whatever you do in your room or your parents basement and what does not leave your home, you can do whatever you want. you can make .mp4 videos, show them to friends, etc. all okay. I guess it is self-explanatory.
  • if you upload your videos to Youtube, this should not be a problem, because I think Youdude will transcode the video and publish it. so they pay probably huge amounts of license fees and get a little bit of advertisement income in return. I’m not 100 percent sure, but that’s how it should work.
  • if you put your video on your own website or on a DVD, then you will have to pay per video (get discount when sold many items)
  • if you make an app that uses mp4 codecs and sell that app, then you will have to pay once (or each major version or per sold app, don’t know) (maybe get discount depending on your sales)
  • if you make an app and give it away, you could still be charged or at least your users. but in that case patent holders will assume that you as a hobby underground hacker will not have money and won’t be worth the hunt for dollars.

I would like to add another option:

If sharing “videos” is a gameplay feature, then you might come away cheap if you only record the player inputs (or entity changes) and simulate the same inputs when replaying. (Battlefield 2 did it this way)

Nice sideeffect, if the outcome of the replay is not the same as on the original, you might have fun time tracking bugs down :wink: At least you know that your game is not deterministic

On the other side, if its only to upload videos to youtube/twich/whatever, in times like this where both AMD and Nvidia offers recording tools at a very very low performance cost, adding a quite heavy ingame recorder feels overkill

zzuegg is absolutely right. google ShadowPlay (NVIDIA), for AMD there are similar solution(s).
Of course this presumes your computer has AMD / NVIDIA hardware, which is not the case on all devices (especially most Macs and most tablets and smartphones).

Sorry I didn’t reply yesterday, haven’t really been feeling well the past 2 days, but I don’t want to leave you guys hanging, so thanks for the help!

  1. What do you mean by 'only demands a library to be viral which the project is using?" The library would already be “viral” wouldn’t it? It was saying that code you use with the library has to be public also?

But from this link licensing - Can I use GPL software in a commercial application - Software Engineering Stack Exchange

It talks about the ENTIRE APPLICATION having to be “open source” not just the initial library. Also what has been posted as the “Gpl Virus” is saying that all applications/libraries written containing a gpl licensed product will also be gpl.

gpl had said something about reporting applications that aren’t gpl, but use gpl, and to contact the library’s owner… How would gpl know if you’re using a gpl library in your project…???

  1. So essentially if you’re “selling videos” or “profiting” from these videos, in some way, then you get charged. My application doesn’t need video at all, but it would be a nice “bonus…” Do they consider how much the video is needed in order to sell the product, or it’s just “if you use our codec, and make money, then we want money from you, regardless how much you really needed it?” I liked the idea of creating a separate application for video conversion and just give it to people for free, which should negate any legal stuff, right…? (will talk with lawyer and such before doing anything of course).

I’m also curious if that’s the same for these other things, like MPEG4. Getting an email from someone’s lawyer saying we cannot use this because of this this and this, and to remove it, or else buy a license and such is fine, but to get slapped with a “you owe us this much money because we estimate you made this much money off of us blah blah blah” type crap… I assume warnings and such come first but I don’t know if anyone has experience with that.

As for paying license fees for using the codec, so essentially ffmpeg, and these others have already paid for their licenses and whatnot, BUT if WE use their library, then we also have to pay (or since ffmpeg is a “free service” it didn’t pay for anything…? Speaking of that, I think someone also said these companies try to go after users as well, who are using these converters and didn’t pay…? I would assume not, because Adobe uses these codecs, and so do other applications, unless part of your subscription/product-license is those codecs, and these companies have a “partnership” with MPEG and such…? I would assume not because handbrake is also free, unless that’s a risk application…???

So the V8/9 or w/e isn’t good to use either then…?

I don’t mind having very large files, but there apparently is this 2/4gb file limit problem…

As for your edit, none of the videos will be longer than a few minutes probably, well, depending on the users. I made a video that was 3 videos, and it was 1.5 minutes, and I feel I barely showed anything, granted my movements were “slow.” This is only for H.264, and not others?

So, as I said above, I think creating an extra side application will work well if it’s allowed/legal. The movies themselves are part of JMonkey, and I will most likely continue to work with VideoRecorderAppState, unless we figure out something better (noticed something was mentioned below, will check that out). I’m not sure where exactly in the appstate is the “Bottleneck” that makes the movies slow. It could be the AVIConverter that takes a lot of times, but at the same time, that only happens at the end, so maybe just taking 30 screen captures a second eats at the GPU. Granted my laptop is almost 5 years old, and uses a 1 gb GT550m from Nvidia (I think it’s integrated too), so I assume a newer card will work wonders with all of this LOL…

Thanks for the help.

Yeah this thread is big LOL…

Interesting about youtube, but I guess it’s since they are doing it and paying we don’t have to worry. Wait, so if we put a mp4 video on our website we can get charged for it…? A DVD in the sense of selling that DVD, or even giving it to a friend of a video you made…???

That’s crazy that you could be charged if you give an app away for free. The users shouldn’t be charged either… So in the case of handbrake, and other applications that are free…? I guess my comments about Adobe are true too then…

Hobby underground hacker? :stuck_out_tongue:

definitely not looking for anyone to get in trouble…

Thanks for the info,much appreciated. Essentially for now it’s going to be used to showcase maps. Users will walk around the map as it records and then show it as a video to others. Nothing major (I think)…

Do you have any more information on these recording tools and their cost and such?

Thanks :smile:

Thanks will do.

For now we will be windows mostly, and if users want Mac, we can do that too… What do Macs use proprietary gfx??? Some smartphones do have nvidia gfx I believe?

Thanks for the help.

ShadowPlay looks cool for sure, but I’m not sure if we will want something proprietary or not…

Yea I know complicated :P. Good to know there is stuff out there. So does Nvidia have to pay for that h.264 codec?

With cost i was referring to performance cost. It comes down to recording the players input signals, and then on a replay replaying the exact same input.

There is GPL and there is LGPL.
GPL means that if you use some GPL code (with the exception of shady tricks like command line - which other users wrote already) then your code must be open source under GPL too.
LGPL means that if you use a library or tool written in LGPL, you can still have closed source, proprietary code and you can chose your own license for your code. But if you want to modify the LGPL library or tool which you are using, then these modifications for the library or tool must be under LGPL too. This enforces that changes to a much used open source library will be open source too, so that other users can benefit from upgrades to that library just like you can benefit from any upgrades to that library.

If less than 12 minutes, then you’re lucky (for mp4 alias H.264 encoded videos). There are similar rules for other video codecs too. That’s what I meant by “No exact rules and it depends how much revenue your project makes and how many videos you make, theoretically the makers of the codecs / algorithms could collect money from everyone using it.”

Read the link that I posted, here is a citation: “Although the license agreement uses the word sold, the royalties have to be paid even on software that is given away.”

I think you should really read this, if you are interested in the exact rules. There are other websites too and back then when I made my little research I used a different website which was more closely related to the patent holders. But I think this website (see link in my EDIT) explains it quite good for the average layman.

It’s a complex topic. But I think you now have most of the information you need, in order to understand the basics. The tragic irony is that both you and me could not defend ourselves in court by saying: “I didn’t know any of that legal stuff.” :chimpanzee_wink:

Sorry, I don’t know how to quote a quote in a quote in a quote.

I wrote:

zzuegg is absolutely right. google ShadowPlay (NVIDIA), for AMD there are similar solution(s).Of course this presumes your computer has AMD / NVIDIA hardware, which is not the case on all devices (especially most Macs and most tablets and smartphones).

You wrote:

Thanks will do.

For now we will be windows mostly, and if users want Mac, we can do that too… What do Macs use proprietary gfx??? Some smartphones do have nvidia gfx I believe?

There is the shield tablet and some smartphones with NVIDIA hardware, yes.

Macs (and many Windows notebooks or low-cost PCs) usually use an integrated graphics unit, like “Intel HD” or some mixed CPU/GPU chips from AMD.

ShadowPlay was designed for NVIDIA graphics cards and I think is part of their driver and configuration software suite. I might be wrong on this, but usually these features are made in an attempt to have better hardware/software combo than the competitors (so I think I can use ShadowPlay with my NVIDIA PC, but not with my AMD PC).

ShadowPlay is only with NVIDIA hardware yes, and quite new one. It is great for recording. Better than Fraps & ShareX at least. I totally recommend it for screen recording. I haven’t used the “shadow” feature, only as a regular recorder.

Thanks for the info. This is more than a replay, unless you mean external replay, by replay I think of like Team Fortress 2 where you die and then it follows other players or whatnot, until you respawn.

Would recording every input be a lot of work I wonder? I still want to record it though and post later.

Thanks for the info. I’ll send this info to the boss, and he will contact the law team and figure out what’s going on. I doubt our users will be creating videos that are above 10 mins long.

Also, I myself can just put some code in that will make multiple videos, if a single video is above 10 mins long. I doubt that will be too much of an issue for users, but I don’t want to get in trouble, nor them to get in trouble.

Thanks for the info. I was looking at the “sheild” wich I thought was just a device to stream content. I noticed they used their “Jetson Tk1” MB in it, and I was thninking of doign hat for our customers, but I tihk that’s way too overkill to spend 200$ and build a unit that’s needed wehen we could just do this so much simpler.

It seems really good, I’m just not sure if it’s something we want to include to our users, since it’s not our own proprietary work… I’ll have to check with the boss, but I think this is something that will be good. This entire idea is more than just a JMOnkey Application though, so for users that aren’t the normal “gamers” but more 'businesses" I don’t know if this approach will work, or not, whihc is why I want an all-in-one solution for everything.

Not sure how many people want somethign running in the background, though I find this will probably be the best idea…

Not too sure how hard it would be to copy their recording idea, but I assume it requires some heavy OpenGL, OpenCL, and probably CUDA programming on NVidia’s end.

Thanks all!