All Activity
This stream auto-updates
- Yesterday
-
Vcl DBChart Line Series Set Line Thickness
Henry Olive replied to Henry Olive's topic in General Help
I solved the problem -
Cypheros joined the community
-
You'll also get emails when the issue is changed/updated. In my experience from trawling issues and the handful I've raised it seems relatively rare for an issue to be worked on or fixed.
-
For some reason, I do not see the May Patch.
-
The uninitialized values of b & c are not surprising, they'll potentially just be what was last in memory at the address that's being used for them. Regarding what the debugger is showing, we regularly get the same/similar behaviour in Delphi for inline variables (wrong values or unable to display) and at times rubbish values for normal local variables as well 😞
-
What you indicated is not the last one: (of course you could have installed it manually too...). But, if you don't find the source files, obviously something went wrong during the installation. Did you check the installation for all platforms during the installation of Rad Studio? (I did)
-
There is a new version at https://github.com/rmesch/Bitmaps2Video-for-Media-Foundation. New stuff: Some rewrite of audio, making sure that gaps at the beginning of a stream are filled with silence. 2 optimized frame-rates for audio-synching, see below. Most importantly: One can now run @Kas Ob.'s frame analysis from within the demo, if one enables the hidden tab "Analysis". I just made the lines a bit shorter, as the rest was just repeating the same values for all I tested, as far as I could see. The file ffprobe.exe needs to be in the same directory as DemoWMF.exe. ffprobe is part of ffmpeg-git-essentials.7z on https://www.gyan.dev/ffmpeg/builds/. I spent a good amount of time trying to figure out what I can and what I cannot control about audio-synching, tracing into the relevant code and running the analysis. Results of audio-rethynching follow (beware, it's long): The math is for audio-sample-rate of 48000 and the time units are all s. Audio-blockalign is always 4 Bytes for what I do. There are at least 2 different meanings of "sample": PCMSample: as in samples per second. ByteSize: Channels*BitsPerSample/8 = 2*16/8 = 4 Bytes. Time: 1/48000 s IMFSample: Chunk of audio returned by IMFSourceReader.ReadSample. It contains a buffer holding a certain amount of uncompressed PCMsamples, and info like timestamp, duration, flags ... The size of these samples varies a lot with the type of input. Some observed values: .mp3-file 1: Buffersize = 96 768 Bytes Duration = 0.504 (96768 bytes = 96768/4 PCMSamples = 96768/4/48000 s OK) .mp3-file 2: Buffersize = 35 108 Bytes Duration = 0.1828532 (35108/4/48000 = 0.182854166.. not OK) .wmv-file: Buffersize = 17 832 Bytes Duration = 0.092875 (17832/4/48000 = 0.092875 OK) Except for the first sample read, the values don't differ from sample to sample. Those are the samples I can write to the sinkwriter for encoding. Breaking them up seems like a bad idea. I have to trust MF to handle the writing correctly. The buffers seem to always be block-aligned. I've added some redundant variables in TBitmapEncoderWMF.WriteAudio so these values can be examined in the debugger. A related quantity are audio-frames. Similarly to the video-stream the audio-stream of a compressed video consists of audio-frames. 1 audio-frame contains the compressed equivalent of 1024 PCMSamples. So: AudioFrameDuration = 1024/48000 AudioFrameRate = 48000/1024 I can only control the writing of the video by feeding the IMFSamples of video and audio to the sinkwriter in good order. The samples I write to the sinkwriter are collected in a "Leaky-Bucket"-buffer. The encoder pulls out what it needs to write the next chunk of video. It hopefully waits until there are enough samples to write something meaningful. Problems arise if the bucket overflows. There need to be enough video- and audio-samples to correctly write both streams. So here is the workflow, roughly (can be checked by stepping into TBitmapEncoderWMF.WriteOneFrame): Check if the audio-time written so far is less than the timestamp of the next video-frame. Yes: Pull audio-samples out of the sourcereader and write them to the sinkwriter until audio-time >= video-timestamp. Looking at the durations above, one sample might already achieve this. Write the next video-frame Repeat In the case of mp3-file 1 the reading and writing of 1 audio-sample would be followed by the writing of several video-samples. The encoder now breaks the bucket-buffer up into frames, compresses them and writes them to file. It does that following its own rules, which I have no control over. Frame-analysis can show the result: A group of video-frames is followed by a group of audio-frames, which should cover the same time-interval as the video-frames. In the output I have seen so far, the audio-frame-period is always 15 audio-frames. For video-framerate 30, the video-frame-period is 9 or 10 frames. Why doesn't it make the audio- and video-periods smaller? No idea. Guess that's the amount of info the players can handle nowadays, and these periods are a compromise between optimal phase-locking of audio- video- periods and the buffer-size the player can handle. Theoretically, at framerate 30, 16 video-frames should phase-lock with 25 audio-frames. Here is one of those video-audio-groups. Video-framerate is 30. video stream_index=0 key_frame=0 pts=39000 pts_time=1.300000 duration_time=0.033333 video stream_index=0 key_frame=0 pts=40000 pts_time=1.333333 duration_time=0.033333 video stream_index=0 key_frame=0 pts=41000 pts_time=1.366667 duration_time=0.033333 video stream_index=0 key_frame=0 pts=42000 pts_time=1.400000 duration_time=0.033333 video stream_index=0 key_frame=0 pts=43000 pts_time=1.433333 duration_time=0.033333 video stream_index=0 key_frame=0 pts=44000 pts_time=1.466667 duration_time=0.033333 video stream_index=0 key_frame=0 pts=45000 pts_time=1.500000 duration_time=0.033333 video stream_index=0 key_frame=0 pts=46000 pts_time=1.533333 duration_time=0.033333 video stream_index=0 key_frame=0 pts=47000 pts_time=1.566667 duration_time=0.033333 video stream_index=0 key_frame=0 pts=48000 pts_time=1.600000 duration_time=0.033333 audio stream_index=1 key_frame=1 pts=62992 pts_time=1.312333 duration_time=0.021333 audio stream_index=1 key_frame=1 pts=64016 pts_time=1.333667 duration_time=0.021333 audio stream_index=1 key_frame=1 pts=65040 pts_time=1.355000 duration_time=0.021333 audio stream_index=1 key_frame=1 pts=66064 pts_time=1.376333 duration_time=0.021333 audio stream_index=1 key_frame=1 pts=67088 pts_time=1.397667 duration_time=0.021333 audio stream_index=1 key_frame=1 pts=68112 pts_time=1.419000 duration_time=0.021333 audio stream_index=1 key_frame=1 pts=69136 pts_time=1.440333 duration_time=0.021333 audio stream_index=1 key_frame=1 pts=70160 pts_time=1.461667 duration_time=0.021333 audio stream_index=1 key_frame=1 pts=71184 pts_time=1.483000 duration_time=0.021333 audio stream_index=1 key_frame=1 pts=72208 pts_time=1.504333 duration_time=0.021333 audio stream_index=1 key_frame=1 pts=73232 pts_time=1.525667 duration_time=0.021333 audio stream_index=1 key_frame=1 pts=74256 pts_time=1.547000 duration_time=0.021333 audio stream_index=1 key_frame=1 pts=75280 pts_time=1.568333 duration_time=0.021333 audio stream_index=1 key_frame=1 pts=76304 pts_time=1.589667 duration_time=0.021333 audio stream_index=1 key_frame=1 pts=77328 pts_time=1.611000 duration_time=0.021333 pts stands for "presentation time stamp" and pts_time is of interest. Video-time-intervall: from 1.300000 to 1.600000+0.033333=1.633333 Audio-time-intervall: from 1.312333 to 1.611000+0.021333=1.632333 Audio is a bit ahead at the beginning and a tiny bit behind at the end. pts should be multiples of 1024, but they aren't hmm. The difference is still 1024, but they are phase-shifted. Phase-shift is 62992 mod 1024 = 528 (or -496). The interval from a bit further ahead: Video: From 8.066667 to 8.366667+0.033333=8.400000 Audio: From 8.053667 to 8.352333+0.021333=8.373666 pts-phase-shift: still 528 (-496) Audio is lagging behind. To really see what is happening I will have to implement better statistics than just looking at things 🙂 One further test: I tried to phase-lock audio and video optimally: VideoFrameRate: f. AudioFrameRate: 48000/1024, so f = 48000/1024 = 46,875. I've added this frame-rate to the demo. Result: Perfect sync for the first audio-video group. In the middle of the second group the pts-phase-shift is again 528, and audio lags behind. For the rest of the groups the lag doesn't get bigger, it is always corrected to some degree. But the file should have identical audio and video timestamps in the first place! There is another new frame-rate, which is the result of trying to phase-lock 2 video-frames to 3 audio-frames. 2/f = 3*1024/4800 results in f = 2*48000/3/1024 = 31.25 I will try to find out what causes the phase-shift in audio by parsing the ffprobe-output a bit more (sigh). Maybe generate a log-file for the samples written, too. (Sigh). No, so far it's still fun. For those, who made it up to here: Thanks for your patience. Renate
-
Andry13 joined the community
-
Vcl DBChart Line Series Set Line Thickness
Henry Olive replied to Henry Olive's topic in General Help
Thank you so much David I tried DBChart1.Series[1].LinePen.Width := 2 but i get Undeclared identifier: 'LinePen' error I'm using Delphi 10.4 -
Share a data between two units in dynamic loaded BPL.
PeterBelow replied to CRO_Tomislav's topic in VCL
If a "host" application is designed to use form classes implemented in dynamically loaded packages the host app has ( should have) no idea how the form classes are named. To make this into a truely modular and extensible application you need a design like the one used by the RAD Studio IDE. The app only knows where it has to look for extension modules to load (a folder or a registry or other configuration store listing the module file names). The modules register the form classes when loaded into a factory class or list implemented in a statically bound package used by host and all form modules. The host app can then enumerate the available forms using this factory to offer the selection to the user, check if such a form has already been created by searching through the Screen.Forms collection by class name, and, if not found, create an instance using a local variable that cannot be accessed from other parts of the app. If a form reference is needed elsewhere it has to be retrieved from Screen.Forms or another list, e.g. (for MDI child forms) the MDI frame form's MDIChildren collection. Doing it this way decouples the modules and even makes it possible to add modules without having to rebuild the host app. If one of the dynamically loaded forms uses a data module it should override the constructor and check for the presence of the DM before calling the inherited constructor and create an instance of the DM if necessary. I have a strict policy of immideately deleting the IDE-created global variables for forms and DMs if these are not part of the host app and are autocreated and live until the app closes. That prevents all manner of problems caused by accessing global references that may not be valid. -
pascal-process: A new library for running processes and redirecting their output.
Kas Ob. replied to pyscripter's topic in I made this
@pyscripter Hi, Are you up for suggestions ? even if they are not so small touching the core approach with overlapped operation (on Windows) ?- 6 replies
-
- open-source
- process
-
(and 1 more)
Tagged with:
-
Why TListView.OnItemChecked event called by ListView.Items.Add?
Marsil replied to Marsil's topic in VCL
Thanks again Remy!, I'll try to keep that in mind. Whatever the technical details behind this, But as a component user, I still consider it awkward to work with because It doesn't behave like other components, at least not in this case, which makes it a bit weird. -
pascal-process: A new library for running processes and redirecting their output.
pyscripter replied to pyscripter's topic in I made this
@Dave Nottage Thanks for testing. I have updated the Readme with the corrected parameter list for OnRead. Regarding the conversion to string, the whole point of the library is that you get bytes. It is up to the user to use the bytes whichever way is appropriate. The console encoding may be not be Delphi's default encoding. In Linux it is most likely UTF8. On Windows one might use the GetConsoleOutputCP API to get the code page for the output. However even that is not reliable, For instance, on Windows, the scp command expects input and produces output in UTF8 encoding irrespective of the console encoding. The use of ANSI encoding on the project page was just an example. I agree thought that for the example TEncoding.Default is a better choice. So I have updated that as well.- 6 replies
-
- open-source
- process
-
(and 1 more)
Tagged with:
-
pascal-process: A new library for running processes and redirecting their output.
Dave Nottage replied to pyscripter's topic in I made this
I tested it on macOS using this command: "/Applications/PAServer-23.3.app/Contents/MacOS/iosinstall" -q -c -t 5 -W Which ran as expected. This is the command PAServer issues when it wants to detect what devices are visible to the Mac. One thing to note: in the docs on your repo, it suggests using this in the OnRead (of which the parameters in the example do not match the actual source): TEncoding.ANSI.GetString(Bytes) Which might work elsewhere, but on macOS this works: TEncoding.Default.GetString(Bytes)- 6 replies
-
- open-source
- process
-
(and 1 more)
Tagged with:
-
Laurie2Megan joined the community
-
pascal-process: A new library for running processes and redirecting their output.
pyscripter replied to pyscripter's topic in I made this
pascal-process is now multi-platform! So now there is a Delphi library to match fpc's TProcess. Desktop POSIX platforms (LINUX and MACOS) are now supported in addition to Windows. I have tested with LINUX. Since, I do not have a MACOS system available, I would appreciate some help in testing with MACOS.- 6 replies
-
- open-source
- process
-
(and 1 more)
Tagged with:
-
- Last week
-
Posix source files missing
Remy Lebeau replied to pyscripter's topic in RTL and Delphi Object Pascal
Same here. Do you have all of the available patches installed for 12.3? -
Why TListView.OnItemChecked event called by ListView.Items.Add?
Remy Lebeau replied to Marsil's topic in VCL
As I said earlier, you are getting the event when the new item's default state image is assigned. More specifically, when TListView.Items.Add() creates a new TListItem object and inserts it into the TListView.Items, it calls the Win32 ListView_InsertItem() function, which immediately sends the TListView a LVN_ITEMCHANGED notification before it returns. In that notification, the item's uChanged field is LVIF_STATE and the state image has changed index from 0 to 1. That condition is what fires the OnItemChecked event. The item is fully initialized from the Win32 perspective before TListView.Items.Add() returns. Anything you do extra to the item after Add() returns is optional, and is initialization from your perspective, not the Win32 perspective. -
Vcl DBChart Line Series Set Line Thickness
david berneda replied to Henry Olive's topic in General Help
Series1.LinePen.Width := 3; should work fine -
As mentioned I can compile code. Just the sources in the above path are missing.
-
My sources about Posix are in "C:\Program Files (x86)\Embarcadero\Studio\23.0\source\rtl\posix" If you have trouble compiling, look at: https://docwiki.embarcadero.com/RADStudio/Athens/en/Installation_Notes There are some notes about Linux at the end of the page (missing lib paths). P.S.: in my installations of course there are the compiled units in ALL needed paths.
-
I have installed the Linux platform support and I am able to run simple Linux console applications targeting WSL. However, I cannot find the Posix source files, such as Posix.Base, Posix.SysTypes etc. What am I missing? I am using Delphi 12.3. I can see the files in my Delphi 11 installation.
-
CPP builder 12.1 CE: Debug problem
Fabrizio The Cat replied to Fabrizio The Cat's topic in General Help
Thanks for the answer. Good idea but in Options -> C++ Compiler -> Optimizations 'Disable all optimizations' is selected. Just verified. And this wouldn't affect the blank Call stack view, i suppose nor the watch list unresponsive. I have noted that i can see the values in the watch list clicking right mouse button and then selecting the 'enable all' menu item (note the watches are all emabled...) but this seems force to refresh the view. Others ideas? -
https://www.delphitools.info/samplingprofiler/ "SamplingProfiler is a performance profiling tool for Delphi, from version 5 up to both 32bits & 64bit Delphi 12.x (and likely the next ones). Its purpose is to help locate bottlenecks, even in final, optimized code running at full-speed." ... "With version 1.7+, SamplingProfiler includes a small http web server which can be used for real-time monitoring of the profiled application. The monitor provides code hot-spot information in real-time, in HTML or XML form."
-
It's possible that the compiler has optimised away most of your code, just leaving it with label1->Caption=3. does the same thing happen if you turn off optimisation?
-
Why TListView.OnItemChecked event called by ListView.Items.Add?
Kas Ob. replied to Marsil's topic in VCL
Debugging and tracking the OnChecked event, the behavior has nothing to do with Delphi and its VCL, it is triggered by Windows message, so you have to use a workaround about that, something like what Remy suggested. -
Hi all, after several days of problem debugging a large project, i decided to simplify my life. So i ha have created a new project with the default form only. Put on it a button and a label. The button code is: { int a =1; int b; int c; b=2; c=a+b: label1->Caption=c; } a breakpoint on 'b=2' row The ide when in debug mode show: 'watch list', 'local variables' and 'Call stack' views first time: Running the program and pushed the button the program stops; Adding a, b and c variables to the watch list: in the watch list: a=1 b=0 c=853538 (seems random) local variables is completely blank as Call stack . pressing F8 -> b = 0 c = 853538 pressing F8 -> b = 0 c = 853538 F9 -> the program continue and show the label and the correct value. Closed the ide, launched again and stopped: in the watch list all 3 variables are with [Evaluating...] value (don't change after lot of time) and no changes tracing with F8. As i think it's a local problem, what can i do to have the debugger working? Thanks to all that will help me. Fabrizio