I use:
<artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.SR6</version>
in my application.properties I have put
spring.profiles.active= prod
spring.application.name= FunctionalControl
I can see on the log :
2016-10-20 17:58:17.900 INFO c.o.l.f.Application - The following profiles are active: prod
But if I use tcpdump I can see than despite does a GET /FunctionalControl/prod
on my spring.cloud.config server It does GET /FunctionalControl/default
0x0030: 15f1 ddb3 4745 5420 2f46 756e 6374 696f ....GET./Functio
0x0040: 6e61 6c43 6f6e 7472 6f6c 2f64 6566 6175 nalControl/defau
0x0050: 6c74 2048 5454 502f 312e 310d 0a41 6363 lt.HTTP/1.1..Acc
0x0060: 6570 743a 2061 7070 6c69 6361 7469 6f6e ept:.application
0x0070: 2f6a 736f 6e2c 2061 7070 6c69 6361 7469 /json,.applicati
0x0080: 6f6e 2f2a 2b6a 736f 6e0d 0a55 7365 722d on/*+json..User-
So I never manage to use FunctionalControl-prod.properties from my git repo :-(
I found myself the solution and share it with everybody.
The active profile for config server is taken in consideration only if it is put into bootstrap.properties (or .yaml) not in application.properties
file bootstrap.properties:
spring.profiles.active= prod
spring.application.name= FunctionalControl
I add this file in my project and then it works fine as you can see on this tcpdump
0x0000: 4500 00d3 0799 4000 4006 348a 7f00 0001 E.....#.#.4.....
0x0010: 7f00 0001 9f40 22b8 8800 ede0 32d2 4aa8 .....#".....2.J.
0x0020: 8018 0156 fec7 0000 0101 080a 16da ea48 ...V...........H
0x0030: 16da ea48 4745 5420 2f46 756e 6374 696f ...HGET./Functio
0x0040: 6e61 6c43 6f6e 7472 6f6c 2f70 726f 6420 nalControl/prod.
0x0050: 4854 5450 2f31 2e31 0d0a 4163 6365 7074 HTTP/1.1..Accept
0x0060: 3a20 6170 706c 6963 6174 696f 6e2f 6a73 :.application/js
0x0070: 6f6e 2c20 6170 706c 6963 6174 696f 6e2f on,.application/
0x0080: 2a2b 6a73 6f6e 0d0a 5573 6572 2d41 6765 *+json..User-Age
0x0090: 6e74 3a20 4a61 7661 2f31 2e38 2e30 5f34 nt:.Java/1.8.0_4
0x00a0: 350d 0a48 6f73 743a 206c 6f63 616c 686f 5..Host:.localho
0x00b0: 7374 3a38 3838 380d 0a43 6f6e 6e65 6374 st:8888..Connect
0x00c0: 696f 6e3a 206b 6565 702d 616c 6976 650d ion:.keep-alive.
You need to define the active profile for your config client application (in your case "FunctionalControl"). There are multiple ways to do that.
E.g. you can add the following to your client's bootstrap.properties file
spring.profiles.active=prod
or e.g. start you config client application via
mvn spring-boot:run -Dspring.profiles.active=prod
Either way, your client server application doesn't need any active profile. It will server whatever file is available in your git repo.
I created an AVI file by rendering the frames using Cairo. The AVI generation code is part of an OCaml library. However, ffmpeg and vlc both yield only the very first frame. If I cut the avi header and use ffplay with the proper codec options, I can view the movie just fine.
What causes ffmpeg to think this file has only one frame?
The header of the file looks like this:
0000000 4952 4646 d0e0 0278 5641 2049 494c 5453
0000010 00c0 0000 6468 6c72 7661 6869 0038 0000
0000020 a2c2 0000 0000 0000 0000 0000 0100 0000
0000030 003c 0000 0000 0000 0001 0000 0000 0000
0000040 01e0 0000 01e0 0000 0000 0000 0000 0000
0000050 0000 0000 0000 0000 494c 5453 0074 0000
0000060 7473 6c72 7473 6872 0038 0000 6976 7364
0000070 4752 2042 0000 0000 0000 0000 0000 0000
0000080 000a 0000 00f0 0000 0000 0000 003c 0000
0000090 2000 00fd 0000 0000 0001 0000 0000 0000
00000a0 01e0 01e0 7473 6672 0028 0000 0028 0000
00000b0 01e0 0000 01e0 0000 0001 0018 0000 0000
00000c0 8c00 000a 0000 0000 0000 0000 0000 0000
00000d0 0000 0000 494c 5453 d00c 0278 6f6d 6976
00000e0 3030 6364 d000 0278 0000 0000 0000 0000
00000f0 0000 0000 0000 0000 0000 0000 0000 0000
I found the answer. Something not mentioned in the docs I read was that the stream itself needs to be encoded as a list of CHUNKS. So every frame shall be one CHUNK. This is, of course, not necessary in principle, but seems to be a very common convention.
I just need some clarification on how to properly convert rgb pixel values in the range [0,1] to be in the right range for a HDR format like openEXR.
So I know for instance that when working with low dynamic range formats like PNG or JPG that only have 8 bits per channel, you simply have to multiply each rgb value by 2^8-1 = 255 and clamp so that all your values are in the range [0, 255].
OpenEXR and other HDR formats use a half precision format with 16 bits per channel. So do I just do the same thing as before and multiply each channel by 2^16-1 = 65535 so that my new range becomes [0, 65535]?
EDIT
So I tried doing what I wrote above but when I try to display the openEXR file in photoshop it is completely white. It seems like any value greater than around 10 or so is too bright for photoshop to display properly which I find very odd. So this doesn't seem like the correct way to do it unless there is something wrong with photoshops display.
We are dealing with three related but different issues at the same time.
The first issue is that of range: are channels stored as values in the range [0, 1] or [0, 255] or [0, 65535]. Scaling (multiplying and possibly clamping) is what you do to convert from one range to another.
The second issue is that of raw sample size: how many bits do you use to store the value. This doesn't necessarily have to be the binary logarithm of the size of the range. For example, if your range is [0, 255], you could store the values in 8 bits where the least significant bits represents increments of 1, or in 6 bits where the least significant bit represents increments of 4, or in 10 bits where the least significant bit represents increments of 0.25. In fact, as we will see in the next issue, the increments do not have to be fixed.
The third and final issue is that of encoding: fixed point or floating point. When we say that we store values of [0, 255] in 8 bits or values of [0, 65535] in 16 bits, we usually mean integer encoding (a special case of fixed point where the least significant bit represents fixed increments of 1). When values are stored in the range [0, 1] however, regardless of the raw sample size, usually this implies floating point storage (where most bits are used to store the significand, while a few bits are reserved to store the size of the increment associated with the least significant bit). When we speak of "half precision", "single precision", "double precision", "extended precision" and so forth we also invariably mean floating point encoding.
So here is the catch: OpenEXR uses floating point encoding, in a format that is not built in to most programming languages. Most modern languages only have 64-bit floats, and if they offer anything else it's usually 32-bit floats (respectively double and float in the C family), but 16-bit floats are almost never available out of the box.
Half precision can represent values in the range [-65505, 65504], with 11 bits (slightly better than 3 decimal digits) of precision, while also being able to represent values as small as 2^-14. However, given that OpenEXR is a HDR format, you are probably not really expected to use the entire range because the number encoding is chosen to accomodate for (extreme) over- or underexposure. That is, unless your camera actually produces such an enormous dynamic range of values.
So you might not actually need to scale your channel values. However, given that you already start with values in [0, 1], you probably have floating point numbers stored in single or double precision and you'll have to transcode them to half precision. Depending on the programming language, the libraries and even the hardware platform that you use, there might be an off-the-shelf solution or you might need to do some bit-fiddling of your own. As a starting point I can only offer you this DuckDuckGo search.
I'm too tired to think straight, but this may help you work it all out. I used ImageMagick to create three OpenEXR images, one white, one black and one red, all 1 pixel x 1 pixel.
convert -size 1x1! xc:white white.exr
convert -size 1x1! xc:black black.exr
convert -size 1x1! xc:red red.exr
Then I hexdumped them all:
xxd white.exr > white.txt
xxd black.exr > black.txt
xxd red.exr > red.txt
Here are the files:
White.txt
0000000: 762f 3101 0200 0000 6368 616e 6e65 6c73 v/1.....channels
0000010: 0063 686c 6973 7400 4900 0000 4100 0100 .chlist.I...A...
0000020: 0000 0000 0000 0100 0000 0100 0000 4200 ..............B.
0000030: 0100 0000 0000 0000 0100 0000 0100 0000 ................
0000040: 4700 0100 0000 0000 0000 0100 0000 0100 G...............
0000050: 0000 5200 0100 0000 0000 0000 0100 0000 ..R.............
0000060: 0100 0000 0063 6f6d 7072 6573 7369 6f6e .....compression
0000070: 0063 6f6d 7072 6573 7369 6f6e 0001 0000 .compression....
0000080: 0000 6461 7461 5769 6e64 6f77 0062 6f78 ..dataWindow.box
0000090: 3269 0010 0000 0000 0000 0000 0000 0000 2i..............
00000a0: 0000 0000 0000 0064 6973 706c 6179 5769 .......displayWi
00000b0: 6e64 6f77 0062 6f78 3269 0010 0000 0000 ndow.box2i......
00000c0: 0000 0000 0000 0000 0000 0000 0000 006c ...............l
00000d0: 696e 654f 7264 6572 006c 696e 654f 7264 ineOrder.lineOrd
00000e0: 6572 0001 0000 0000 7069 7865 6c41 7370 er......pixelAsp
00000f0: 6563 7452 6174 696f 0066 6c6f 6174 0004 ectRatio.float..
0000100: 0000 0000 0080 3f73 6372 6565 6e57 696e ......?screenWin
0000110: 646f 7743 656e 7465 7200 7632 6600 0800 dowCenter.v2f...
0000120: 0000 0000 0000 0000 0000 7363 7265 656e ..........screen
0000130: 5769 6e64 6f77 5769 6474 6800 666c 6f61 WindowWidth.floa
0000140: 7400 0400 0000 0000 803f 0053 0100 0000 t........?.S....
0000150: 0000 0000 0000 0008 0000 0000 3c00 3c00 ............<.<.
0000160: 3c00 3c <.<
Black.txt
0000000: 762f 3101 0200 0000 6368 616e 6e65 6c73 v/1.....channels
0000010: 0063 686c 6973 7400 4900 0000 4100 0100 .chlist.I...A...
0000020: 0000 0000 0000 0100 0000 0100 0000 4200 ..............B.
0000030: 0100 0000 0000 0000 0100 0000 0100 0000 ................
0000040: 4700 0100 0000 0000 0000 0100 0000 0100 G...............
0000050: 0000 5200 0100 0000 0000 0000 0100 0000 ..R.............
0000060: 0100 0000 0063 6f6d 7072 6573 7369 6f6e .....compression
0000070: 0063 6f6d 7072 6573 7369 6f6e 0001 0000 .compression....
0000080: 0000 6461 7461 5769 6e64 6f77 0062 6f78 ..dataWindow.box
0000090: 3269 0010 0000 0000 0000 0000 0000 0000 2i..............
00000a0: 0000 0000 0000 0064 6973 706c 6179 5769 .......displayWi
00000b0: 6e64 6f77 0062 6f78 3269 0010 0000 0000 ndow.box2i......
00000c0: 0000 0000 0000 0000 0000 0000 0000 006c ...............l
00000d0: 696e 654f 7264 6572 006c 696e 654f 7264 ineOrder.lineOrd
00000e0: 6572 0001 0000 0000 7069 7865 6c41 7370 er......pixelAsp
00000f0: 6563 7452 6174 696f 0066 6c6f 6174 0004 ectRatio.float..
0000100: 0000 0000 0080 3f73 6372 6565 6e57 696e ......?screenWin
0000110: 646f 7743 656e 7465 7200 7632 6600 0800 dowCenter.v2f...
0000120: 0000 0000 0000 0000 0000 7363 7265 656e ..........screen
0000130: 5769 6e64 6f77 5769 6474 6800 666c 6f61 WindowWidth.floa
0000140: 7400 0400 0000 0000 803f 0053 0100 0000 t........?.S....
0000150: 0000 0000 0000 0008 0000 0000 3c00 0000 ............<...
0000160: 0000 00 ...
Red.txt
0000000: 762f 3101 0200 0000 6368 616e 6e65 6c73 v/1.....channels
0000010: 0063 686c 6973 7400 4900 0000 4100 0100 .chlist.I...A...
0000020: 0000 0000 0000 0100 0000 0100 0000 4200 ..............B.
0000030: 0100 0000 0000 0000 0100 0000 0100 0000 ................
0000040: 4700 0100 0000 0000 0000 0100 0000 0100 G...............
0000050: 0000 5200 0100 0000 0000 0000 0100 0000 ..R.............
0000060: 0100 0000 0063 6f6d 7072 6573 7369 6f6e .....compression
0000070: 0063 6f6d 7072 6573 7369 6f6e 0001 0000 .compression....
0000080: 0000 6461 7461 5769 6e64 6f77 0062 6f78 ..dataWindow.box
0000090: 3269 0010 0000 0000 0000 0000 0000 0000 2i..............
00000a0: 0000 0000 0000 0064 6973 706c 6179 5769 .......displayWi
00000b0: 6e64 6f77 0062 6f78 3269 0010 0000 0000 ndow.box2i......
00000c0: 0000 0000 0000 0000 0000 0000 0000 006c ...............l
00000d0: 696e 654f 7264 6572 006c 696e 654f 7264 ineOrder.lineOrd
00000e0: 6572 0001 0000 0000 7069 7865 6c41 7370 er......pixelAsp
00000f0: 6563 7452 6174 696f 0066 6c6f 6174 0004 ectRatio.float..
0000100: 0000 0000 0080 3f73 6372 6565 6e57 696e ......?screenWin
0000110: 646f 7743 656e 7465 7200 7632 6600 0800 dowCenter.v2f...
0000120: 0000 0000 0000 0000 0000 7363 7265 656e ..........screen
0000130: 5769 6e64 6f77 5769 6474 6800 666c 6f61 WindowWidth.floa
0000140: 7400 0400 0000 0000 803f 0053 0100 0000 t........?.S....
0000150: 0000 0000 0000 0008 0000 0000 3c00 0000 ............<...
0000160: 0000 3c ..<
diff white.txt black.txt
22,23c22,23
< 0000150: 0000 0000 0000 0008 0000 0000 3c00 3c00 ............<.<.
< 0000160: 3c00 3c <.<
---
> 0000150: 0000 0000 0000 0008 0000 0000 3c00 0000 ............<...
> 0000160: 0000 00
The short answer is that this will probably not give you a useful result.
The moderately-long answer is that this approach makes a number of assumptions that are not at all "safe" with regard to image processing.
The primary assumption is that a Low Dynamic Range value of 255 represents an HDR value of 65535. The primary problem that HDR intends to solve is that real-world signals have to be compressed to a limited scope. Imagine taking a digital photograph of the sun directly: the input value for that light intensity is much greater than any imaging software supports, so it has to be compressed somehow. With LDR, the center of the sun's disk and much of the bloom around it will all be clamped to 255. With HDR, you're still clamping, but only to 65535. If you have a real-world signal which is giving values like 200, 255, 300 and 100,000, and then that gets clamped to 255, it should make sense that you cannot simply scale 255 to 65535 and get a reasonable result. That 255 might have been clamped from 256, or from 300, or from 100000; there's no way to know. (This is a radical oversimplification of imaging, but it should be sufficient for understanding this limitation in particular).
A secondary assumption is that what you see on your monitor has anything to do with the values in your image. The 0 - 65535 range of values in the image must be represented on your display, which is almost certainly limited to the sRGB spectrum (255). Mostly likely, if you've simply scaled 0-255 to 0-65535, then 99% of your range is above 255. So regardless of how much information is in your image, it's easy for it all to get clipped to "white."
Furthermore, depending on how Photoshop (or the GPU driver or the OS or the display panel) is translating your HDR 65535 into sRGB, it's just as likely that it's AGAIN being clamped to 255, or perhaps scaled "dumbly," or perhaps scaled "smartly," or any combination thereof. If Photoshop shows your image as solid white, you'll have to confirm a number of steps in the process to determine "who" in particular is transforming your color values, and how. Photoshop might be clamping before it sends to the OS. The OS might be clamping before it sends to the GPU. The GPU might be clamping when it sends to the display. The display might be clamping when it turns on the pixel. ...or any combination of clamping, scaling, and transforming at any of those steps (I know, not all of those combinations are actually possible, but the point is that there is a lot going on between the file and your eyeball).
Transforming LDR values to an HDR color space (and vice versa) is a non-trivial pursuit that represents a discipline unto itself. Depending on your application, you may need to do a great deal more research before you come to a good solution.
I have the strangest issue while writing a new script for casperJS, which I use all the time.
When I try to launch the script, using "casperjs myScript.js, I get the following :
Unable to load script /var/www/scrapers/myScript.js; check file syntax
I checked my syntax and found nothing wrong, chmod +x the file, sudoed everything, still the same.
Even stranger, I copypasted the example code from the quickstart (http://docs.casperjs.org/en/latest/quickstart.html), saved , and same message...
All my other scripts in the same directory are working, what do I try now?
Re: what do I try now?
You can use xxd to look inside the files. Looking at the comments, you now have a working version and a non-working version, so can compare them side-by-side to understand what the problem was. (And if they are identical then you know you are looking for something at the file system level, not inside the files.)
(xxd comes with the vi package, and apparently is also available for Windows if you install vim.)
Here is sample output for a script with and without the UTF-8 BOM (which, incidentally, made no difference: both these scripts worked, at least with CasperJS 1.1 on Ubuntu):
0000000: efbb bf76 6172 2063 6173 7065 7220 3d20 ...var casper =
0000010: 7265 7175 6972 6528 2763 6173 7065 7227 require('casper'
0000020: 292e 6372 6561 7465 2829 3b0a 0a63 6173 ).create();..cas
0000030: 7065 722e 7374 6172 7428 2768 7474 703a per.start('http:
0000040: 2f2f 676f 6f67 6c65 2e63 6f6d 2f27 2c20 //google.com/',
0000050: 6675 6e63 7469 6f6e 2829 207b 0a20 2020 function() {.
0000060: 2074 6869 732e 6563 686f 2874 6869 732e this.echo(this.
0000070: 6765 7454 6974 6c65 2829 293b 0a7d 293b getTitle());.});
0000080: 0a0a 6361 7370 6572 2e72 756e 2829 3b0a ..casper.run();.
0000000: 7661 7220 6361 7370 6572 203d 2072 6571 var casper = req
0000010: 7569 7265 2827 6361 7370 6572 2729 2e63 uire('casper').c
0000020: 7265 6174 6528 293b 0a0a 6361 7370 6572 reate();..casper
0000030: 2e73 7461 7274 2827 6874 7470 3a2f 2f67 .start('http://g
0000040: 6f6f 676c 652e 636f 6d2f 272c 2066 756e oogle.com/', fun
0000050: 6374 696f 6e28 2920 7b0a 2020 2020 7468 ction() {. th
0000060: 6973 2e65 6368 6f28 7468 6973 2e67 6574 is.echo(this.get
0000070: 5469 746c 6528 2929 3b0a 7d29 3b0a 0a63 Title());.});..c
0000080: 6173 7065 722e 7275 6e28 293b 0a asper.run();.
Camtasia Studio is a software package for recording screen captures. One thing it does, it records the mouse movement coordinates separately from the video of your screen. It does this so you can modify the appearance of the cursor after you are done recording.
Once you have recorded your screen, it has an option for exporting the raw components of your capture. One of the files contains the cursor coordinates which look like this...
4556 5453 0300 0000 0c00 0000 0c00 0000
ca00 0000 0c00 0000 0100 0000 0000 0000
8002 0000 e001 0000 1900 0000 cb00 0000
1900 0000 0100 0000 0000 0000 000c 0259
0000 0059 0014 0000 00e0 e8ab 096a 032d
08b8 0100 00c8 0000 0008 0000 0037 0000
00b0 feff ffef 0328 02d2 0100 00f0 0328
02d2 0100 00f1 0329 02e0 0100 00f2 032a
02e0 0100 00f5 032b 02ed 0100 00f8 032d
02ed 0100 00fb 032f 02fa 0100 0001 0432
02fa 0100 0007 0435 0208 0200 000e 043a
0208 0200 0018 043f 0215 0200 0023 0445
0215 0200 002e 044a 0215 0200 0039 0450
0215 0200 0046 0455 0215 0200 004f 0458
0215 0200 0056 045a 022c 0200 005d 045e
022c 0200 0063 0462 0242 0200 0068 0465
0242 0200 006f 046b 0258 0200 0072 046f
0258 0200 0079 0476 0280 0200 0082 047d
0280 0200 0089 0484 028c 0200 0091 048a
028c 0200 0098 0494 029a 0200 009e 049c
029a 0200 00a3 04a0 029a 0200 00a7 04a3
029a 0200 00aa 04a6 02aa 0200 00af 04ab
02bc 0200 00b2 04ae 02bc 0200 00b4 04b3
02bc 0200 00b8 04b7 02cc 0200 00be 04bd
02cc 0200 00c1 04bf 02dd 0200 00c3 04c1
02dd 0200 00c6 04c4 02f8 0200 00c9 04c6
02f8 0200 00cb 04c8 0205 0300 00cc 04c9
0213 0300 00cd 04c9 0213 0300 00cd 04ca
0220 0300 00ce 04cb 0221 0300 00ce 04cc
0221 0300 00ce 04cd 0236 0300 00ce 04ce
0236 0300 00cd 04cf 024d 0300 00cc 04d0
024d 0300 00cc 04d1 0262 0300 00cb 04d2
0262 0300 00cb 04d3 0279 0300 00ca 04d3
02a5 0300 00c9 04d3 0218 0000 0002 0000
000c 0000 0002 0000 0000 0000 0081 0404
0487 06a5 04a5 0300 00f8 0304 0487 06ba
040a 0000 0003 0000 000a 0000 0001 0000
0000 0000 0000 0008 0009 000c 0000 0001
0000 000c 0000 0001 0000 0000 0000 00ff
033b 027f 061b 040c 0000 0005 0000 000c
0000 0001 0000 0000 0000 0000 0000 00ff
ffff ff0c 0000 0004 0000 000c 0000 0001
0000 0000 0000 0001 0000 0000 0000 001c
0000 002d 0100 001c 0000 0001 0000 0090
0300 0000 0100 0079 0000 0044 0000 0000
0000 0000 0000 0000 0000 00
This is from a 1 second recording. The screen capture size was 640x480. I was moving the mouse from the top left corner to the bottom right corner.
So here is my question. Is there a way to translate this information to time and X, Y coordinates of the video? I guess I just don't understand the notation but I want to use this information for my own project. Can anyone make sense of this data?