Skip to content

Commit

Permalink
No need to extract video when 0x47 appears in the first 4B of m2ts file
Browse files Browse the repository at this point in the history
The underlying issue is already fixed by AkarinVS/L-SMASH-Works#6.
This reverts commit 73fb4f7.

Signed-off-by: akarin <i@akarin.info>
  • Loading branch information
AkarinVS committed Oct 22, 2022
1 parent 0e1e4f5 commit 8d59ecd
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 84 deletions.
4 changes: 1 addition & 3 deletions OKEGui/OKEGui/JobProcessor/Demuxer/EACDemuxer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public EacOutputTrackType(TrackCodec codec, string rawOutput, string extension,
private List<AudioInfo> JobAudio;
private List<Info> JobSub;
private int length;
private bool extractVideo;
private string WorkingPathPrefix;

private static List<EacOutputTrackType> s_eacOutputs = new List<EacOutputTrackType> {
Expand Down Expand Up @@ -93,7 +92,6 @@ public EACDemuxer(string eacPath, string fileName, TaskProfile jobProfile)
{
JobSub.AddRange(jobProfile.SubtitleTracks);
}
extractVideo = jobProfile.ExtractVideo;
WorkingPathPrefix = jobProfile.WorkingPathPrefix;
}

Expand Down Expand Up @@ -339,7 +337,7 @@ public MediaFile Extract(Action<double, EACProgressType> progressCallback)
foreach (TrackInfo track in tracks)
{
EacOutputTrackType trackType = s_eacOutputs.Find(val => val.Codec == track.Codec);
if (!(trackType.Extract || trackType.Type == TrackType.Video && extractVideo))
if (!trackType.Extract)
{
continue;
};
Expand Down
10 changes: 1 addition & 9 deletions OKEGui/OKEGui/JobProcessor/Demuxer/TrackInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,7 @@ public string OutFileName
var directory = Path.GetDirectoryName(WorkingPathPrefix);
var baseName = Path.GetFileNameWithoutExtension(SourceFile);

if (Type == TrackType.Video)
{
return $"{Path.Combine(directory, baseName)}{FileExtension}";
}
else
{
return $"{Path.Combine(directory, baseName)}_{Index}{FileExtension}";
}

return $"{Path.Combine(directory, baseName)}_{Index}{FileExtension}";
}
}

Expand Down
1 change: 0 additions & 1 deletion OKEGui/OKEGui/OKEGui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Task\VideoService.cs" />
<Compile Include="Utils\RegistryStorage.cs" />
<Compile Include="Utils\SystemMenu.cs" />
<Compile Include="Utils\TChapterExtension.cs" />
Expand Down
1 change: 0 additions & 1 deletion OKEGui/OKEGui/Task/TaskProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class TaskProfile : ICloneable
public bool TimeCode;

//后续任务中填写的参数
public bool ExtractVideo;
public string VideoFormat;
public string AudioFormat;

Expand Down
61 changes: 0 additions & 61 deletions OKEGui/OKEGui/Task/VideoService.cs

This file was deleted.

2 changes: 1 addition & 1 deletion OKEGui/OKEGui/Utils/Cleaner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Cleaner
private const string TIME_FMT = "ddHHmm";

public Cleaner() : this(
new List<string> { "flac", "alac", "aac", "ac3", "dts", "sup", "Log.txt", "vpy", "qpf", ".264", "lwi", "rpc", "pyc" },
new List<string> { "flac", "alac", "aac", "ac3", "dts", "sup", "Log.txt", "vpy", "qpf", "lwi", "rpc", "pyc" },
new List<string> { "hevc", "mkv", "mp4", "mka", "h264" })
{
}
Expand Down
8 changes: 0 additions & 8 deletions OKEGui/OKEGui/Worker/ExecuteTaskService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ private void WorkerDoWork(object sender, DoWorkEventArgs e)
task.MkaOutFile = new MediaFile();

// 抽取音轨
profile.ExtractVideo = VideoService.ForceExtractVideo(task.InputFile);
FileInfo eacInfo = new FileInfo(Constants.eac3toWrapperPath);
MediaFile srcTracks = new EACDemuxer(eacInfo.FullName, task.InputFile, profile).Extract(
(double progress, EACProgressType type) =>
Expand Down Expand Up @@ -127,13 +126,6 @@ private void WorkerDoWork(object sender, DoWorkEventArgs e)
}
}

// 如果必须抽取视频轨道,这里需要修改输入的vpy文件
if (profile.ExtractVideo)
{
VideoService.ReplaceVpyInputFile(profile.InputScript, task.InputFile, srcTracks.VideoTrack.File.GetFullPath());
}


// 新建视频处理工作
VideoJob videoJob = new VideoJob(profile.VideoFormat);
videoJob.SetUpdate(task);
Expand Down

0 comments on commit 8d59ecd

Please sign in to comment.