|
The only way to find that out is to go back to where you got the package from, and either ask there or read the documentation. But ... if you are using ffmpeg in a separate process, it's very unlikely that progress reporting is going to be possible: ffmpeg isn't a "windows aware" app, it's a console app and those don't generally report anything except to a console screen. And while you can pipe the console app progress to a stream you can read that requires getting the process itself, and providing extra command line instructions when the process is started. Since you are using a wrapper API, it would be entirely up to what that wrapper provides, and I'm not familiar with that one.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You can use the 'OnProgress' event - ffmpeg Documentation[^]
To add a progress tracker using a percentage, add the following to your code -
textBox_taskMsg.Text = "Task is being performed.. This may take some time.";
string[] files = { textBox_Source1.Text, textBox_Source2.Text };
string output = textBox_Source1.Text + "_merged.mp4";
var conversion = await FFmpeg.Conversions.FromSnippet.Concatenate(output, files)
.OnProgress += (sender, args) =>
{
double progressPercentage = args.Percent;
textBox_taskMsg.Text = $"Merging... {progressPercentage:F2}% complete";
};
await conversion.Start();
textBox_taskMsg.Text = "Merge Complete.";
|
|
|
|
|
Hi.
I tried to merge two videos into one using Splicer library. When I ran the code (below), the code got non-responsive, so after awhile I stopped the code from executing. The resulting file (which was created by the code while it has became non-responsive) was over 11GB. I'm not sure how to fix that. Could anyone guide me please? Thanks.
--------
string[] filepaths = new string[10];
filepaths.SetValue(textBox_Source1.Text, 0);
filepaths.SetValue(textBox_Source2.Text, 1);
MergeVideos(filepaths, filepaths[0] + "_merged");
------
using (ITimeline timeline = new DefaultTimeline())
{
IGroup group = timeline.AddVideoGroup(32, 720, 576);
var firstClip = group.AddTrack().AddVideo(videoPaths[0]);
var secondClip = group.AddTrack().AddVideo(videoPaths[1], firstClip.Duration );
using (AviFileRenderer renderer = new AviFileRenderer(timeline, outputFilePath))
{
renderer.Render();
}
}
modified 6-Mar-24 0:33am.
|
|
|
|
|
The only person who's going to be able to "guide you" on this is the person(s) who wrote the Splicer library.
As far as I can tell, there is no documentation on it that survives anywhere and the project on GitHub hasn't been touched in the last 6 years.
It appears to be abandoned.
|
|
|
|
|
To add to what Dave has said, if you are recoding videos in order to join them together (and unless they have the same resolution, same frame rate, same codecs, and a very similar bit rate that is exactly what you have to do to get a working file) then it's going to take some significant time - we are talking hours here for 4K videos, even on a powerful machine, using well optimised software. The partial file size of 11GB isn;t that surprising in the context of the bitrate you appear to be requesting: is that "32" generating a 32K bitrate? If so, then the file size is going to be pretty huge and will take a long time to process.
Grab a free copy of XMedia Recode[^] (it's one of the tools I use for such jobs) and see how long it takes and the resulting video file size.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thanks.
The two files I'm trying to merge are around 30MB each. I'm actually not that familiar with working videos in C#, just playing around and testing here. Anyways, a video merger like Wondershare would take less than 5 mins to do it, and the resulting video would be less than 100MB. I'm not sure how to properly do that.
|
|
|
|
|
Check the bitrate on the result file from wondershare (windows explorer will show you that) and use VLC to check the codecs the result file contains - H265 for example is a lot more compact than H264 for example, but not everything can read it.
But as Dave said, that one would appear to be abandoned - and that may be because it was never finished, or had bugs, or ... you never know.
You know you can splice files directly using FFMPEG as an external process? Concatenate – FFmpeg[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I have this block of code
try
{
_clientContext = new ClientContext(baseUrl);
_clientContext.Credentials = new SharePointOnlineCredentials(userName, Password.GetSecureString(password));
_clientContext.Load(_clientContext.Web, w => w.ServerRelativeUrl);
_clientContext.ExecuteQuery();
}
catch (Exception e)
{
throw;
}
The code stops for about 20-25 seconds on the ExecuteQuery line. If I paste the URL into a browser it loads quicly, so I know that's not the problem. No error is thrown. It's just really slow.
All subsequent calls to the server after that are ok. It's on this first calls that is really slow.
Can anyone shed some light on this? I'm not really sure how to debug this.
In theory, theory and practice are the same. But in practice, they never are.”
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
modified 2-Mar-24 19:34pm.
|
|
|
|
|
Use Fiddler[^] to check the traffic you are sending out on the first call. My suspicion is that the slow first call is because it's trying to hit the msoid endpoints, which don't exist so you are waiting for the connections to time out. The next call knows that these don't exist so it avoids them.
The fix is to change your hosts file to set these connections to your loopback address so that fails straightaway. Fiddler will identify what these domains are for you.
|
|
|
|
|
--When crystal reports is used to create HTML the output is poorly formatted.
--The same report will create a nice looking RTF file.
--I have tried all the options I can find, but the resulting HTML is too poor to be used in email unless the report rpt only produces very simple text output. Poor results if formatting uses underlining or tables.
Can you suggest an approach?
Dim htmlOpts As HTMLFormatOptions = ExportOptions.CreateHTMLFormatOptions()
htmlOpts.HTMLBaseFolderName = Path.GetTempPath()
htmlOpts.HTMLFileName = ReportFileName + randomPartOfFileName + "Html"
htmlOpts.HTMLHasPageNavigator = False
htmlOpts.HTMLEnableSeparatedPages = False
Dim exportOpts As ExportOptions = New ExportOptions()
exportOpts.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.HTML40 << creates really bad html
exportOpts.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.HTML32 << creates readable but poorly formatted in gmail or outlook
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile
exportOpts.FormatOptions = htmlOpts
exportOpts.ExportDestinationOptions = diskopts
oReport.Export(exportOpts)
|
|
|
|
|
PhilMcGahan wrote: create HTML the output is poorly formatted.
No idea what that means.
If you open the html in a browser does it work? Then Crystal Reports did what is supposed to.
If you mean you open the html output in a normal editor and it is not 'pretty' then that is a you problem not a Crystal Reports problem.
You can fix it by finding a different application which runs from the command line and does a pretty print on html. Then add that to your report construction process.
|
|
|
|
|
With respect. If SAP created a calculator product that only worked with single digits would you suggest there is some thing wrong with the number 11.
SAP Crystal Reports creates usable HTML if the RPT file does not underline text or contains tables.
I am asking if anyone has experience taking a Crystal RPT and saving the output as html.
|
|
|
|
|
PhilMcGahan wrote: you suggest there is some thing wrong with the number 11.
Your original post did not suggest that it did not work. All you said was "is poorly formatted"
You might want to do the following
1. Explain in detail what the exact problem is.
2. Provide an small example that demonstrates the problem.
3. If you post code to this site then use code tags.
PhilMcGahan wrote: I am asking if anyone has experience taking a Crystal RPT and saving the output as html.
Googling suggests many people have.
Far as I can recall I only used it for Word and CSV. The Word output was fairly complex. It did require work arounds. But I did that 20 years ago. And the work around was due to memory constraints.
|
|
|
|
|
Solution:
To get perfect HTML out of Crystal Reports, out put your report to PDF, then use nuget package SautinSoft.pdfFocus to convert the pdf to HTML. I have tried many ways, this way works.
Public Shared Function ConvertPDftoHtml(pdfFile As String) As String
Dim htmlFileOut As String = pdfFile.ToLower().Replace(".pdf", ".html")
If File.Exists(htmlFileOut) Then
File.Delete(htmlFileOut)
End If
Try
Dim f As PdfFocus = New SautinSoft.PdfFocus()
f.OpenPdf(pdfFile)
If f.PageCount > 0 Then
Dim iResult As Int32 = f.ToHtml(htmlFileOut)
End If
f = Nothing
Catch ex As Exception
File.WriteAllText(htmlFileOut, $"ConvertPDftoHtml() Reports: {ex.ToString}")
End Try
Return htmlFileOut
|
|
|
|
|
I'm glad you were able to figure out a solution.
Just as an aside, that looks like VB, not C#. You posted in the wrong forum.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
NB: That is a commercial product, starting at $599 per developer.
Given the eight year break in messages, and the recent flurry of very similar messages, I'm starting to suspect your account has been taken over by a spammer.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
The code below will load an rdl report from a datasource and save it as PDF. But only PDF.
If I choose any other format it errors with
System.ArgumentOutOfRangeException
HResult=0x80131502
Message=Specified argument was out of the range of valid values.
Parameter name: format
Source=Microsoft.ReportViewer.WebForms
...
at Microsoft.Reporting.WebForms.Report.Render(String format, String deviceInfo, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]&
--- I would welcome a suggestion. Code as follows
Private Sub SaveReportAsHtml(rdcFile As String, outputfolderRoot As String)
'rdcFile = = "Report001ByPhil"
'outputfolderRoot = = "C:\temp"
Dim localReport As New LocalReport()
localReport.ReportPath = rdcFile
Dim ds As DataSet = FillADataSetWithSampleData()
Dim reportDataSource As New ReportDataSource("DataSet1", ds.Tables("table1"))
localReport.DataSources.Add(reportDataSource)
Dim mimeType As String
Dim encoding As String
Dim extension As String
Dim streamIds() As String
Dim warnings() As Microsoft.Reporting.WebForms.Warning
Dim outputFormat As String = "MHTML" 'does not work
outputFormat = "HTML3.2" 'does not work
outputFormat = "HTML4.0" 'does not work
outputFormat = "HTMLOWC" 'does not work
outputFormat = "PDF" 'works
Dim bytes As Byte() = localReport.Render(outputFormat, Nothing, mimeType, encoding, extension, streamIds, warnings)
Dim outputPath As String = Path.Combine(outputfolderRoot, "SSRS_output")
outputPath = outputPath + "." + outputFormat
DeleteFile(outputPath)
Using fs As New FileStream(outputPath, FileMode.Create)
fs.Write(bytes, 0, bytes.Length)
End Using
End Sub
|
|
|
|
|
Google
visual basic "LocalReport" render "Specified argument was out of the range of valid values."
From that and this very site
https://www.codeproject.com/Questions/1130614/How-to-render-localreport-to-HTML-using-csharp
It says you can't do what you are attempting. I did not verify the answer.
|
|
|
|
|
Thank you that was very helpful.
|
|
|
|
|
Supported formats include Excel, PDF, Word, and Image.
Note that this specifically does not mention HTML in any form.
You can use the LocalReport.ListRenderingExtensions method[^] to get the list of supported formats.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you. That was very helpful.
|
|
|
|
|
Morning everyone,
less a question but more a discussion.
I am tasked to create a Blazor page we will use to track our RSS or Atom Feeds of interest, which we check regularly and validate if anything related to our work is posted.
I was thinking about displaying the feed contents as markup string, so you'll also be able to read the article directly within the app instead of navigating to the website.
The feed will only be displayed, the data to be stored is detached from the display and will only track if someone of the team has read and validated that article. But i am a bit unsure if that would be a good apprach, with markdown for the display the app would be vulnerable for XSS, but on the other hand if the feed was malicious and the collegue naviagates to the article the XSS could trigger on the corresponding page then.
Am i a bit too cautious on that topic or would you as well only provide a link to the article? I feel it would be neat if you could read the article directly in that app but i am afraid it may cause a security issue.
As a side note i also must admit that we are ordered to limit our usage of 3rd party libs, which would probably help on sanitising the feed contents, although, as written above there is always the option to navigate to the article which just "outsources" the problem.
Thanks for your answers in advance.
Rules for the FOSW ![ ^]
MessageBox.Show(!string.IsNullOrWhiteSpace(_signature)
? $"This is my signature:{Environment.NewLine}{_signature}": "404-Signature not found");
|
|
|
|
|
Hello Beautiful People,
I do photography as a hobby and also play games. As such, I often use SDR mode for the desktop / photography side, but want to swap to HDR mode for playing some games.
Being a bit forgetful, I’ll launch a game from Steam/GOG only realise that I forgot use Win + Alt + B to toggle HDR. Now I have to sit through all the opening movies before I can exit the game, manually turn on HDR then relaunch.
I’d like to develop my own launcher that will allow me to toggle HDR mode prior to calling Steam/GOG to launch a game.
Does anyone know if toggling HDR mode is possible in C# please?
Thanks for your time,
MrCrane.
|
|
|
|
|
There is an MS API which might let you do it: XDisplayTryEnableHdrMode - Microsoft Game Development Kit | Microsoft Learn[^] but you'd have to work out the DLLImport signature for yourself - I've never wanted to use it!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hello OriginalGriff,
Thank you for taking the time to reply.
Best regards,
MC
|
|
|
|