> ## Documentation Index
> Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Phiên âm video

> Cung cấp bản phiên âm và tiêu đề của một tệp video bằng AI

export const HeaderAPI = ({noProfileKey, profileKeyRequired}) => <>
    <ParamField header="Authorization" type="string" required>
      <a href="/apis/overview#authorization">API Key</a> of the Primary Profile.
      <br />
      <br />
      Format: <code>Authorization: Bearer API_KEY</code>
    </ParamField>
    {!noProfileKey && (profileKeyRequired ? <ParamField header="Profile-Key" type="string" required>
          <a href="/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField> : <ParamField header="Profile-Key" type="string">
          <a href="/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField>)}
  </>;

export const PlansAvailable = ({plans = [], maxPackRequired}) => {
  let displayPlans = plans;
  if (plans && plans.length === 1) {
    const lowerCasePlan = plans[0].toLowerCase();
    if (lowerCasePlan === "business") {
      displayPlans = ["Launch", "Business", "Enterprise"];
    } else if (lowerCasePlan === "premium") {
      displayPlans = ["Premium", "Launch", "Business", "Enterprise"];
    }
  }
  return <Note>
Available on {displayPlans.length === 1 ? "the " : ""}
{displayPlans.join(", ").replace(/\b\w/g, l => l.toUpperCase())}{" "}
{displayPlans.length > 1 ? "plans" : "plan"}.

{maxPackRequired && <span onClick={() => window.open('https://www.ayrshare.com/docs/additional/maxpack', '_self')} className="flex items-center mt-2 cursor-pointer">
 <span className="px-1.5 py-0.5 rounded text-sm" style={{
    backgroundColor: '#C264B6',
    color: 'white',
    fontSize: '12px'
  }}>
   Max Pack required
 </span>
</span>}
</Note>;
};

<PlansAvailable plans={["premium"]} maxPackRequired={true} />

Tạo bản phiên âm và tiêu đề của một tệp video bằng AI.
Bản phiên âm này sau đó có thể được sử dụng trong [/generate/post](/apis/generate/post-text) để tạo bản tóm tắt video trên mạng xã hội.
Đối với [YouTube](/apis/post/social-networks/youtube), vốn yêu cầu tiêu đề, tiêu đề được tạo tự động có thể được sử dụng.

<Warning>
  Video phải được tải lên Ayrshare trước đó bằng [/media](/apis/media/overview).
  Các video không được lưu trữ bởi Ayrshare sẽ bị từ chối.

  Kích thước tệp video tối đa là 500GB và thời lượng tối đa là 10 phút.
</Warning>

### Hướng dẫn phiên âm video

<div class="video-container">
  <iframe width="380" height="200" src="https://www.youtube.com/embed/d1JBbHrxmls" title="Transcribe a Video" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />
</div>

## Header Parameters

<HeaderAPI noProfileKey />

## Body Parameters

<ParamField body="videoUrl" type="string" required>
  URL của video đã được mã hóa URL. Video phải được lưu trữ bởi Ayrshare.
</ParamField>

<RequestExample>
  ```bash cURL theme={"system"}
  curl \
  -H "Authorization: Bearer API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"videoUrl": "https://img.ayrshare.com/random/landscape5.mp4"}' \
  -X POST https://api.ayrshare.com/api/generate/transcription
  ```

  ```javascript JavaScript theme={"system"}
  const API_KEY = "API_KEY";

  fetch("https://api.ayrshare.com/api/generate/transcription", {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          "Authorization": `Bearer ${API_KEY}`
        },
        body: JSON.stringify({
          videoUrl: "https://img.ayrshare.com/random/landscape5.mp4", // required
        }),
      })
        .then((res) => res.json())
        .then((json) => console.log(json))
        .catch(console.error);
  ```

  ```python Python theme={"system"}
  import requests

  payload = {'videoUrl': 'https://img.ayrshare.com/random/landscape5.mp4'}
  headers = {'Content-Type': 'application/json',
          'Authorization': 'Bearer API_KEY'}

  r = requests.post('https://api.ayrshare.com/api/generate/transcription',
      json=payload,
      headers=headers)

  print(r.json())
  ```

  ```php PHP theme={"system"}
  <?php

  $curl = curl_init();
  $data = array (
    "videoUrl" => "https://img.ayrshare.com/random/landscape5.mp4"
  );

  curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://api.ayrshare.com/api/generate/transcription',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => http_build_query($data),
    CURLOPT_HTTPHEADER => array(
      'Authorization: Bearer API_KEY',
      'Accept-Encoding: gzip'
    ),
  ));

  $response = curl_exec($curl);
  curl_close($curl);
  echo $response;
  ```
</RequestExample>

<ResponseExample>
  ```json 200: Success theme={"system"}
  {
      "status": "success",
      "transcript": "This is your last chance. After this, there is no turning back. You take the blue pill the story ends you wake up in your bed and believe whatever you want to be. You take the red pill you stay in Wonderland. And I show you how deep the rabbit hole goes.",
      "transcriptArray": [
          "This is your last chance.",
          "After this, there is no turning back.",
          "You take the blue pill the story ends you wake up in your bed and believe whatever you want to be. You take the red pill you stay in Wonderland.",
          "And I show you how deep the rabbit hole goes."
      ],
      "videoTitle": "Choose Wisely: Blue Pill or Red Pill Adventure Awaits!",
      "wordCount": 52
  }
  ```
</ResponseExample>
