===============================================================================
 FFmpeg / LGPL COMPLIANCE NOTICE AND RELINKING INSTRUCTIONS
 iCube Sony XAVC MP4 Recovery 1.0.44
 iCube Development (Calgary) Ltd.
===============================================================================

This document exists to satisfy the GNU Lesser General Public License,
version 2.1 or later, for the FFmpeg code used in this product. It tells you
what FFmpeg code is in here, exactly how it was built, and exactly how to
rebuild and relink it yourself with your own version of FFmpeg.

If you only want to use the program, you can stop reading. Nothing in this
file is required to run it.


-------------------------------------------------------------------------------
1. WHAT USES FFmpeg
-------------------------------------------------------------------------------

Only one file in this package contains FFmpeg code:

    iCubeXAVCValidate.dll

That DLL is the validator. Its entire job is to take reconstructed video
samples and push them through a real H.264 decoder, so the program can say a
recovered clip decoded rather than guessing that it probably did.

The main program, iCube_Sony_XAVC_Recovery.exe, contains no FFmpeg code. It
loads the validator DLL at runtime through a small function pointer interface
(see icube_xavc_validate.h). If the DLL is absent or replaced, the program
still runs; it just cannot decode-validate, which is also what the
--no-validator option does.

No ffmpeg.exe, ffprobe.exe or any other FFmpeg program is included, shipped,
bundled, or executed by this product.


-------------------------------------------------------------------------------
2. LICENSE AND OWNERSHIP
-------------------------------------------------------------------------------

FFmpeg is licensed under the GNU Lesser General Public License version 2.1 or
later (LGPL v2.1+).

FFmpeg is NOT owned by, affiliated with, or endorsed by iCube Development
(Calgary) Ltd. FFmpeg is a separate project with its own authors and its own
copyright holders. We use it, we are grateful for it, and we claim no
ownership of any part of it.

The validator build is configured deliberately WITHOUT --enable-gpl and
WITHOUT --enable-nonfree, so no GPL-only or non-redistributable FFmpeg
component is present.

Full text of the applicable licenses is included in this package:

    ffmpeg-source/COPYING.LGPLv2.1     the license FFmpeg is used under here
    ffmpeg-source/LICENSE.md           FFmpeg's own licensing summary
    ffmpeg-source/CREDITS              FFmpeg contributors
    LGPL-2.1.txt                       standalone copy of the LGPL v2.1

Official references:

    https://ffmpeg.org/legal.html
    https://ffmpeg.org/doxygen/trunk/md_LICENSE.html
    https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html


-------------------------------------------------------------------------------
3. WHICH FFmpeg VERSION IS IN THIS BUILD
-------------------------------------------------------------------------------

    FFmpeg release / tag : <<< FILL IN BEFORE RELEASE, e.g. n7.1 >>>
    Git commit           : <<< FILL IN BEFORE RELEASE, full 40-char SHA >>>
    Source archive       : ffmpeg-source/   (complete, unmodified)
    SHA-256 of archive   : <<< FILL IN BEFORE RELEASE >>>

The directory ffmpeg-source/ contains the complete, corresponding, machine
readable source used to build the iCubeXAVCValidate.dll shipped in this
package. It is the whole FFmpeg tree as obtained from the project, not a
subset, so that a rebuild reproduces what we shipped.


-------------------------------------------------------------------------------
4. MODIFICATIONS TO FFmpeg
-------------------------------------------------------------------------------

NONE.

No FFmpeg source file was patched, edited, or otherwise altered for this
build. The only thing that differs from a stock build is the configure line in
section 5, which selects a minimal feature set. If that ever changes in a
future release, the patches will be placed in a directory named
ffmpeg-patches/ and listed here.


-------------------------------------------------------------------------------
5. EXACT BUILD CONFIGURATION
-------------------------------------------------------------------------------

Built on Windows in an MSYS2 UCRT64 shell, x86_64.

FFmpeg was configured with exactly this:

    ./configure \
      --prefix="$PREFIX" \
      --target-os=mingw32 \
      --arch=x86_64 \
      --disable-shared \
      --enable-static \
      --disable-programs \
      --disable-doc \
      --disable-debug \
      --disable-network \
      --disable-autodetect \
      --disable-avdevice \
      --disable-avformat \
      --disable-avfilter \
      --disable-swresample \
      --disable-swscale \
      --disable-everything \
      --enable-avcodec \
      --enable-avutil \
      --enable-decoder=h264 \
      --extra-cflags="-Wno-array-bounds"

    make -j"$(nproc)"
    make install

That leaves libavcodec and libavutil with a single decoder, h264, and nothing
else. No demuxers, no muxers, no filters, no network code, no external
libraries.

The validator DLL was then linked with exactly this:

    export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
    CFLAGS="$(pkg-config --cflags libavcodec libavutil)"
    LIBS="$(pkg-config --static --libs libavcodec libavutil)"

    # FFmpeg's static pkg-config metadata may request winpthread dynamically.
    # Both spellings are stripped and the real static archive is appended.
    LIBS="$(printf '%s\n' "$LIBS" | sed -E \
      's/(^|[[:space:]])-pthread([[:space:]]|$)/ /g;
       s/(^|[[:space:]])-lwinpthread([[:space:]]|$)/ /g')"

    gcc -O3 -flto -std=c11 -DNDEBUG \
      -fstack-protector-strong \
      -ffunction-sections -fdata-sections \
      -fno-ident \
      -shared \
      -static-libgcc \
      -Wl,--gc-sections \
      -Wl,--strip-all \
      -Wl,--dynamicbase \
      -Wl,--nxcompat \
      -o iCubeXAVCValidate.dll \
      icube_xavc_validate.c \
      $CFLAGS $LIBS \
      "$WINPTHREAD_STATIC"

This is not a paraphrase. The script that does it, verbatim, is included as
build_validator_c44_ucrt64.sh.


-------------------------------------------------------------------------------
6. WHAT IS IN THIS PACKAGE
-------------------------------------------------------------------------------

    iCube_Sony_XAVC_Recovery.exe        main program, no FFmpeg code in it
    iCubeXAVCValidate.dll               validator, statically links FFmpeg

    README-FFMPEG-LGPL.txt              this file
    LGPL-2.1.txt                        GNU LGPL version 2.1

    icube_xavc_validate.c               validator wrapper source
    icube_xavc_validate.h               validator ABI header
    build_validator_c44_ucrt64.sh       the exact script that built the DLL

    ffmpeg-source/                      complete corresponding FFmpeg source
    ffmpeg-source/COPYING.LGPLv2.1
    ffmpeg-source/LICENSE.md
    ffmpeg-source/CREDITS

Between the FFmpeg source, the configure line, the wrapper source and the
build script, you have everything needed to produce a modified validator and
drop it in place of ours. That is the point of section 7.


-------------------------------------------------------------------------------
7. HOW TO RELINK THE VALIDATOR YOURSELF
-------------------------------------------------------------------------------

You are entitled to modify the FFmpeg portion of this product and use your
modified version with it. Here is how, start to finish.

  1. Install MSYS2 and open a UCRT64 shell.
     https://www.msys2.org

  2. Install the build prerequisites:

         pacman -S --needed make diffutils \
             mingw-w64-ucrt-x86_64-nasm \
             mingw-w64-ucrt-x86_64-pkgconf \
             mingw-w64-ucrt-x86_64-gcc

  3. Put the FFmpeg source somewhere convenient. Use the bundled
     ffmpeg-source/ directory, or your own FFmpeg tree, modified however you
     like. Any reasonably current FFmpeg release exposing libavcodec and
     libavutil with an h264 decoder should work.

  4. From the directory holding icube_xavc_validate.c and the build script,
     run:

         ./build_validator_c44_ucrt64.sh /path/to/ffmpeg-source

     The script configures and builds FFmpeg with the options in section 5,
     then links iCubeXAVCValidate.dll against it.

  5. Copy the resulting iCubeXAVCValidate.dll next to
     iCube_Sony_XAVC_Recovery.exe, replacing ours.

  6. Run the program. It loads whichever validator DLL sits beside it.

The interface the DLL must satisfy is documented in icube_xavc_validate.h. It
is six exported functions and two structs. The program checks
icube_xavc_get_abi() at load time and refuses a mismatched DLL rather than
crashing, so if the ABI ever changes you will get a clear message instead of
undefined behaviour.

Verify the build has no unexpected runtime dependency:

    objdump -p iCubeXAVCValidate.dll | grep "DLL Name"

The build script already fails deliberately if a dynamic
libwinpthread-1.dll dependency survives.


-------------------------------------------------------------------------------
8. WRITTEN OFFER FOR SOURCE
-------------------------------------------------------------------------------

The corresponding FFmpeg source is included in this package, so no request
should be necessary. If you nonetheless received these binaries without the
source, or the source directory is missing or damaged, we will supply the
complete corresponding machine readable source for the FFmpeg version used in
this build, on physical media or by download, for no more than our cost of
distribution. Ask and you will get it.

    iCube Development (Calgary) Ltd.
    Calgary, Alberta, Canada
    info@icubedev.com
    (888) 728-CUBE (2823)
    https://icubedev.com
    https://sonyvideorecovery.com

This offer is valid for at least three years from the date you received this
package.


-------------------------------------------------------------------------------
9. LICENSING OF THE iCube PORTIONS
-------------------------------------------------------------------------------

Copyright (C) 2026 iCube Development (Calgary) Ltd.

iCube Sony XAVC MP4 Recovery is distributed free of charge, for personal and
commercial use, with no licence fee, no registration, and no restriction on
who may run it or what they may recover with it. Use it on client work. Put
it on a technician's USB stick. Hand it to whoever needs it.

Keep this notice, the LGPL text, and the FFmpeg source with the binaries when
you pass them on. That is the one obligation.

The validator wrapper source (icube_xavc_validate.c, icube_xavc_validate.h)
and its build script are provided specifically so the LGPL relinking right in
section 7 is real and usable, not theoretical.

THIS PROGRAM IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE. USE IS AT YOUR OWN RISK. ALWAYS WORK FROM
AN IMAGE OF YOUR MEDIA, NEVER FROM YOUR ONLY COPY.

This is a free program. If you paid for it, get your money back.


-------------------------------------------------------------------------------
10. OTHER TRADEMARKS
-------------------------------------------------------------------------------

Sony, XAVC, XAVC S and XAVC HS are trademarks of Sony Corporation. iCube
Development (Calgary) Ltd. is not affiliated with, authorised by, or endorsed
by Sony Corporation. Windows is a trademark of Microsoft Corporation. All
trademarks are the property of their respective owners.


-------------------------------------------------------------------------------
 This notice documents build and distribution requirements as we understand
 them. It is not legal advice.
-------------------------------------------------------------------------------
