Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-30T06:41:17.647Z
Answers.Text: I have moved comments [to chat](http://chat.stackexchange.com/rooms/35058/discussion-on-answer-by-mulvya-output-format-and-quality-to-be-same-as-input) as it was getting too verbose.  The old chat is also [here](http://chat.stackexchange.com/rooms/35023/discussion-between-bigbrother2010-and-mulvya).
Answers.UserDisplayName: AJ Henderson
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-27T07:23:30.203Z
Answers.LastActivityDate: 2016-01-27T07:23:30.203Z
Answers.UserDisplayName: Gyan
Body: <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>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-27T05:14:14.897Z
Comments.Text: What are the different formats you have?
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-27T06:46:35.700Z
Comments.Text: .mpg and .mp4. What other data you need ? All are prepared for broadcasting, but some are made long time ago. Visually there is huge difference betwean old and new ones. I do not mind that as long as after i export them, their quality wont be lower then input. Will be broadcasted on cable TV.
Comments.UserDisplayName: Azz Kawa
Tags: <ffmpeg>
Title: Output format and quality to be same as input
UserDisplayName: Azz Kawa
ThreadText: # Output format and quality to be same as input
  
  (Asked by: username_0 on 2016-01-26)
  
  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 ?
  
  **Tags:** ffmpeg
  
  > **Comments:**
  > **username_1**: What are the different formats you have?  
  > **username_0**: .mpg and .mp4. What other data you need ? All are prepared for broadcasting, but some are made long time ago. Visually there is huge difference betwean old and new ones. I do not mind that as long as after i export them, their quality wont be lower then input. Will be broadcasted on cable TV.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-01-27. Score: 1 | Accepted answer
  
  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
  
  ```
  
  > **Comments:**
  > **username_2**: I have moved comments [to chat](http://chat.stackexchange.com/rooms/35058/discussion-on-answer-by-mulvya-output-format-and-quality-to-be-same-as-input) as it was getting too verbose.  The old chat is also [here](http://chat.stackexchange.com/rooms/35023/discussion-between-bigbrother2010-and-mulvya).  
  
  ---
  
  