user10560: Have many videos different videos of different format and quality in which i need to add small amount of text.
What command should i use to get same file format/quality for output as it was for input ?

user1871: Since these are for broadcast play-out over local storage, these commands are biased towards quality and away from filesize.
For MP4s:
ffmpeg -i input.mp4 -vf "text filters here" -c:v libx264 -crf 8 -c:a copy -map 0 -movflags +faststart output.mp4

For MPGs:
ffmpeg -i input.mpg -vf "text filters here" -c:v mpeg2video -q:v 2 -c:a copy -map 0 output.mpg


10560: <p>Have many videos different videos of different format and quality in which i need to add small amount of text.</p>

<p>What command should i use to get same file format/quality for output as it was for input ?</p>
 1871: <p>Since these are for broadcast play-out over local storage, these commands are biased towards quality and away from filesize.</p>

<p>For MP4s:</p>

<pre><code>ffmpeg -i input.mp4 -vf "text filters here" -c:v libx264 -crf 8 -c:a copy -map 0 -movflags +faststart output.mp4
</code></pre>

<p>For MPGs:</p>

<pre><code>ffmpeg -i input.mpg -vf "text filters here" -c:v mpeg2video -q:v 2 -c:a copy -map 0 output.mpg
</code></pre>
