Convert Mp4 To 3g2
Request reference for convert-mp4-to-3g2.
Feature identity
These properties are constants for this feature. The server fills them in automatically; callers cannot override them.
| property | const value |
|---|---|
process | CONVERT |
fromMedia | VIDEO |
toMedia | VIDEO |
fromExtension | MP4 |
Example request
curl
Shell
# Replace file_REPLACE_ME with the fileId returned by
# POST /v1/public/uploads + /uploads/<id>/complete.
curl -X POST 'https://api.xconvert.com/v1/public/jobs' \
-H 'Authorization: Bearer $XCONVERT_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"featureId": "convert-mp4-to-3g2",
"fileIds": [
"file_REPLACE_ME"
],
"fromType": "mp4",
"toType": "3g2",
"processType": "convert"
}'TypeScript (@xconvert/sdk)
TypeScript
// npm install @xconvert/sdk
import { Xconvert } from '@xconvert/sdk/v1';
const xc = new Xconvert({ apiKey: process.env.XCONVERT_API_KEY! });
// 1. Upload the input file (see /docs/sdks/typescript for the full snippet).
// 2. Submit the conversion job:
const job = await xc.submitJob({
featureId: 'convert-mp4-to-3g2',
fileIds: [uploadedFileId],
fromType: 'mp4',
toType: '3g2',
processType: 'convert',
options: {}, // server applies feature baselines + defaults
});
// 3. Wait for it to finish:
const final = await xc.pollUntilDone(job.id);
console.log(final.outputs?.[0]?.downloadUrl);Python (xconvert)
Python
# pip install xconvert
import os
from xconvert.v1 import Xconvert, ClientOptions
from xconvert.v1.generated.models.create_job_request import CreateJobRequest
xc = Xconvert(ClientOptions(api_key=os.environ["XCONVERT_API_KEY"]))
# 1. Upload the input file (see /docs/sdks/python for the full snippet).
# 2. Submit the conversion job:
job = xc.submit_job(CreateJobRequest(
feature_id="convert-mp4-to-3g2",
file_ids=[uploaded_file_id],
from_type="mp4",
to_type="3g2",
process_type="convert",
))
# 3. Wait for it to finish:
final = xc.poll_until_done(job.id)
print(final.outputs[0].download_url)