Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
462 views
in Technique[技术] by (71.8m points)

FFmpeg Commands to add text watermark to mpg2,mss,lxf,3g2 video files

I am using following command to add watermark on a video file:

ffmpeg -i input.mpg2 -vf "drawtext=text='Hello World':x=(w-text_w)/2:y=(h-text_h)/2:fontsize=24:fontcolor=white" TextOutput.mpg2

Error with mpg2 input file:

Input #0, mpeg, from 'mpg2.mpg2':
Duration: 00:02:27.07, start:0.213367, bitrate: 4419 kb/s Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, bt470bg/bt470m/bt4 70m, bottom first), 704x480 [SAR 1:1 DAR 22:15], 29.97 fps, 29.97 tbr, 90k tbn,59.94 tbc Side data: cpb: bitrate max/min/avg: 6000000/0/0 buffer size: 1835008 vbv_delay: N/A Stream #0:1[0x1c0]: Audio: mp2, 44100 Hz, stereo, s16p, 224 kb/s [NULL @ 000000bd67d2b3c0] Unable to find a suitable output format for 'Output.mp g2' Output.mpg2: Invalid argument

Similar error occurs with mss, lxf and 3g2 video files. How can I add watermark to these video file formats?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

FFmpeg does not support these arbitrary extensions/formats. Instead, use:

Unsupported Supported equivalent
.mpg2 -c:v mpeg2video output.mpg
.mss .wmv
.lxf Not supported (or use .mpg)
.3g2 This is supported but is constrained to certain parameters. See below.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...