Posts

Showing posts from 2019

Emscripten debug flags

em++ -O0 -g4 hello_world.cpp -o hello.html --emrun -s SIMPLIFY_IFS=0 -s ASSERTIONS=2 -s SAFE_HEAP=1 -s STACK_OVERFLOW_CHECK=2 -s DEMANGLE_SUPPORT=1 -s DISABLE_EXCEPTION_CATCHING=0 -s EXPORT_ALL=1 -s EXPORT_BINDINGS=1 -s EXPORT_FUNCTION_TABLES=1 --source-map-base http://localhost:6931/

Classes From XML Schema

This is the CMD to generate the classes from the schema SET XsdPath=C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools "%XsdPath%\xsd.exe" YOUR-SCHEMA1.xsd YOUR-SCHEMA1.xsd /classes /namespace:YOUR-NAME-SPACE This is the reference:  https://msdn.microsoft.com/en-us/library/x6c1kb0s(v=vs.110).aspx Another good example:  https://blogs.msdn.microsoft.com/yojoshi/2011/05/14/auto-generating-entity-classes-with-xsd-exe-for-xml-serialization-and-de-serialization/ Then for mapping the class you can use:  https://github.com/AutoMapper/AutoMapper You can install it as a nuget package

How To Attach To A C# Process

{ System.Diagnostics.Debug.Assert(System.Diagnostics.Debugger.IsAttached); ... } You can now attach and then hit Ignore on the assert popup dialog.

How To Get OutputDebugString() Working In 64 Bit Windows

Basically you need to enable  NATIVE  code debugging at the managed code level and you need to enable  MIXED  debugging at the non-managed level. 1. Thor or TJMTestApp, Properties->Debug, Enable native code debugging. 2. Transcoder Engine, Properties->Debugging, change Debugger Type from Auto to Mixed. Auto chooses Managed. Stupid Microsoft. 3. (Optional) Tools->Options->Debugging->General, change "Redirect all Output window text to the Immediate window" to what you want. http://stackoverflow.com/questions/8234560/outputdebugstring-does-not-work-on-windows-7x64 http://stackoverflow.com/questions/9431253/outputdebugstring-doesnt-print-information-in-visual-studio-2010

GraphStudioNext Analyzer Filter

Image
This filter from GraphStudioNext's GitHub site ( https://github.com/cplussharp/graph-studio-next ) allows you to sniff media samples passed between filters. The filter is named GsnAnalyzer64.dll and can be found at  \\ la1pvarccifs.d3nw.net \Operations\Vault\Mike\graph_studio_next_helper_filters To use the filter just insert it between other filters.  You will then sniff the media samples passed between them. Open the properties of the GraphStudioNext Analyzer Filter and you will see the samples.  It does not auto-populate, you have to click on the Refresh button.

FFDShow 2012

Overview FFDShow is hosted at: https://sourceforge.net/projects/ffdshow-tryout/ I have ported FFDShow from VS 2010 to VS 2012.  My version of FFDShow 2012 is hosted at: https://github.com/mikecancilla/ffdshow_2012 Prerequisites Before you can build FFDShow locally, you need the YASM assembler.  Its donwload page is here:  http://yasm.tortall.net/Download.html Download the " Win64 .exe  (for general use on 64-bit Windows)", which can be found here: http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win64.exe Put  yasm.exe  in your  PATH . Building After you have pulled down FFDShow 2012, you need to open  ffdshow_2012.sln .  Careful, if VS 2015 is installed, 2015 will attempt to open this project and it will not work.  You will most likely need to launch VS 2012 first and then open  ffdshow_2012.sln . Set the build target to  Debug x64  or  Release x64 , and the startup project to  ffdshow .  I did no work towards getting a 32 bit version to

Build FFMPEG for Windows Using Visual Studio Toolchain

FFMPEG for Windows is built under MinGW or Cygwin.  We will be using MinGW. You may need ZLib, the ZLib provided with MinGW does not come with a .a file for some reason.  You can find ZLib at  https://zlib.net/ Build Zlib so that you get zlib.lib. Follow this page:  https://trac.ffmpeg.org/wiki/CompilationGuide/MSVC NOTE: When following the instructions on the above page, they only give a configure command for a release version, which is: ./configure --target-os=win64 --arch=x86_64 --toolchain=msvc If you want to do a full debug build, try this: ./configure --target-os=win64 --arch=x86_64 --toolchain=msvc --extra-cflags=" -EHa -nologo -D 'DEBUG' -D 'WINDOWS' -D 'HAVE_STRUCT_TIMESPEC' -D 'API_EXT_PARAM_LIST'" --enable-debug --disable-stripping --disable-optimizations --disable-cuda --disable-cuvid --disable-d3d11va --disable-dxva2 --disable-nvenc --disable-vaapi --disable-vdpau You should now be ready to use ffmpeg in a

MXF Closed Caption Research

Overview Below you will find differing approaches to demuxing CC data from an MXF source.  The CC data is in an ancillary meta data stream in the MXF.  The format of the CC data is vbi_vanc_smpte_436M. I have put together a list of working solutions based on off-the-shelf software which, except for one case, we would have to purchase.  The first set of software can take an mxf file and parse out the CC data and convert that CC data to something like SAMI or SCC. Complete Solutions Telestream: $12,000 Enterprise Edition -  www.telestream.net -  http://www.telestream.net/pdfs/user-guides/CaptionMaker-UserGuide-6.4.pdf - Caption Maker - GUI: Can import MXF, process the ancillary data to 608 subs, and export to sami. - Caption Maker - Command Line: CapMaker.exe /ImportType=72 /ImportFile=file.mxf /ExportType=04 /ExportOutFile="captions.scc" - I've finally been able to evaluate the CLI.  It works fine.  Just as fast as ccConvert. - In order for production TNs to ta

libx265 to libx264 Encode Speed Comparison

Here is my totally non-scientific, back of a napkin, H265 to H264 encoder speed comparison.  Full software, no GPU assist using FFMPEG, libx265 and libx264. Machine is a dual quad core, hyperthreaded machine, which totals 16 threads.  Very slow hard drive. ==================================================================== === === Encode with FFMPEG === === Input file: ArcticTale_TRL_MPEGPS_MPEG2_PCM_1080p_16-9_23-97_2-0 === Input frames: 2670 === Output FOURCC: YUV420p === Video only === ===  libx264 Encode: 102.5565403 seconds, File Size: 125 MB ===  libx265 Encode: 355.5555596 seconds, File Size: 20 MB === ==================================================================== ============================    libx264 Encode Command Line ============================ measure-command { ffmpeg -i .\ArcticTale_TRL_MPEGPS_MPEG2_PCM_1080p_16-9_23-97_2-0.mpg -an -vcodec libx264 -pix_fmt yuv420p out_h264.mp4 } ffmpeg version N-76822-g12a419d Copyright (c) 2000-2015 the FFmpeg devel

FFMPEG Internals: Which Parameters Matter

From libavcodec\uils.c: int avcodec_parameters_to_context(AVCodecContext *codec, const AVCodecParameters *par) { codec->codec_type = par->codec_type; codec->codec_id = par->codec_id; codec->codec_tag = par->codec_tag; codec->bit_rate = par->bit_rate; codec->bits_per_coded_sample = par->bits_per_coded_sample; codec->bits_per_raw_sample = par->bits_per_raw_sample; codec->profile = par->profile; codec->level = par->level; switch (par->codec_type) { case AVMEDIA_TYPE_VIDEO: codec->pix_fmt = par->format; codec->width = par->width; codec->height = par->height; codec->field_order = par->field_order; codec->color_range = par->color_range; codec->color_primaries = par->color_primaries; codec->color_trc = par->color_trc; codec->colorspace = par->color_space; codec->chroma_sample_location = par->chroma_location; codec->sample_aspect_ratio = par->sample_aspect_ratio; codec-&g

Visual Leak Detector

https://marketplace.visualstudio.com/items?itemName=ArkadyShapkin.VisualLeakDetectorforVisualC

Building ffmpeg.dll in FFDShow_2012 Source

Use Mingw-w64 Go to ffdshow_2012/src/ffmpeg directory make 64BIT=yes

Using The NuGet Package Explorer

Image
A NuGet package is a package of source, scripts, binaries, etc., plus metadata for use in Visual Studio.  The best way to think about a NuGet package is to think about it in terms you might already be familiar with: basically a zip or tar ball plus metadata.  The NuGet Package Explorer is a GUI tool which packages source, binaries, scripts, etc., plus metadata into a single file (a package) which is published to a server.  Developers can go to the server and pull your package into their Visual Studio project. If you are more command-line inclined, then go to this link: https://docs.nuget.org/create/Creating-and-Publishing-a-Package You can download the NuGet Package Explorer GUI and read about it at this link: https://docs.nuget.org/Create/using-a-gui-to-build-packages The following are some helpful topics for using the NuGet Package Explorer. To create a package: 1. You will most likely be publishing packages to some internal repository,   http://nuget.internal-ur

Visual C/C++ 14.0 Compiler Options

C/C++ COMPILER OPTIONS -OPTIMIZATION- /Od disable optimizations (default) /O1 minimize space /O2 maximize speed /Ob<n> inline expansion (default n=0) /Og enable global optimization /Oi[-] enable intrinsic functions /Os favor code space /Ot favor code speed /Ox maximum optimizations /favor:<blend|AMD64|INTEL64|ATOM> select processor to optimize for, one of: blend - a combination of optimizations for several different x64 processors AMD64 - 64-bit AMD processors INTEL64 - Intel(R)64 architecture processors ATOM - Intel(R) Atom(TM) processors -CODE GENERATION- /Gw[-] separate global variables for linker /GF enable read-only string pooling /Gm[-] enable minimal rebuild /Gy[-] separate functions for linker /GS[-] enable security checks /GR[-] enable C++ RTTI /GX[-] enable C++ EH (same as /EHsc) /guard:cf[-] enable CFG (control flow guard) /EHs enable C++ EH (no SEH exceptions) /EHa enable C++ EH (w/ SEH exceptions) /EHc extern "C" defaults to nothrow /EHr al

Building avxsynth

https://github.com/avxsynth/avxsynth/wiki Note:  Optional WINDOWS under MinGW Launch MinGW the usual way as if you are going to build FFMPEG. You are gonna need log4cpp:   http://log4cpp.sourceforge.net/ log4cpp  needs  pkg-config: You need to pull down the pkg-config utility and build it yourself.  Once built you need to "autoreconf -i" in the avxsynth src dir.  Then you will have a good configure. More here:  https://askubuntu.com/questions/468661/how-to-fix-pkg-prog-pkg-config-command-not-found-error Use git to get the pkg-config src:  https://cgit.freedesktop.org/pkg-config You are gonna need libcairo:  https://cairographics.org/download/ git clone  git://anongit.freedesktop.org/git/cairo ./configure --enable-png=no --enable-svg=no Have to edit cairo-missing.h and comment out typedef SSIZE_T ssize_t; libcairo  needs  libpng :  http://www.libpng.org/pub/png/libpng.html libpng's configure works, but the build broke.  Had to fix up a header f