Onnuiko
AV Dedicator (VIP)
หื่นมีศิลปะ
 
ออฟไลน์
กระทู้: 73
|
 |
« ตอบ #10 เมื่อ: มกราคม 31, 2025, 03:38:36 AM » |
|
ล่าสุดน่าจะดีสุดในบรรดาของฟรีแล้ว แต่ก็ห่วยแตกอยู่ดี ยอมเสียตังสามร้อยต่อเดือนคุ้มกว่า  สอบถามหน่อยครับ ใช้เว็บไหนหรอครับอยากลองดูบ้างครับ ] มันก็ใช้OpenAI Whisperเหมือนเดิมแต่มันรันผ่านเซิร์ฟของgoogle ซึ่งมันจะไวมากกว่าทำบนคอมที่สเปคการ์ดจอไม่แรง https://github.com/openai/whisperhttps://www.youtube.com/watch?v=wT34nynJYjYแต่AIของตัวเสียตังกระทู้บนผมว่ามันแปลแม่นกว่า
|
|
|
|
« แก้ไขครั้งสุดท้าย: มกราคม 31, 2025, 03:41:48 AM โดย Onnuiko »
|
บันทึกการเข้า
|
|
|
|
Onnuiko
AV Dedicator (VIP)
หื่นมีศิลปะ
 
ออฟไลน์
กระทู้: 73
|
 |
« ตอบ #11 เมื่อ: มกราคม 31, 2025, 12:16:17 PM » |
|
ลองดูกระทู้ผมนะครับ ทุกวันนี้ผมก็ยังใช้อยู่เรื่อยๆ ถ้าหนังใหม่ๆไม่มีคนแปลมันก็ตรงดีครับ แต่ไม่มาก อยู่ที่ว่านักแสดงพูดชัดเจนไหม และไม่ต้องมานั่งแก้ TF ด้วย หลังแปลก็ใช้ได้ทันที มันจะแยกออกมาให้ 2 ไฟล์ ไฟล์ซับต้นฉบับ กับ ซับภาษาที่เราเลือก https://www.avcollectors.com/board/index.php?topic=241256.0ได้ลองแล้วถือว่าใช้ได้เลยแปลได้เกิบเท่าOpenAI Whisper model ใหญ่สุด ข้อดีคือแปลไวสุดๆและไม่ต้องมาแปลงเป็นไทยอีกรอบมีให้ครบเลย แต่เสียดายอัพเดทล่าสุดแค่ปี23
|
|
|
|
|
บันทึกการเข้า
|
|
|
|
pictureuploadsex
AV Dedicator (VIP)
วุฒิสมาชิกเอวี
 
ออฟไลน์
กระทู้: 450
rejuvenation massage
|
 |
« ตอบ #12 เมื่อ: พฤษภาคม 31, 2026, 10:21:25 PM » |
|
!ls "/content/"
!ls "/content/drive/MyDrive/Colab Notebooks"
from google.colab import drive
drive.mount("/content/drive", force_remount=True)
from google.colab import files
files.download(output_subtitle)
subtitle_name = "untitled"
input_subtitle = f"/content/{subtitle_name}.srt"
output_subtitle = f"/content/{subtitle_name}_thai.srt"
|
|
|
|
« แก้ไขครั้งสุดท้าย: กรกฎาคม 14, 2026, 05:32:47 PM โดย pictureuploadsex »
|
บันทึกการเข้า
|
COLAB OPENROUTER ถอดซับ แปลซับ ฝังซับ แก้เซ็น ตรวจซับ จัดซับhttps://gofile.io/d/aOZt8Lแปล subtitle เป็น ภาษาไทยแปล ทุก คำ/ประโยค ห้าม แปล ข้าม คำ/ประโยคแปล text เท่านั้น ห้าม แก้ไข index/timestamp เด็ดขาดห้าม มี อักษร อังกฤษ/จีน/ญี่ปุ่น เด็ดขาดหมวดคำ สรรพนาม บุคคล 1 , 2 คำว่า "ฉัน" , "คุณ" เท่านั้นหมวดคำ อนุภาค ห้าม คำว่า "ครับ" , "คะ" , "ค่ะ" เด็ดขาดห้าม คำ/พยัญชนะ/สระ ซ้ำ ๆๆๆ ติด ๆๆๆ มากกว่า 5 ครั้ง อยู่ใน index เดียวกัน
|
|
|
pictureuploadsex
AV Dedicator (VIP)
วุฒิสมาชิกเอวี
 
ออฟไลน์
กระทู้: 450
rejuvenation massage
|
 |
« ตอบ #13 เมื่อ: มิถุนายน 01, 2026, 12:05:17 AM » |
|
TRANSLATE MODEL = "google/gemini-2.5-pro" BATCH_SIZE = 5000 "max_tokens": 200000 "thinking_budget": "0" timeout = 2000 แปล subtitle เป็น ภาษาไทย แปล ทุก คำ/ประโยค ห้าม แปล ข้าม คำ/ประโยค แปล text เท่านั้น ห้าม แก้ไข index/timestamp เด็ดขาด ห้าม มี อักษร อังกฤษ/จีน/ญี่ปุ่น เด็ดขาด หมวดคำ สรรพนาม บุคคล 1 , 2 คำว่า "ฉัน" , "คุณ" เท่านั้น หมวดคำ อนุภาค ห้าม คำว่า "ครับ" , "คะ" , "ค่ะ" เด็ดขาด ห้าม คำ/พยัญชนะ/สระ ซ้ำ ๆๆๆ ติด ๆๆๆ มากกว่า 5 ครั้ง อยู่ใน index เดียวกัน บรรทัด ยาวกว่า 25 อักษร ขึ้น บรรทัด ใหม่ อยู่ใน index เดียวกัน
|
|
|
|
« แก้ไขครั้งสุดท้าย: กรกฎาคม 15, 2026, 11:23:01 PM โดย pictureuploadsex »
|
บันทึกการเข้า
|
COLAB OPENROUTER ถอดซับ แปลซับ ฝังซับ แก้เซ็น ตรวจซับ จัดซับhttps://gofile.io/d/aOZt8Lแปล subtitle เป็น ภาษาไทยแปล ทุก คำ/ประโยค ห้าม แปล ข้าม คำ/ประโยคแปล text เท่านั้น ห้าม แก้ไข index/timestamp เด็ดขาดห้าม มี อักษร อังกฤษ/จีน/ญี่ปุ่น เด็ดขาดหมวดคำ สรรพนาม บุคคล 1 , 2 คำว่า "ฉัน" , "คุณ" เท่านั้นหมวดคำ อนุภาค ห้าม คำว่า "ครับ" , "คะ" , "ค่ะ" เด็ดขาดห้าม คำ/พยัญชนะ/สระ ซ้ำ ๆๆๆ ติด ๆๆๆ มากกว่า 5 ครั้ง อยู่ใน index เดียวกัน
|
|
|
pictureuploadsex
AV Dedicator (VIP)
วุฒิสมาชิกเอวี
 
ออฟไลน์
กระทู้: 450
rejuvenation massage
|
 |
« ตอบ #14 เมื่อ: มิถุนายน 24, 2026, 06:07:03 PM » |
|
ffmpeg -i untitled.mp4 -vn -ar 16000 -ac 1 untitled.flaci คือ inputvn คือ video nonear คือ audio rateac คือ audio channel.jpg)
|
|
|
|
« แก้ไขครั้งสุดท้าย: กรกฎาคม 12, 2026, 12:19:41 AM โดย pictureuploadsex »
|
บันทึกการเข้า
|
COLAB OPENROUTER ถอดซับ แปลซับ ฝังซับ แก้เซ็น ตรวจซับ จัดซับhttps://gofile.io/d/aOZt8Lแปล subtitle เป็น ภาษาไทยแปล ทุก คำ/ประโยค ห้าม แปล ข้าม คำ/ประโยคแปล text เท่านั้น ห้าม แก้ไข index/timestamp เด็ดขาดห้าม มี อักษร อังกฤษ/จีน/ญี่ปุ่น เด็ดขาดหมวดคำ สรรพนาม บุคคล 1 , 2 คำว่า "ฉัน" , "คุณ" เท่านั้นหมวดคำ อนุภาค ห้าม คำว่า "ครับ" , "คะ" , "ค่ะ" เด็ดขาดห้าม คำ/พยัญชนะ/สระ ซ้ำ ๆๆๆ ติด ๆๆๆ มากกว่า 5 ครั้ง อยู่ใน index เดียวกัน
|
|
|
pictureuploadsex
AV Dedicator (VIP)
วุฒิสมาชิกเอวี
 
ออฟไลน์
กระทู้: 450
rejuvenation massage
|
 |
« ตอบ #15 เมื่อ: มิถุนายน 24, 2026, 06:07:09 PM » |
|
|
|
|
|
« แก้ไขครั้งสุดท้าย: กรกฎาคม 13, 2026, 06:13:44 PM โดย pictureuploadsex »
|
บันทึกการเข้า
|
COLAB OPENROUTER ถอดซับ แปลซับ ฝังซับ แก้เซ็น ตรวจซับ จัดซับhttps://gofile.io/d/aOZt8Lแปล subtitle เป็น ภาษาไทยแปล ทุก คำ/ประโยค ห้าม แปล ข้าม คำ/ประโยคแปล text เท่านั้น ห้าม แก้ไข index/timestamp เด็ดขาดห้าม มี อักษร อังกฤษ/จีน/ญี่ปุ่น เด็ดขาดหมวดคำ สรรพนาม บุคคล 1 , 2 คำว่า "ฉัน" , "คุณ" เท่านั้นหมวดคำ อนุภาค ห้าม คำว่า "ครับ" , "คะ" , "ค่ะ" เด็ดขาดห้าม คำ/พยัญชนะ/สระ ซ้ำ ๆๆๆ ติด ๆๆๆ มากกว่า 5 ครั้ง อยู่ใน index เดียวกัน
|
|
|
pictureuploadsex
AV Dedicator (VIP)
วุฒิสมาชิกเอวี
 
ออฟไลน์
กระทู้: 450
rejuvenation massage
|
 |
« ตอบ #16 เมื่อ: มิถุนายน 24, 2026, 06:07:15 PM » |
|
|
|
|
|
« แก้ไขครั้งสุดท้าย: กรกฎาคม 13, 2026, 06:14:39 PM โดย pictureuploadsex »
|
บันทึกการเข้า
|
COLAB OPENROUTER ถอดซับ แปลซับ ฝังซับ แก้เซ็น ตรวจซับ จัดซับhttps://gofile.io/d/aOZt8Lแปล subtitle เป็น ภาษาไทยแปล ทุก คำ/ประโยค ห้าม แปล ข้าม คำ/ประโยคแปล text เท่านั้น ห้าม แก้ไข index/timestamp เด็ดขาดห้าม มี อักษร อังกฤษ/จีน/ญี่ปุ่น เด็ดขาดหมวดคำ สรรพนาม บุคคล 1 , 2 คำว่า "ฉัน" , "คุณ" เท่านั้นหมวดคำ อนุภาค ห้าม คำว่า "ครับ" , "คะ" , "ค่ะ" เด็ดขาดห้าม คำ/พยัญชนะ/สระ ซ้ำ ๆๆๆ ติด ๆๆๆ มากกว่า 5 ครั้ง อยู่ใน index เดียวกัน
|
|
|
pictureuploadsex
AV Dedicator (VIP)
วุฒิสมาชิกเอวี
 
ออฟไลน์
กระทู้: 450
rejuvenation massage
|
 |
« ตอบ #17 เมื่อ: มิถุนายน 24, 2026, 06:07:21 PM » |
|
ถอดซับ ### เซลล์ 1 ###!nvidia-smi### เซลล์ 2 ###!pip install faster-whisper -q### เซลล์ 3 ###import os
from faster_whisper import WhisperModel### เซลล์ 4 ###from google.colab import drive
drive.mount("/content/drive", force_remount=True)### เซลล์ 5 ###input_audio = "/content/drive/MyDrive/Colab Notebooks/untitled.flac"
output_subtitle = os.path.splitext(input_audio)[0] + ".srt"### เซลล์ 6 ###print("Loading model...")
model = WhisperModel( "large-v3", device="cuda", compute_type="float16" )
print("Start transcribing...")
segments, info = model.transcribe( input_audio, language="ja", condition_on_previous_text=False, temperature=0, hallucination_silence_threshold=0.1, word_timestamps=True, beam_size=1 )
print("Writing srt...")
def fmt(t):
h = int(t // 3600) m = int((t % 3600) // 60) s = int(t % 60) ms = int((t - int(t)) * 1000)
return f"{h:02}:{m:02}:{s:02},{ms:03}"
with open(output_subtitle, "w", encoding="utf-8") as f:
i = 1
for segment in segments:
if segment.words: first_word = segment.words[0] last_word = segment.words[-1] start = first_word.start end = last_word.end else: start = segment.start end = segment.end
text = segment.text.strip()
if not text: continue
f.write(f"{i}\n") f.write(f"{fmt(start)} --> {fmt(end)}\n") f.write(f"{text}\n\n")
print( f"[{i}] " f"{fmt(start)} --> " f"{fmt(end)} " f"{text}" )
i += 1
print("Saved:", output_subtitle)### เซลล์ 7 ###from google.colab import files
files.download(output_subtitle).jpg) .jpg) .jpg) .jpg) .jpg) .jpg)
|
|
|
|
« แก้ไขครั้งสุดท้าย: กรกฎาคม 13, 2026, 10:37:37 PM โดย pictureuploadsex »
|
บันทึกการเข้า
|
COLAB OPENROUTER ถอดซับ แปลซับ ฝังซับ แก้เซ็น ตรวจซับ จัดซับhttps://gofile.io/d/aOZt8Lแปล subtitle เป็น ภาษาไทยแปล ทุก คำ/ประโยค ห้าม แปล ข้าม คำ/ประโยคแปล text เท่านั้น ห้าม แก้ไข index/timestamp เด็ดขาดห้าม มี อักษร อังกฤษ/จีน/ญี่ปุ่น เด็ดขาดหมวดคำ สรรพนาม บุคคล 1 , 2 คำว่า "ฉัน" , "คุณ" เท่านั้นหมวดคำ อนุภาค ห้าม คำว่า "ครับ" , "คะ" , "ค่ะ" เด็ดขาดห้าม คำ/พยัญชนะ/สระ ซ้ำ ๆๆๆ ติด ๆๆๆ มากกว่า 5 ครั้ง อยู่ใน index เดียวกัน
|
|
|
pictureuploadsex
AV Dedicator (VIP)
วุฒิสมาชิกเอวี
 
ออฟไลน์
กระทู้: 450
rejuvenation massage
|
 |
« ตอบ #18 เมื่อ: มิถุนายน 24, 2026, 06:20:24 PM » |
|
แปลซับ ### เซลล์ 1 ###!pip install requests -q### เซลล์ 2 ###import os import re
import requests
from textwrap import dedent### เซลล์ 3 ###from google.colab import drive
drive.mount("/content/drive", force_remount=True)### เซลล์ 4 ###input_subtitle = "/content/drive/MyDrive/Colab Notebooks/untitled.srt"
output_subtitle = os.path.splitext(input_subtitle)[0] + "_thai.srt"### เซลล์ 5 ###OPENROUTER_API_KEY = "YOUR_API_KEY"
MODEL = "google/gemini-3.1-flash-lite"
BATCH_SIZE = 50### เซลล์ 6 ###with open(input_subtitle, "r", encoding="utf-8") as f: srt_text = f.read()
blocks = re.split(r"\n\s*\n", srt_text.strip()) subs = []
for block in blocks:
lines = block.splitlines()
if len(lines) < 3: continue
subs.append({ "index": lines[0].strip(), "timestamp": lines[1].strip(), "text": " ".join(line.strip() for line in lines[2:]) })
print("Loaded:", len(subs), "blocks")### เซลล์ 7 ###translated_texts = {}
for start in range(0, len(subs), BATCH_SIZE):
batch = subs[start:start + BATCH_SIZE]
source_text = "\n".join( f"[{item['index']}] {item['text']}" for item in batch )
prompt = dedent(f"""
แปล subtitle เป็น ภาษาไทย
แปล ทุก คำ/ประโยค ห้าม แปล ข้าม คำ/ประโยค
แปล text เท่านั้น ห้าม แก้ไข index/timestamp เด็ดขาด
ห้าม มี อักษร อังกฤษ/จีน/ญี่ปุ่น เด็ดขาด
หมวดคำ สรรพนาม บุคคล 1 , 2 คำว่า "ฉัน" , "คุณ" เท่านั้น
หมวดคำ อนุภาค ห้าม คำว่า "ครับ" , "คะ" , "ค่ะ" เด็ดขาด
ห้าม คำ/พยัญชนะ/สระ ซ้ำ ๆๆๆ ติด ๆๆๆ มากกว่า 5 ครั้ง อยู่ใน index เดียวกัน
{source_text}
""")
response = requests.post( "https://openrouter.ai/api/v1/chat/completions", headers={ "Authorization": f"Bearer {OPENROUTER_API_KEY}", "Content-Type": "application/json", }, json={ "model": MODEL, "messages": [{"role": "user", "content": prompt}], "temperature": 0, "max_tokens": 5000, "thinking_budget": "0" }, timeout=50, )
response.raise_for_status() result = response.json()
choice = result["choices"][0] raw_content = choice["message"]["content"].strip()
match = re.findall(r"\[(\d+)\]\s*(.*?)(?=\[\d+\]|\Z)", raw_content, re.S)
expected_count = len(batch) found_count = len(match)
for index, text in match: translated_texts[index] = text.strip()
batch_start, batch_end = start + 1, min(start + BATCH_SIZE, len(subs))
usage = result.get("usage", {}) details = usage.get("completion_tokens_details", {}) reasoning_tokens = details.get("reasoning_tokens", 0)
print()
print(f"HTTP status: {response.status_code} {response.reason}") print(f"Model: {result.get('model')}") print(f"Provider: {result.get('provider')}") print(f"Prompt tokens: {usage.get('prompt_tokens', 0)}") print(f"Completion tokens: {usage.get('completion_tokens', 0)}") print(f"Reasoning tokens: {reasoning_tokens}") print(f"Finish reason: {choice.get('finish_reason')}") print(f"Native finish reason: {choice.get('native_finish_reason')}") print(f"Expected: {expected_count}, Found: {found_count}") print(f"Done: {batch_start}-{batch_end}")
print()
print(f"Raw response: {repr(raw_content)}")
print()### เซลล์ 8 ###output = []
for item in subs: output.append(item["index"]) output.append(item["timestamp"]) output.append(translated_texts.get(item["index"], item["text"])) output.append("")
with open(output_subtitle, "w", encoding="utf-8") as f: f.write("\n".join(output))
print("Saved:", output_subtitle)### เซลล์ 9 ###from google.colab import files
files.download(output_subtitle).jpg) .jpg) .jpg) .jpg) .jpg) .jpg)
|
|
|
|
« แก้ไขครั้งสุดท้าย: กรกฎาคม 13, 2026, 10:37:05 PM โดย pictureuploadsex »
|
บันทึกการเข้า
|
COLAB OPENROUTER ถอดซับ แปลซับ ฝังซับ แก้เซ็น ตรวจซับ จัดซับhttps://gofile.io/d/aOZt8Lแปล subtitle เป็น ภาษาไทยแปล ทุก คำ/ประโยค ห้าม แปล ข้าม คำ/ประโยคแปล text เท่านั้น ห้าม แก้ไข index/timestamp เด็ดขาดห้าม มี อักษร อังกฤษ/จีน/ญี่ปุ่น เด็ดขาดหมวดคำ สรรพนาม บุคคล 1 , 2 คำว่า "ฉัน" , "คุณ" เท่านั้นหมวดคำ อนุภาค ห้าม คำว่า "ครับ" , "คะ" , "ค่ะ" เด็ดขาดห้าม คำ/พยัญชนะ/สระ ซ้ำ ๆๆๆ ติด ๆๆๆ มากกว่า 5 ครั้ง อยู่ใน index เดียวกัน
|
|
|
pictureuploadsex
AV Dedicator (VIP)
วุฒิสมาชิกเอวี
 
ออฟไลน์
กระทู้: 450
rejuvenation massage
|
 |
« ตอบ #19 เมื่อ: มิถุนายน 24, 2026, 06:21:16 PM » |
|
ฝังซับ ### เซลล์ 1 ###!nvidia-smi### เซลล์ 2 ###!pip install pysubs2 -q
!wget https://raw.githubusercontent.com/google/fonts/main/ofl/prompt/Prompt-Regular.ttf -q \ -O /usr/share/fonts/truetype/Prompt-Regular.ttf
!fc-cache -fv### เซลล์ 3 ###import pysubs2### เซลล์ 4 ###from google.colab import drive
drive.mount("/content/drive", force_remount=True)### เซลล์ 5 ###video_name = "untitled"
input_video = f"/content/drive/MyDrive/Colab Notebooks/{video_name}.mp4"
input_subtitle = f"/content/drive/MyDrive/Colab Notebooks/{video_name}_thai.srt"
output_video = f"/content/drive/MyDrive/Colab Notebooks/{video_name}_hardsub.mp4"### เซลล์ 6 ###pysubs2_subtitle = pysubs2.load(input_subtitle, encoding="utf-8")
for line in pysubs2_subtitle: line.style = "Default"
pysubs2_subtitle.styles["Default"].fontname = "Prompt" pysubs2_subtitle.styles["Default"].fontsize = 25 pysubs2_subtitle.styles["Default"].outline = 1 pysubs2_subtitle.styles["Default"].shadow = 0
with open(f"/content/{video_name}_temp.ass", "w", encoding="utf-8") as f: f.write(pysubs2_subtitle.to_string(format_="ass"))### เซลล์ 7 ###!ffmpeg -stats \ -hwaccel cuda \ -i "{input_video}" \ -vf "ass=/content/{video_name}_temp.ass" \ -c:v h264_nvenc \ -preset p1 \ -rc vbr \ -cq 25 \ -b:v 0 \ -c:a copy \ -movflags +faststart \ "{output_video}" \ -y### เซลล์ 8 ###from google.colab import files
files.download(output_video).jpg) .jpg) .jpg) .jpg) .jpg) .jpg)
|
|
|
|
« แก้ไขครั้งสุดท้าย: กรกฎาคม 13, 2026, 10:35:39 PM โดย pictureuploadsex »
|
บันทึกการเข้า
|
COLAB OPENROUTER ถอดซับ แปลซับ ฝังซับ แก้เซ็น ตรวจซับ จัดซับhttps://gofile.io/d/aOZt8Lแปล subtitle เป็น ภาษาไทยแปล ทุก คำ/ประโยค ห้าม แปล ข้าม คำ/ประโยคแปล text เท่านั้น ห้าม แก้ไข index/timestamp เด็ดขาดห้าม มี อักษร อังกฤษ/จีน/ญี่ปุ่น เด็ดขาดหมวดคำ สรรพนาม บุคคล 1 , 2 คำว่า "ฉัน" , "คุณ" เท่านั้นหมวดคำ อนุภาค ห้าม คำว่า "ครับ" , "คะ" , "ค่ะ" เด็ดขาดห้าม คำ/พยัญชนะ/สระ ซ้ำ ๆๆๆ ติด ๆๆๆ มากกว่า 5 ครั้ง อยู่ใน index เดียวกัน
|
|
|
|