wmv2 # 0xb42400 warning, clipping 1 dct coefficients to -255..255 - c

[wmv2 # 0xb42400]
warning, clipping 1 dct coefficients to -255..255
I'm modifying some code in a C API that interacts between FFmpeg and and an AS3 Air application to encode a video after creating something.
WMV was working okay earlier but now I've set things back I'm getting this very peculiar warning coming from the c library but it doesn't make any sense and googles not providing many answers.
I was wondering if anyone out there knew what this warning was about? When the file comes back to me it's totally empty with 0 frames. I must have changed something so I'm comparing the file from a few days ago with this one looking for anything that may have caused it to no longer work. But I was wondering if anyone had any better ideas than blindly looking through old and new code.

This particular warning comes from the FFmpeg core code. It is just warning that it had to perform an adjustment on some bits of the video stream in order to successfully decode it. It might help to understand that the WMV2 algorithm (being decoded, per your error message) was reverse engineered from binary code and reimplemented in FFmpeg, which is why things like this slip through the cracks.

Related

Implementing a simple code in Microsemis Soft Console

I would like to get into the field of FPGAs a bit. I currently have a PolarFire Everest Dev Board and would like to try something small on it for testing purposes. My current level is very low, i.e. complete beginner. My first working project was a counter that counts binary to 15 and outputs it via the LEDs of the board. Now I wanted to play with RISC-V. Unfortunately I can't find anything on the internet that meets my expectations and almost nothing is "beginner friendly". My current goal is actually just to implement something on the level of a Hello World program in C via the SoftConsole. Unfortunately I have no idea how to go about it. Can anyone help me or recommend a good entry on the internet? Most of the stuff is either unusable, requires licenses I can't get, or is simply no longer available (which happens to me quite often with PDFs from Microsemi).
Since I don't really know what I could do with it to start with, I don't have any code yet that I would like to include. The plan would actually be to create something where I also get feedback via the board that something has been done. Later when I have more understanding SRAMs should be managed with it.

Using jpegtran to rotate progressive jpegs: invalid SOS parameter for sequential jpeg

My app tries to rotate images based on exif data.
I keep getting requests about jpegtran complaining about ’invalid SOS parameter for sequential jpeg” and jhead aborting operation. Apparently this is not even a fatal warning, and many forums give instructions on how to ignore it?
Invalid SOS parameters for sequential JPEG
Any ideas on how to get jpegtran to completely ignore this warning and process the images anyway?
I have an issue with sample images here
https://github.com/savolai/JPEG-Autorotate/issues/1
I thought already to first convert the image to non-progressive using jpegtran, but it complains even then and refuses to do it.
.\jpegtran.exe .\testimages\invalid-sos-parameters-progressive-jpeg\20180516_14530
8.jpg > .\testimages\invalid-sos-parameters-progressive-jpeg\nonprog.jpg
Does anyone know any other binaries or ways to get jpegtran.exe to ignore the error? Or do you know if mozjpeg jpegtran is more lax about this?
https://github.com/mozilla/mozjpeg/blob/master/BUILDING.md
I suspect that the source of the problem is that the spectral selection fields in the SOS marker are set to zero. These fields are meaningless in sequential JPEG but the standard says the values should be set to 0 and 63. Some JPEG references one sees on the internet say these values are ignored. Probably some encoders do not set them.
You might want to run a JPEG dumping program on your images to see if your spectral selection values are set to zero and 63. If they are not, you can write a relatively simple filter program that copies the JPEG stream while changing the spectral selection values.
I expect that the JPEGTRAN source code is online. If I am correct that it is making this needless check, you could build your own version with this commented out.

Homeworld 2 map scripting with lua 4 unknown errors

I am scripting maps for the game Homeworld 2, the original NOT remastered (since I don't have and can't get remastered).
Problem is, I'm getting an error in the script somewhere, which I'm pretty sure is a syntax error because it makes the game crash before the main menu (from experience other error types usually cause a crash at the time the map loads).
I have tried using codepad.org and checked out other similar sites, but they don't let you choose lua version 4 (which is what Homeworld 2 uses), so I can only assume they use lua 5, which means their utility is rather limited. Codepad said my code was good despite this.
I have skimmed the lua 4 documentation, but honestly I have no idea what I'm looking for.
Thus far, my programming experience is c++, and the little bit of lua I gleaned from example Homeworld 2 maps and my quick perusal of the documentation.
As near as I can tell the code should be good. I do recall hearing something ages ago that not all of lua was valid in Homeworld 2 and that Homeworld 2 had additional limits on what lua could do, though I haven't been able to find it again.
All my research in trying to solve this issue from searching the Homeworld end of things keeps bringing up the remastered stuff rather than the original homeworld 2 stuff, and remastered has changed things about some. Even then, I still haven't found any topics on the limits of lua scripting.
The script I made basically makes a random map of a randomly chosen style (i.e. the resources might be evenly distributed throughout the map, be concentrated in a big field, or come in clusters, or even a big ring.).
My first version of the map worked, but was messy and disorganized, so I rewrote the whole thing to be neater and easier to tweak (i.e. I moved many variables to the top so they can be easily found).
All the core code should in theory be the same, only with certain things moved around, and better commented.
I did put some of the code into functions and called the functions, but I can't find anything that says I did it wrong.
So what I need is something that can either check lua 4 code for errors (the ones that can be found without running it anyway), or something that rather clearly shows how lua 4 did things different from lua 5. Of course, if anyone knows anything about Homeworld 2 specific limitations, that would be wonderful.
If you have experience with C++, it shouldn't be a problem for you to compile a standalone version of Lua 4.0.1 (it's very easy, and the codebase is highly standards compliant, compared to typical C/C++ projects). This would certainly let you at least check for syntax errors (i.e. "errors which can be found without running it").

Proccessing "JACK audio" data with C?

My question is slightly abstract but with good grounds. I have successfully ran a JACK script written in C that loops the microphone audio data to the speaker, However I would like to know how to alter the stream of audio my self during playback, perhaps one thing I'd like to try is filter the high(or low) frequencies (CUT them completely off). From my understanding audio comes through as an analog signal and converted to a digital value (within a certain range).
I'm guessing I'm forced to go about this one of two ways, I think one way is to process each value and check if it below the frequency (or above the frequency) I don't want and then alter the value to 0(or the previous value from the last loop cycle to prevent blank spots in the audio during playback). The second way i'm guessing is that JACK presents the buffer with a full array of values that are assigned by frequency spectrum. How do I go about doing this? (In the future I want to do other things with the raw data but I think this is a great start to get familiar with raw audio processing)
Here is my simplified code: http://pastebin.com/Hmiumqkz
You can see that I tried printing the in value as its supposed to be a "float" I thought I might be able to filter frequencies from there but I'm not sure as I don't get anything printed in the console when i run this code it just loops back the mic to speaker but with out any printing to the console.....
NOTES: I have already successfully compiled and tested programs that used the Gstreamer, ALSA, NAudio, irrKang, and the Phonon libraries, they don't allow me to have the cross compatibility i need between OSs and the raw audio data I require for my project, all i ask is to please think twice before lazily report for me to use "other libraries" only for the sake of it being "easier" but I have already tried them and they all fail me.
You haven't really asked a question that can be answered here on SO, so I'll point you to some outside resources.
Here is a tutorial for designing EQs based on the popular RBJ filters:
http://blog.bjornroche.com/2012/08/basic-audio-eqs.html
Most of it is written in C-like psuedocode and will walk you through step-by-step.
Here is the correct answer (You'll notice a printf() function in the proccess(){} call back function) the for loop prints out the the current frames in the buffer(Frequency domain but the for() loop is printing over time so its the time-domain as well -- its both frequency and time)
http://pastebin.com/axDLw7cc

Computed Tomography: Matlab to C/OpenCV code conversion error

I am working on a Computed Tomography problem, in which I have to simulate the generation of the raw data or sinogram that a CT apparatus generates.
Matlab has an in-built function "radon()" to simulate the same. I have successfully written a custom code in Matlab to generate the sinogram (ie: without using radon() ).
I have converted this code into C, using the OpenCV library to handle the loading/display/saving of images.
The problem is that though my matlab output generates the sinogram as expected, my C code does not. I have merely translated the Matlab code into C but the C output is oriented differently as well has black strips in between. The gray levels in the C output kind of resemble the Sinogram gray levels and pattern generated by the matlab code. Only thing it appears segmented in C.(I will send the images across if you gimme your mail id since i cannot attach them here.)
Could someone help me out as to why this is happening? I have peer-reviewed my code and checked for type cast errors, memory allocations etc. But They all seem correct.
Does matlab handle data that differently than C? What could be the explanation for the tilt?
Please Help me out. Do let me know if you need any more clarification regarding the problem statement or need to see the algorithm.
Thanks!
Very hard to help with a question like this, when we don't see either code, the output, or the expected output.
Perhaps you can upload the images to some public image hosting, and add links from the question?
If you're doing trigonometric function calls (sin() and friends), I would pay extra attention to the arguments used, and also check if maybe Matlab is delivering more precision in the result, somehow. Of course, this is a stab in the dark since I'm not familiar with your domain.
Here are the images related to the doubt I asked in the original post
The expected output:
http://www.photoshop.com/users/pyridot/albums/a40e3f7326d942ff821fc00612e6b458/view#e027c2b94bfd4210870bc6c57b1f1a03
The C Output:
http://www.photoshop.com/users/pyridot/albums/a40e3f7326d942ff821fc00612e6b458/view#ff529abedb3e49aa8865276f2c2bc625

Resources