ffmpeg -i input.mp4 ^
-c:v libx264 ^
-pix_fmt yuv420p ^
-profile:v high ^
-level 4.1 ^
-r 30 ^
-c:a aac ^
-b:a 192k ^
-movflags +faststart ^
output.mp4
ffmpeg -i input.mp4 ^
-c:v libx264 ^
-pix_fmt yuv420p ^
-profile:v high ^
-level 4.1 ^
-r 30 ^
-c:a aac ^
-b:a 192k ^
-movflags +faststart ^
output.mp4
agentcore import gateway \
--arn arn:aws:bedrock-agentcore:ap-northeast-1:123456789012:gateway/xxxxx
using Microsoft.Windows.AI;
using Microsoft.Windows.AI.Imaging;
using Microsoft.Graphics.Imaging;
using Windows.Graphics.Imaging;
using Windows.Storage;
using Windows.Storage.Streams;
static async Task<TextRecognizer> EnsureRecognizerAsync()
{
if (TextRecognizer.GetReadyState() == AIFeatureReadyState.NotReady)
{
var result = await TextRecognizer.EnsureReadyAsync();
if (result.Status != AIFeatureReadyResultState.Success)
{
throw new Exception(result.ExtendedError().Message);
}
}
return await TextRecognizer.CreateAsync();
}
static async Task<string> OcrImageAsync(string imagePath)
{
StorageFile file = await StorageFile.GetFileFromPathAsync(imagePath);
IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read);
BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream);
SoftwareBitmap bitmap = await decoder.GetSoftwareBitmapAsync();
ImageBuffer buffer = ImageBuffer.CreateBufferAttachedToBitmap(bitmap);
using TextRecognizer recognizer = await EnsureRecognizerAsync();
RecognizedText result = recognizer.RecognizeTextFromImage(buffer);
return string.Join(
Environment.NewLine,
result.Lines.Select(line => line.Text)
);
}
python .\ocr_pdf_v6.py `
".\input.pdf" `
".\output_ocr.pdf" `
--dpi 450
# 仮想環境を作成
py -m venv .venv
# 仮想環境を有効化
.\.venv\Scripts\activate
# pip更新
python -m pip install -U pip
# CPU版 PaddlePaddle
pip install paddlepaddle
# PaddleOCR、PDF操作、配列処理
pip install "paddleocr>=3.7.0" PyMuPDF numpy
cd C:\tools\ndlocr-lite\src
python ocr.py `
--sourcepdf "C:\pdf\input.pdf" `
--output "C:\ocr_out" `
--pdf-output "C:\ocr_out\input_ocr.pdf" `
--pdf-render-dpi 200