Files
video-v1/vav2/notes/todo.txt
2025-10-12 02:04:54 +09:00

75 lines
3.6 KiB
Plaintext

1. Root Signature: YUV 텍스처를 셰이더에 바인딩하는 구조 없음
2. Pipeline State: YUV→RGB 변환 셰이더가 컴파일되지 않음
3. 실제 셰이더: Vertex/Pixel 셰이더가 생성되지 않음
● 프레임 버퍼 관리 시스템을 설계하겠습니다:
● 현재 구조를 분석했습니다. 현재는 동기적이고 단순한 구조입니다:
현재 구조의 문제점
1. 전체 파일을 메모리에 로드 (File.ReadAllBytesAsync) - 대용량 파일 문제
2. 동기적 디코딩/렌더링 - UI 스레드 블로킹
3. 버퍼링 없음 - 프레임별로 즉시 처리
4. 타이밍 제어 부족 - 단순한 Task.Delay
완전한 비디오 파이프라인을 설계하고 구현하겠습니다:
❌ 아직 구현되지 않은 부분:
1. 코덱별 디코더 선택: 현재는 VideoPlayer 생성자에서 하드코딩된 Dav1dDecoder만 사용합니다:
public VideoPlayer(Dav1dDecoder decoder, SimpleStubRenderer renderer)
{
_decoder = decoder ?? throw new ArgumentNullException(nameof(decoder));
2. 코덱 감지: 파일 내부의 실제 코덱 정보를 확인하여 적절한 디코더를 선택하는 로직이 없습니다.
개선이 필요한 구조:
VideoPlayer가 진정으로 유연한 구조가 되려면 다음과 같이 개선해야 합니다:
1. 코덱 팩토리 패턴: 감지된 코덱에 따라 적절한 디코더를 생성
2. 디코더 인터페이스: 다양한 디코더들을 통일된 인터페이스로 관리
3. 런타임 디코더 선택: 파일 로드 시점에 코덱을 감지하고 해당하는 디코더를 동적으로 생성
현재는 AV1 전용 구조이지만, 진정한 멀티코덱 지원을 위해서는 이러한 개선이 필요합니다.
However, there's a critical design issue in MainWindow.xaml.cs:95-157 that causes the playback failure:
The Problem: Dual Video Pipeline Implementation
The MainWindow class has two different video playback implementations:
1. New Architecture (lines 95-157): Uses the complete video pipeline with VideoPlayer, VideoFileReader, and
WpfVideoRenderer
2. Legacy Architecture (lines 179-358): Uses the old direct approach with manual file reading and simple frame
timing
The PlayButton_Click method at MainWindow.xaml.cs:95 calls _videoPlayer.LoadVideoAsync() and
_videoPlayer.PlayAsync(), but there's a disconnect because:
1. The new VideoPlayer class expects the video pipelines to work together
2. The VideoFileReader tries to create streaming parsers that read entire files into memory for parsing headers
3. The buffer filling logic waits for 10 frames but the decoding pipeline may not be producing frames correctly
Specific Issues Found:
1. VideoFileReader.cs:214-216: The streaming MP4 parser reads the entire file into memory, defeating the purpose
of streaming
2. VideoFileReader.cs:327-329: Same issue with Matroska parser
3. VideoPlayer.cs:107-112: The buffer fill logic has a 5-second timeout that may be insufficient for large files
4. Missing Error Handling: If the decoder pipeline fails to start, the error isn't properly propagated
The application successfully launches and the architecture is sound, but the playback failure occurs because the
streaming parsers aren't truly streaming - they load entire files, which can cause memory issues or timeouts with
large AV1 video files.
To fix this, the streaming parsers need to be refactored to parse only the metadata/headers without loading the
entire file content, and the error handling in the video pipeline needs improvement to better identify where the
failure occurs.