10

I am using ffmpeg to convert mp4 video from youtube. The video is HD 1080. When I convert it to mpeg2video, the video loses its sharpness, regardless of the -s 1920x1080 parameter. How can I convert the video without losing picture sharpness? The command I use is:

ffmpeg -i BBB.mp4 -vcodec mpeg2video -s1920x1080 -acodec copy -f mpegts BBB.ts

Daniel Mošmondor
  • 19,718
  • 12
  • 58
  • 99
Srh
  • 109
  • 1
  • 1
  • 3

3 Answers3

9

The best way to make sure your images are the same quality as they are before conversion, add -q:v 1. q is quality, v is for video, 1 is for the quality between 1-35, the lowest being the best quality.

That would make your new command as follows:

ffmpeg -i BBB.mp4 -vcodec mpeg2video -s 1920x1080 -q:v 1 -acodec copy -f mpegts BBB.ts
MikeSchinkel
  • 4,947
  • 4
  • 38
  • 46
jrkt
  • 2,615
  • 5
  • 28
  • 48
3

Or try setting whatever bitrate you find acceptable:

ffmpeg -i BBB.mp4 -vcodec mpeg2video -b 4000000 -s 1920x1080 -acodec copy -f mpegts BBB.ts

mp4->mpeg2 = transcoding

ACz
  • 31
  • 1
1

Use the -sameq tag for the final video to follow the same quality of the source.

Example:

ffmpeg -i BBB.mp4 -vcodec mpeg2video -s 1920x1080 **-sameq** -acodec copy -f mpegts BBB.ts
MatejMecka
  • 1,448
  • 2
  • 24
  • 37
  • It seems that -sameq will transcode the file nevertheless. You'll know if your CPU usage will be 100% during the process. – Daniel Mošmondor Jul 01 '11 at 13:02
  • 10
    -sameq means "same quantizer", not same quality. From [FFMPEG](http://ffmpeg.org/trac/ffmpeg/wiki/Option%20'-sameq'%20does%20NOT%20mean%20'same%20quality') – Intellectual Juggernaut Dec 28 '12 at 17:51
  • 7
    Current ffmpeg 2.1.3 complains about `-sameq`: Option 'sameq' was removed. If you are looking for an option to preserve the quality (which is not what -sameq was for), use -qscale 0 or an equivalent quality factor option. – Olaf Dietsche Feb 18 '14 at 11:42
  • 1
    sameq is no more available and it NEVER meant same quality – rohan koshti Jun 25 '20 at 09:09
  • Madness to convert a video from mp4 to ts -- the only way to preserve picture quality is to retain it in mp4 format (the ts format is inferior to mp4 in my experience), or to covert from mp4 to mkv which has an improved quality compared to mp4. – Ed999 Sep 27 '20 at 22:48