浏览代码

1.添加fmp4所需要的盒子编码器

2.添加fragmented_demo.mp4
tags/v1.1.0
SmallChi(Koike) 4 年前
父节点
当前提交
2a43d65108
共有 7 个文件被更改,包括 62 次插入9 次删除
  1. +3
    -0
      doc/ffmpeginfo.txt
  2. 二进制
      doc/video/fragmented_demo.mp4
  3. +18
    -1
      src/JT1078.FMp4/Boxs/SampleToGroupBox.cs
  4. +36
    -4
      src/JT1078.FMp4/Boxs/SubSampleInformationBox.cs
  5. +0
    -1
      src/JT1078.FMp4/FMp4Box.cs
  6. +3
    -2
      src/JT1078.FMp4/JT1078.FMp4.xml
  7. +2
    -1
      src/JT1078.FMp4/Samples/AVC1SampleEntry.cs

+ 3
- 0
doc/ffmpeginfo.txt 查看文件

@@ -4,4 +4,7 @@ ffmpeg -i demo.mp4 -c copy -f flv -vcodec h264 -acodec aac demo_flv.flv

ffmpeg -f dshow -i video="USB2.0 PC CAMERA" -t 60 -c copy -f h264 -vcodec h264 jt1078.264

ffmpeg -i demo.264 -vcodec copy -f mp4 -movflags frag_keyframe+empty_moov fragmented_demo.mp4


chrome://media-internals/

二进制
doc/video/fragmented_demo.mp4 查看文件


+ 18
- 1
src/JT1078.FMp4/Boxs/SampleToGroupBox.cs 查看文件

@@ -32,7 +32,24 @@ namespace JT1078.FMp4

public void ToBuffer(ref FMp4MessagePackWriter writer)
{
//todo:sbgp
writer.WriteUInt32(GroupingType);
if (Version == 1)
{
writer.WriteUInt32(GroupingTypeParameter);
}
if(SampleToGroupInfos!=null && SampleToGroupInfos.Count > 0)
{
writer.WriteUInt32((uint)SampleToGroupInfos.Count);
foreach(var item in SampleToGroupInfos)
{
writer.WriteUInt32(item.SampleCount);
writer.WriteUInt32(item.GroupDescriptionIndex);
}
}
else
{
writer.WriteUInt32(0);
}
}

public class SampleToGroupInfo


+ 36
- 4
src/JT1078.FMp4/Boxs/SubSampleInformationBox.cs 查看文件

@@ -26,7 +26,39 @@ namespace JT1078.FMp4

public void ToBuffer(ref FMp4MessagePackWriter writer)
{
//todo:subs
if(SubSampleInformations!=null && SubSampleInformations.Count > 0)
{
foreach(var item in SubSampleInformations)
{
writer.WriteUInt32(item.SampleDelta);
if (item.InnerSubSampleInformations != null && item.InnerSubSampleInformations.Count > 0)
{
writer.WriteUInt16((ushort)item.InnerSubSampleInformations.Count);
foreach(var subItem in item.InnerSubSampleInformations)
{
if (Version == 1)
{
writer.WriteUInt32(subItem.SubsampleSize);
}
else
{
writer.WriteUInt16((ushort)subItem.SubsampleSize);
}
writer.WriteByte(subItem.SubsamplePriority);
writer.WriteByte(subItem.Discardable);
writer.WriteUInt32(subItem.Reserved);
}
}
else
{
writer.WriteUInt16(0);
}
}
}
else
{
writer.WriteUInt32((uint)SubSampleInformations.Count);
}
}

public class SubSampleInformation
@@ -39,10 +71,10 @@ namespace JT1078.FMp4
public class InnerSubSampleInformation
{
/// <summary>
/// version == 1
/// version == 1 uint32
/// version != 1 uint16
/// </summary>
public uint SubsampleSizeLarge { get; set; }
public ushort SubsampleSize { get; set; }
public uint SubsampleSize { get; set; }
public byte SubsamplePriority { get; set; }
public byte Discardable { get; set; }
public uint Reserved { get; set; }


+ 0
- 1
src/JT1078.FMp4/FMp4Box.cs 查看文件

@@ -40,7 +40,6 @@ namespace JT1078.FMp4
item.MediaDataBox.ToBuffer(ref writer);
}
}

}
}
}

+ 3
- 2
src/JT1078.FMp4/JT1078.FMp4.xml 查看文件

@@ -678,9 +678,10 @@
<param name="version"></param>
<param name="flags"></param>
</member>
<member name="P:JT1078.FMp4.SubSampleInformationBox.SubSampleInformation.InnerSubSampleInformation.SubsampleSizeLarge">
<member name="P:JT1078.FMp4.SubSampleInformationBox.SubSampleInformation.InnerSubSampleInformation.SubsampleSize">
<summary>
version == 1
version == 1 uint32
version != 1 uint16
</summary>
</member>
<member name="P:JT1078.FMp4.SubsegmentIndexBox.SubsegmentIndexInfos">


+ 2
- 1
src/JT1078.FMp4/Samples/AVC1SampleEntry.cs 查看文件

@@ -36,6 +36,7 @@ namespace JT1078.FMp4.Samples
}
End(ref writer);
}
//todo:public MPEG4ExtensionDescriptorsBox MPEG4BitRateBox { get; set; }

//public MPEG4ExtensionDescriptorsBox MPEG4BitRateBox { get; set; }
}
}

正在加载...
取消
保存