|
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
Hello everyone,
I have a case with vlc on my ubuntu container. Indeed, my c# method :
<pre lang="C#">if (File.Exists(video.Path))
{
using (var libVLC = new LibVLC(enableDebugLogs: true))
{
this.logger.LogInformation($"ImageDetectionWorker.StartFramesPredictionVLC : VLC lib initialized")
if (Directory.Exists("/shared-volume/vlc" == false))
{
Directory.CreateDirectory("/shared-volume/vlc")
}
libVLC.SetLogFile($"/shared-volume/vlc/vlc.log";)
var absoluteVideoPath = new FileInfo(video.Path.FullName)
using (var media = new Media(libVLC, absoluteVideoPath, options: "--no-audio --no-xlib --no-sout-audio"))
{
this.logger.LogInformation($"ImageDetectionWorker.StartFramesPredictionVLC : VLC media initialized")
using (var mediaPlayer = new MediaPlayer(media))
{
this.logger.LogInformation($"ImageDetectionWorker.StartFramesPredictionVLC : VLC media player initialized")
mediaPlayer.ToggleMute()
Throw this logs in my container:
info: EigenVectors.PredictionWrite.Api.Workers.ImageDetectionWorker[0] ImageDetectionWorker.StartFramesPredictionVLC : Start to initialize VLC core info: EigenVectors.PredictionWrite.Api.Workers.ImageDetectionWorker[0] ImageDetectionWorker.StartFramesPredictionVLC : VLC core initialized [00007f897c0027e0] main libvlc debug: VLC media player - 3.0.20 Vetinari [00007f897c0027e0] main libvlc debug: Copyright © 1996-2023 the VideoLAN team [00007f897c0027e0] main libvlc debug: revision 3.0.20-0-g6f0d0ab126b [00007f897c0027e0] main libvlc debug: configured with ./configure '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-option-checking' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-debug' '--config-cache' '--disable-update-check' '--enable-fast-install' '--docdir=/usr/share/doc/vlc' '--with-binary-version=3.0.20-0+deb11u1' '--enable-a52' '--enable-aa' '--enable-aribsub' '--enable-avahi' '--enable-bluray' '--enable-caca' '--enable-chromaprint' '--enable-chromecast' '--enable-dav1d' '--enable-dbus' '--enable-dca' '--enable-dvbpsi' '--enable-dvdnav' '--enable-faad' '--enable-flac' '--enable-fluidsynth' '--enable-freetype' '--enable-fribidi' '--enable-gles2' '--enable-gnutls' '--enable-harfbuzz' '--enable-jack' '--enable-kate' '--enable-libass' '--enable-libmpeg2' '--enable-libxml2' '--enable-lirc' '--enable-mad' '--enable-matroska' '--enable-mod' '--enable-mpc' '--enable-mpg123' '--enable-mtp' '--enable-ncurses' '--enable-notify' '--enable-ogg' '--enable-opus' '--enable-pulse' '--enable-qt' '--enable-realrtsp' '--enable-samplerate' '--enable-sdl-image' '--enable-sftp' '--enable-shine' '--enable-shout' '--enable-skins2' '--enable-soxr' '--enable-spatialaudio' '--enable-speex' '--enable-svg' '--enable-svgdec' '--enable-taglib' '--enable-theora' '--enable-twolame' '--enable-upnp' '--enable-vdpau' '--enable-vnc' '--enable-vorbis' '--enable-x264' '--enable-x265' '--enable-zvbi' '--with-kde-solid=/usr/share/solid/actions/' '--disable-aom' '--disable-crystalhd' '--disable-d3d11va' '--disable-decklink' '--disable-directx' '--disable-dsm' '--disable-dxva2' '--disable-fdkaac' '--disable-fluidlite' '--disable-freerdp' '--disable-goom' '--disable-gst-decode' '--disable-libtar' '--disable-live555' '--disable-macosx' '--disable-macosx-avfoundation' '--disable-macosx-qtkit' '--disable-mfx' '--disable-microdns' '--disable-opencv' '--disable-projectm' '--disable-schroedinger' '--disable-sparkle' '--disable-srt' '--disable-telx' '--disable-vpx' '--disable-vsxu' '--disable-wasapi' '--enable-alsa' '--enable-dc1394' '--enable-dv1394' '--enable-libplacebo' '--enable-linsys' '--enable-nfs' '--enable-udev' '--enable-v4l2' '--enable-wayland' '--enable-libva' '--enable-vcd' '--enable-smbclient' '--disable-oss' '--enable-mmx' '--enable-sse' '--disable-neon' '--disable-altivec' '--disable-omxil' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -ffile-prefix-map=/build/reproducible-path/vlc-3.0.20=. -fstack-protector-strong -Wformat -Werror=format-security ' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -ffile-prefix-map=/build/reproducible-path/vlc-3.0.20=. -fstack-protector-strong -Wformat -Werror=format-security ' 'OBJCFLAGS=-g -O2 -ffile-prefix-map=/build/reproducible-path/vlc-3.0.20=. -fstack-protector-strong -Wformat -Werror=format-security' [00007f897c0027e0] main libvlc debug: searching plug-in modules [00007f897c0027e0] main libvlc debug: loading plugins cache file /usr/lib/x86_64-linux-gnu/vlc/plugins/plugins.dat [00007f897c0027e0] main libvlc debug: recursively browsing `/usr/lib/x86_64-linux-gnu/vlc/plugins' [00007f897c0027e0] main libvlc debug: plug-ins loaded: 519 modules [00007f897c001ad0] main logger debug: looking for logger module matching "any": 4 candidates [00007f897c001ad0] main logger debug: using logger module "console" [00007f897c0027e0] main libvlc debug: translation test: code is "C" [00007f8984270880] main keystore debug: looking for keystore module matching "memory": 4 candidates [00007f8984270880] main keystore debug: using keystore module "memory" [00007f897c0027e0] main libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX AVX2 FPU info: EigenVectors.PredictionWrite.Api.Workers.ImageDetectionWorker[0] ImageDetectionWorker.StartFramesPredictionVLC : VLC lib initialized info: EigenVectors.PredictionWrite.Api.Workers.ImageDetectionWorker[0] ImageDetectionWorker.StartFramesPredictionVLC : VLC media initialized info: EigenVectors.PredictionWrite.Api.Workers.ImageDetectionWorker[0] ImageDetectionWorker.StartFramesPredictionVLC : VLC media player initialized info: EigenVectors.PredictionWrite.Api.Workers.ImageDetectionWorker[0] ImageDetectionWorker.StartFramesPredictionVLC : True ALSA lib confmisc.c:767:(parse_card) cannot find card '0' ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
My Dockerfile :
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
WORKDIR /app
EXPOSE 80
COPY . .
RUN dotnet restore MyProject.csproj
RUN dotnet publish MyProject.csproj -c Release -o out --no-restore
FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /app
COPY --from=build-env /app/out .
RUN apt-get update && apt-get install -y vlc && apt-get install libvlc-dev
ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH
ENTRYPOINT ["dotnet", "MyProject.dll"]
I've tried a lot of package to install on the container without any success
|
|
|
|
|
Quote: ALSA lib confmisc.c:767:(parse_card) cannot find card '0' ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
Lets start off with a little honesty - I am unsure of exactly what I am asking, but I am sure that someone can help.
So I currently have Visual Studio 17.8 installed. I predominantly work in VB.NET. I have some older code downloaded from Github, that works just fine (as binary) when it was put together say 10 or more years ago. The crux of the problem is that you (and by you, I mean me) cannot in some cases simply drop it into VS 17.8 without several errors.
Therefore, the naïve question is - can anyone point to a good source of information that would guide me on how to "upgrade" older code to eliminate errors in compiling with the current versions of VS and .NET?
THanks.
Pound to fit, paint to match
|
|
|
|
|
I'm interested ... what is older VB.Net Code and what is newer Code ?
I would say that your question isn't to answer without more and specific Info ...
|
|
|
|
|
You make a copy of the project, and try and compile it; then you can catastrophize.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
lewist57 wrote: cannot in some cases simply drop it into VS 17.8 without several errors
Without the code and the specific errors, its impossible to tell you what the problem is.
At a guess, are you trying to open a project that targets a version of .NET / .NET Framework for which you haven't installed the relevant VS targeting pack?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
It all depends on what the errors are. So you need to post a properly detailed question.
|
|
|
|
|
I wrote an app in Win Forms, and I'm using a circle in ListView, as a pleasant indicator. On my rigs, running Win 10 at home and 11 at the office, the ⬤ char works no problem. But on the customers computers running Win 7, I get the tall square symbol.
So I changed the Font in my Win Forms App to Segoe UI, which looks nice, but I still get the tall rectangle. I checked the customers computers to see what fonts are loaded, and Segoe UI is there.
Then I did research, and a few online posts talk about font searching by the OS, which dates back to Windows XP. If the Char ⬤ doesn't exists in the Font file, the OS will search for that char in other font files, such as webdings.ttf. Found a post about using the RegEdit /LocalMachine/Software/WindowsNt/Fonts and having to edit font mappings, which looked complicated.
ChatGpt says that I can MeasureText, to see if a char exists, and if not choose another char sysmbol.But the char always exists.
Dim font As New Font("Segoe UI", 9, FontStyle.Regular)
' The character you want to check (e.g., the copyright symbol ©)
Dim specialChar As Char = "⬤"
' Check if the font can display the character
Dim canDisplayChar As Boolean = TextRenderer.MeasureText(specialChar, font).Width > 0
If canDisplayChar Then
Return "⬤"
Else
Return "X"
End If
I'm just wondering if someone here has figured this out, and can share what they did. The customer really wants the ⬤.
On a side note or question, I can set a color for the circle in ListView on .Net Core 7, but can't set the color of the circle in .Net Framework 4.6.1.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
What you "see" depends on the font of your "IDE"; what shows up at run time, is another matter (when you use "strings" for characters). Try "character codes".
https://stackoverflow.com/questions/3144053/how-to-represent-unicode-character-in-vb-net-string-literal
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I had to think about that for a couple of minutes. So instead of blaming the OS, I should consider the code, and use a character code. I'll try that. Thanks!
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
That got complicated, and resulted in showing a "n"
Decided to use these chars in string form, and it works for now ❶❷ they are in Segoe UI
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
You said you wanted to use Segoe UI Symbol; which means that has to be the font specified in your "UI" when you use (hex) codes for "special" characters in that font.
The "symbol font" in fact contains numerous "black circles" of various sizes (or the same size). You can't just pick "any" black circle and expect it to show up in "any" font.
In my app, I mix all "4" Segoe fonts (MDL2, UI, Symbol, Emoji) at the same time and never have any issues: character code + font family.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I get it now!
I selected the wrong font file, and can use Segoe UI Symbols, which has the large circle, and alphanumeric chars as well. So I don't have to compromise now, and can finish as planned. Realize my UI goal or vision.
So this font style and font file solves my issue and is the correct fix. And I should not depend on Windows or the OS to do font searching and swapping for me, because it's unreliable.
Wow, I put so much effort into trying to solve this and it was very hard. Thank you Gary for putting me on the right track, and pushing me to get it right and not compromise for something sub standard.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
You're welcome.
And the "black circles" aren't really "black"; that's the default "foreground" color; you can change it to any color you want. That applies that "all" characters.
If you want a different color for the background, it has to come from the object "behind" it. "Characters" have no background color you can set. Emoji is colored by default and you can't change that.
You can layer characters to "insert" a color into (say) a "hollow circle" with a "solid colored circle" behind it (so as not have to put another "background" behind). And you can rotate individual characters (e.g. pointing arrows)
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I was pretty excited and thought I had it all figured out, only to be proven wrong again, where I got ".." which is 2 dots. target computer is a Win 7 32 bit OS, My "Extras" app is targeted at Framework 4.6.1. I got the code from Charmap; U+2824 Black Large Circle. On my rig it works great.
With my other Win Forms app called "Simple BOL" using .Net Core 7 I think, I can change the forecolor of a ListView cell or column, and make red, black and green circles on my rig running Win 11 64. But on these Win 7 32 bit OS machines with the app in question called "Extras", no luck either. In fact on my machine with Extras, the forecolor for a target cell won't change colors either.
So another swing and a miss for strike 3 now, batter out. Well I still have plenty of innings left in the game, so I'll try again tomorrow.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
U+2824 is NOT a "circle"; it is a "Braille Pattern Dots-36" in the "Segoe UI Symbol" font (i.e. 2 "dots"). It is exactly what it is.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
That sounds encouraging, but that's the code Character Map presents to me on both my computers. Hmm...
I have U+28C0 for the braille code of 2 dots Braille Pattern Dots 78
Mind if I ask what code you have for the Large Black Circle?
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
You talk codes without font names; which is meaningless.
It should be a simple matter for you to compare the character maps of "both operating systems" and draw your own conclusions.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
U+2B24 - I thought the B was an 8 in Segoe UI Symbol.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
Finally got it working today. Thanks for the help, I learned a lot on this and your input made things clearer. This ended up being a deep lesson on Fonts and Chars for me, and will make coding more fun in the future, using some emojis to brighten things up a bit. Thanks Gerry!
I just need to get some glasses pretty soon.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
Good morning,
I'm trying to capture an image from a RTSP stream using ffmpeg.
I'm struggling, it is as if ffmpeg isnt working. A snip from my code is below:
using System.Runtime.InteropServices;
using FFmpeg.AutoGen;
using SixLabors.ImageSharp.Formats.Png;
using SixLabors.ImageSharp.Formats;
Class Program
{
unsafe static void Main(string[] args)
{
string inputUrl = "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4";
ffmpeg.avformat_open_input(&pFormatContext, inputUrl, null, null);
The error that I'm receiving which is related to the last line of code is:
System.NotSupportedException
HResult=0x80131515
Message=Specified method is not supported.
Source=FFmpeg.AutoGen
StackTrace:
at FFmpeg.AutoGen.DynamicallyLoadedBindings.<>c.<Initialize>b__2_1284(AVFormatContext** <p0>, String <p1>, AVInputFormat* <p2>, AVDictionary** <p3>)
at FFmpeg.AutoGen.ffmpeg.avformat_open_input(AVFormatContext** ps, String url, AVInputFormat* fmt, AVDictionary** options)
at Program.Main(String[] args)
Any help would be appreciated,
Freddie
|
|
|
|
|
You'll probably have better luck reporting this as an issue in the GitHub project - assuming it hasn't already been reported:
Issues · Ruslan-B/FFmpeg.AutoGen · GitHub[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
The documentation at FFmpeg: Demuxing[^] implies that it expcts an actual filename as input. So try reading the stream into a local file, and see if it can process that.
|
|
|
|
|