Я только начал изучать ffmpeg, используя оболочку ffmpeg.autogen версии 5.1 в C# и общие библиотеки ffmpeg версии 5.1. Я пытаюсь создать класс, который записывает экран с помощью gdigrab и создает потоковый mp4 в буфер/событие. Кажется, что все работает так, как и предполагалось, без ошибок, за исключением того, что выходной поток создает атомные блоки с размером 0, поэтому размер файла также небольшой, в полях не создается никаких данных, «отладочный тестовый файл mp4» анализируется с помощью MP4Box и Информация о коробке указана в теме.
Чтобы быть более конкретным, почему этот код создает пустые атомные блоки, может ли кто-нибудь сделать так, чтобы созданные данные действительно содержали какие-либо данные кадра из gdigrab, редактирующего мой код?
`код:
public unsafe class ScreenStreamer : IDisposable
{
private readonly AVCodec* productionCodec;
private readonly AVCodec* screenCaptureAVCodec;
private readonly AVCodecContext* productionAVCodecContext;
private readonly AVFormatContext* productionFormatContext;
private readonly AVCodecContext* screenCaptureAVCodecContext;
private readonly AVDictionary* productionAVCodecOptions;
private readonly AVInputFormat* screenCaptureInputFormat;
private readonly AVFormatContext* screenCaptureInputFormatContext;
private readonly int gDIGrabVideoStreamIndex;
private readonly System.Drawing.Size screenBounds;
private readonly int _produceAtleastAmount;
public EventHandler<byte[]> OnNewVideoDataProduced;
private MemoryStream unsafeToManagedBridgeBuffer;
private CancellationTokenSource cancellationTokenSource;
private Task recorderTask;
public ScreenStreamer(int fps, int bitrate, int screenIndex, int produceAtleastAmount = 1000)
{
ffmpeg.avdevice_register_all();
ffmpeg.avformat_network_init();
recorderTask = Task.CompletedTask;
cancellationTokenSource = new CancellationTokenSource();
unsafeToManagedBridgeBuffer = new MemoryStream();
_produceAtleastAmount = produceAtleastAmount;
// Allocate and initialize production codec and context
productionCodec = ffmpeg.avcodec_find_encoder(AVCodecID.AV_CODEC_ID_H264);
if (productionCodec == null) throw new ApplicationException("Could not find encoder for codec ID H264.");
productionAVCodecContext = ffmpeg.avcodec_alloc_context3(productionCodec);
if (productionAVCodecContext == null) throw new ApplicationException("Could not allocate video codec context.");
// Set codec parameters
screenBounds = RetrieveScreenBounds(screenIndex);
productionAVCodecContext->width = screenBounds.Width;
productionAVCodecContext->height = screenBounds.Height;
productionAVCodecContext->time_base = new AVRational() { den = fps, num = 1 };
productionAVCodecContext->pix_fmt = AVPixelFormat.AV_PIX_FMT_YUV420P;
productionAVCodecContext->bit_rate = bitrate;
int result = ffmpeg.av_opt_set(productionAVCodecContext->priv_data, "preset", "veryfast", 0);
if (result != 0)
{
throw new ApplicationException($"Failed to set options with error code {result}.");
}
// Open codec
fixed (AVDictionary** pm = &productionAVCodecOptions)
{
result = ffmpeg.av_dict_set(pm, "movflags", "frag_keyframe+empty_moov+default_base_moof", 0);
if (result < 0)
{
throw new ApplicationException($"Failed to set dictionary with error code {result}.");
}
result = ffmpeg.avcodec_open2(productionAVCodecContext, productionCodec, pm);
if (result < 0)
{
throw new ApplicationException($"Failed to open codec with error code {result}.");
}
}
// Allocate and initialize screen capture codec and context
screenCaptureInputFormat = ffmpeg.av_find_input_format("gdigrab");
if (screenCaptureInputFormat == null) throw new ApplicationException("Could not find input format gdigrab.");
fixed (AVFormatContext** ps = &screenCaptureInputFormatContext)
{
result = ffmpeg.avformat_open_input(ps, "desktop", screenCaptureInputFormat, null);
if (result < 0)
{
throw new ApplicationException($"Failed to open input with error code {result}.");
}
result = ffmpeg.avformat_find_stream_info(screenCaptureInputFormatContext, null);
if (result < 0)
{
throw new ApplicationException($"Failed to find stream info with error code {result}.");
}
}
gDIGrabVideoStreamIndex = -1;
for (int i = 0; i < screenCaptureInputFormatContext->nb_streams; i++)
{
if (screenCaptureInputFormatContext->streams[i]->codecpar->codec_type == AVMediaType.AVMEDIA_TYPE_VIDEO)
{
gDIGrabVideoStreamIndex = i;
break;
}
}
if (gDIGrabVideoStreamIndex < 0)
{
throw new ApplicationException("Failed to find video stream in input.");
}
AVCodecParameters* codecParameters = screenCaptureInputFormatContext->streams[gDIGrabVideoStreamIndex]->codecpar;
screenCaptureAVCodec = ffmpeg.avcodec_find_decoder(codecParameters->codec_id);
if (screenCaptureAVCodec == null)
{
throw new ApplicationException("Could not find decoder for screen capture.");
}
screenCaptureAVCodecContext = ffmpeg.avcodec_alloc_context3(screenCaptureAVCodec);
if (screenCaptureAVCodecContext == null)
{
throw new ApplicationException("Could not allocate screen capture codec context.");
}
result = ffmpeg.avcodec_parameters_to_context(screenCaptureAVCodecContext, codecParameters);
if (result < 0)
{
throw new ApplicationException($"Failed to copy codec parameters to context with error code {result}.");
}
result = ffmpeg.avcodec_open2(screenCaptureAVCodecContext, screenCaptureAVCodec, null);
if (result < 0)
{
throw new ApplicationException($"Failed to open screen capture codec with error code {result}.");
}
}
public void Start()
{
recorderTask = Task.Run(() =>
{
AVPacket* packet = ffmpeg.av_packet_alloc();
AVFrame* rawFrame = ffmpeg.av_frame_alloc();
AVFrame* compatibleFrame = null;
byte* dstBuffer = null;
try
{
while (!cancellationTokenSource.Token.IsCancellationRequested)
{
if (ffmpeg.av_read_frame(screenCaptureInputFormatContext, packet) >= 0)
{
if (packet->stream_index == gDIGrabVideoStreamIndex)
{
int response = ffmpeg.avcodec_send_packet(screenCaptureAVCodecContext, packet);
if (response < 0)
{
throw new ApplicationException($"Error while sending a packet to the decoder: {response}");
}
response = ffmpeg.avcodec_receive_frame(screenCaptureAVCodecContext, rawFrame);
if (response == ffmpeg.AVERROR(ffmpeg.EAGAIN) || response == ffmpeg.AVERROR_EOF)
{
continue;
}
else if (response < 0)
{
throw new ApplicationException($"Error while receiving a frame from the decoder: {response}");
}
compatibleFrame = ConvertToCompatiblePixelFormat(rawFrame, out dstBuffer);
response = ffmpeg.avcodec_send_frame(productionAVCodecContext, compatibleFrame);
if (response < 0)
{
throw new ApplicationException($"Error while sending a frame to the encoder: {response}");
}
while (response >= 0)
{
response = ffmpeg.avcodec_receive_packet(productionAVCodecContext, packet);
if (response == ffmpeg.AVERROR(ffmpeg.EAGAIN) || response == ffmpeg.AVERROR_EOF)
{
break;
}
else if (response < 0)
{
throw new ApplicationException($"Error while receiving a packet from the encoder: {response}");
}
using var packetStream = new UnmanagedMemoryStream(packet->data, packet->size);
packetStream.CopyTo(unsafeToManagedBridgeBuffer);
byte[] managedBytes = unsafeToManagedBridgeBuffer.ToArray();
OnNewVideoDataProduced?.Invoke(this, managedBytes);
unsafeToManagedBridgeBuffer.SetLength(0);
}
}
}
ffmpeg.av_packet_unref(packet);
ffmpeg.av_frame_unref(rawFrame);
if (compatibleFrame != null)
{
ffmpeg.av_frame_unref(compatibleFrame);
ffmpeg.av_free(dstBuffer);
}
}
}
finally
{
ffmpeg.av_packet_free(&packet);
ffmpeg.av_frame_free(&rawFrame);
if (compatibleFrame != null)
{
ffmpeg.av_frame_free(&compatibleFrame);
}
}
});
}
public AVFrame* ConvertToCompatiblePixelFormat(AVFrame* srcFrame, out byte* dstBuffer)
{
AVFrame* dstFrame = ffmpeg.av_frame_alloc();
int buffer_size = ffmpeg.av_image_get_buffer_size(productionAVCodecContext->pix_fmt, productionAVCodecContext->width, productionAVCodecContext->height, 1);
byte_ptrArray4 dstData = new byte_ptrArray4();
int_array4 dstLinesize = new int_array4();
dstBuffer = (byte*)ffmpeg.av_malloc((ulong)buffer_size);
ffmpeg.av_image_fill_arrays(ref dstData, ref dstLinesize, dstBuffer, productionAVCodecContext->pix_fmt, productionAVCodecContext->width, productionAVCodecContext->height, 1);
dstFrame->format = (int)productionAVCodecContext->pix_fmt;
dstFrame->width = productionAVCodecContext->width;
dstFrame->height = productionAVCodecContext->height;
dstFrame->data.UpdateFrom(dstData);
dstFrame->linesize.UpdateFrom(dstLinesize);
SwsContext* swsCtx = ffmpeg.sws_getContext(
srcFrame->width, srcFrame->height, (AVPixelFormat)srcFrame->format,
productionAVCodecContext->width, productionAVCodecContext->height, productionAVCodecContext->pix_fmt,
ffmpeg.SWS_BILINEAR, null, null, null);
if (swsCtx == null)
{
throw new ApplicationException("Could not initialize the conversion context.");
}
ffmpeg.sws_scale(swsCtx, srcFrame->data, srcFrame->linesize, 0, srcFrame->height, dstFrame->data, dstFrame->linesize);
ffmpeg.sws_freeContext(swsCtx);
return dstFrame;
}
private System.Drawing.Size RetrieveScreenBounds(int screenIndex)
{
return new System.Drawing.Size(1920, 1080);
}
public void Dispose()
{
cancellationTokenSource?.Cancel();
recorderTask?.Wait();
cancellationTokenSource?.Dispose();
recorderTask?.Dispose();
unsafeToManagedBridgeBuffer?.Dispose();
fixed (AVCodecContext** p = &productionAVCodecContext)
{
if (*p != null)
{
ffmpeg.avcodec_free_context(p);
}
}
fixed (AVCodecContext** p = &screenCaptureAVCodecContext)
{
if (*p != null)
{
ffmpeg.avcodec_free_context(p);
}
}
if (productionFormatContext != null)
{
ffmpeg.avformat_free_context(productionFormatContext);
}
if (screenCaptureInputFormatContext != null)
{
ffmpeg.avformat_free_context(screenCaptureInputFormatContext);
}
if (productionAVCodecOptions != null)
{
fixed (AVDictionary** p = &productionAVCodecOptions)
{
ffmpeg.av_dict_free(p);
}
}
}
}
Я вызываю метод Start и жду 8 секунд. Я записываю байты в файл mp4 без использования трейлера записи только для отладки атомбоксов. и вывод окна отладки mp4, который я получил:
(ПОЛНЫЙ ВЫХОД) https://pastebin.com/xkM4MfG7
(Не полный)
"
<Boxes>
<UUIDBox Size = "0" Type = "uuid" UUID = "{00000000-00000000-00000000-00000000}" Specification = "unknown" Container = "unknown" >
</UUIDBox>
<TrackReferenceTypeBox Size = "0" Type = "cdsc" Specification = "p12" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "hint" Specification = "p12" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "font" Specification = "p12" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "hind" Specification = "p12" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "vdep" Specification = "p12" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "vplx" Specification = "p12" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "subt" Specification = "p12" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "thmb" Specification = "p12" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "mpod" Specification = "p14" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "dpnd" Specification = "p14" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "sync" Specification = "p14" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "ipir" Specification = "p14" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "sbas" Specification = "p15" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "scal" Specification = "p15" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "tbas" Specification = "p15" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "sabt" Specification = "p15" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "oref" Specification = "p15" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "adda" Specification = "p12" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "adrc" Specification = "p12" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "iloc" Specification = "p12" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "avcp" Specification = "p15" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "swto" Specification = "p15" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "swfr" Specification = "p15" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "chap" Specification = "apple" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "tmcd" Specification = "apple" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "cdep" Specification = "apple" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "scpt" Specification = "apple" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "ssrc" Specification = "apple" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<TrackReferenceTypeBox Size = "0" Type = "lyra" Specification = "apple" Container = "tref" >
<TrackReferenceEntry TrackID = ""/>
</TrackReferenceTypeBox>
<ItemReferenceBox Size = "0" Type = "tbas" Specification = "p12" Container = "iref" from_item_id = "0">
<ItemReferenceBoxEntry ItemID = ""/>
</ItemReferenceBox>
<ItemReferenceBox Size = "0" Type = "iloc" Specification = "p12" Container = "iref" from_item_id = "0">
<ItemReferenceBoxEntry ItemID = ""/>
</ItemReferenceBox>
<ItemReferenceBox Size = "0" Type = "fdel" Specification = "p12" Container = "iref" from_item_id = "0">
<ItemReferenceBoxEntry ItemID = ""/>
</ItemReferenceBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p12" Container = "stbl traf" grouping_type = "roll">
<RollRecoveryEntry roll_distance = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p12" Container = "stbl traf" grouping_type = "prol">
<AudioPreRollEntry roll_distance = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p12" Container = "stbl traf" grouping_type = "rap ">
<VisualRandomAccessEntry num_leading_samples_known = "yes|no" num_leading_samples = "" />
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "seig">
<CENCSampleEncryptionGroupEntry IsEncrypted = "" IV_size = "" KID = "" constant_IV_size = "" constant_IV = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "oinf">
<OperatingPointsInformation scalability_mask = "Multiview|Spatial scalability|Auxiliary|unknown" num_profile_tier_level = "" num_operating_points = "" dependency_layers = "">
<ProfileTierLevel general_profile_space = "" general_tier_flag = "" general_profile_idc = "" general_profile_compatibility_flags = "" general_constraint_indicator_flags = "" />
<OperatingPoint output_layer_set_idx = "" max_temporal_id = "" layer_count = "" minPicWidth = "" minPicHeight = "" maxPicWidth = "" maxPicHeight = "" maxChromaFormat = "" maxBitDepth = "" frame_rate_info_flag = "" bit_rate_info_flag = "" avgFrameRate = "" constantFrameRate = "" maxBitRate = "" avgBitRate = ""/>
<Layer dependent_layerID = "" num_layers_dependent_on = "" dependent_on_layerID = "" dimension_identifier = ""/>
</OperatingPointsInformation>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "linf">
<LayerInformation num_layers = "">
<LayerInfoItem layer_id = "" min_temporalId = "" max_temporalId = "" sub_layer_presence_flags = ""/>
</LayerInformation>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "trif">
<TileRegionGroupEntry ID = "" tileGroup = "" independent = "" full_picture = "" filter_disabled = "" x = "" y = "" w = "" h = "">
<TileRegionDependency tileID = ""/>
</TileRegionGroupEntry>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "nalm">
<NALUMap rle = "" large_size = "">
<NALUMapEntry NALU_startNumber = "" groupID = ""/>
</NALUMap>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p12" Container = "stbl traf" grouping_type = "tele">
<TemporalLevelEntry level_independently_decodable = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p12" Container = "stbl traf" grouping_type = "rash">
<DefaultSampleGroupDescriptionEntry size = "" data = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p12" Container = "stbl traf" grouping_type = "alst">
<DefaultSampleGroupDescriptionEntry size = "" data = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p12" Container = "stbl traf" grouping_type = "sap ">
<SAPEntry dependent_flag = "" SAP_type = "" />
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "avll">
<DefaultSampleGroupDescriptionEntry size = "" data = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "avss">
<DefaultSampleGroupDescriptionEntry size = "" data = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "dtrt">
<DefaultSampleGroupDescriptionEntry size = "" data = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "mvif">
<DefaultSampleGroupDescriptionEntry size = "" data = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "scif">
<DefaultSampleGroupDescriptionEntry size = "" data = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "scnm">
<DefaultSampleGroupDescriptionEntry size = "" data = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "stsa">
<DefaultSampleGroupDescriptionEntry size = "" data = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "tsas">
<DefaultSampleGroupDescriptionEntry size = "" data = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "sync">
<SyncSampleGroupEntry NAL_unit_type = "" />
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "tscl">
<DefaultSampleGroupDescriptionEntry size = "" data = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "vipr">
<DefaultSampleGroupDescriptionEntry size = "" data = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "lbli">
<DefaultSampleGroupDescriptionEntry size = "" data = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "p15" Container = "stbl traf" grouping_type = "spor">
<SubPictureOrderEntry subpic_id_info_flag = "" refs = "" subpic_id_len_minus1 = "" subpic_id_bit_pos = "" start_code_emul_flag = "" pps_id = "" sps_id = "" />
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "3gpp" Container = "stbl traf" grouping_type = "3gag">
<DefaultSampleGroupDescriptionEntry size = "" data = ""/>
</SampleGroupDescriptionBox>
<SampleGroupDescriptionBox Size = "0" Type = "sgpd" Version = "0" Flags = "0" Specification = "3gpp" Container = "stbl traf" grouping_type = "avcb">
<DefaultSampleGroupDescriptionEntry size = "" data = ""/>
</SampleGroupDescriptionBox>
<SampleDescriptionEntryBox Size = "0" Type = "GNRM" Specification = "unknown" Container = "stsd" DataReferenceIndex = "0" ExtensionDataSize = "0">
</SampleDescriptionEntryBox>
<VisualSampleDescriptionBox Size = "0" Type = "GNRV" Specification = "unknown" Container = "stsd" DataReferenceIndex = "0" Version = "0" Revision = "0" Vendor = "0" TemporalQuality = "0" SpacialQuality = "0" Width = "0" Height = "0" HorizontalResolution = "4718592" VerticalResolution = "4718592" CompressorName = "" BitDepth = "24">
</VisualSampleDescriptionBox>
<AudioSampleDescriptionBox Size = "0" Type = "GNRA" Specification = "unknown" Container = "stsd" DataReferenceIndex = "0" Version = "0" Revision = "0" Vendor = "0" ChannelCount = "2" BitsPerSample = "16" Samplerate = "0">
</AudioSampleDescriptionBox>
<TrackGroupTypeBox Size = "0" Type = "msrc" Version = "0" Flags = "0" Specification = "p12" Container = "trgr" track_group_id = "0">
</TrackGroupTypeBox>
<TrackGroupTypeBox Size = "0" Type = "ster" Version = "0" Flags = "0" Specification = "p12" Container = "trgr" track_group_id = "0">
</TrackGroupTypeBox>
<TrackGroupTypeBox Size = "0" Type = "cstg" Version = "0" Flags = "0" Specification = "p15" Container = "trgr" track_group_id = "0">
</TrackGroupTypeBox>
<FreeSpaceBox Size = "0" Type = "free" Specification = "p12" Container = "*" dataSize = "0">
</FreeSpaceBox>
<FreeSpaceBox Size = "0" Type = "free" Specification = "p12" Container = "*" dataSize = "0">
</FreeSpaceBox>
<MediaDataBox Size = "0" Type = "mdat" Specification = "p12" Container = "file" dataSize = "0">
</MediaDataBox>
<MediaDataBox Size = "0" Type = "mdat" Specification = "p12" Container = "meta" dataSize = "0">
"





На самом деле кажется, что размер окна будет равен 0 независимо от файла, анализируемого mp4box.exe.
Здравствуйте и добро пожаловать в StackOverflow. Это ответ на ваш собственный вопрос? Это не похоже на ответ.