0

I'm currently encoding my dvd collection for convenience.

Before encoding this particular title of DVD, I've made some samples and when playing them at TV I noticed that upscaled (with ffmpeg) videos looks better than the original VOB (upscaled by TV).

I assume it's because the media player of the TV applies less efficient scaling compared to ffmpeg's scale filter.

I don't know if it will be always the case, so I decided to keep the original scale for now.

Maybe in the future I'll end up scaling the encoded (x264, mp4) video, am I losing quality doing this? Should I apply the scale filter while encoding the VOB to MP4 or scaling the MP4 will give the same quality?

While watching the samples I didn't saw any diference but maybe I missing something since comparing videos is very difficult.

  • What's your encoding settings? – Gyan Mar 11 '17 at 6:43
  • I'm using the veryslow preset with two passes: ffmpeg -i input.vob -vcodec libx264 -pass 2 -preset veryslow -threads 0 -b:v 900k -acodec copy out.mp4 . To scale with ffmpeg I use -vf "scale=-1:720, crop=1280:720" when the source is not 16:9, which is the case. – iznav Mar 11 '17 at 11:36
  • I would avoid scaling the encoded video. Your bitrate is on the lower side for 720p content. – Gyan Mar 11 '17 at 11:51
  • @Mulvya Supose I increase it to something like 3000k, as long as I stick to a satisfatory range, it's ok to scale after the encoding? – iznav Mar 11 '17 at 12:22
0

Maybe in the future I'll end up scaling the encoded (x264, mp4) video, am I losing quality doing this?

Scaling is a destructive operation that changes the video bitstream. When you apply a scale filter, you have no other choice than to re-encode your video. When re-encoding, you can of course compress your video losslessly to retain quality, but typically, you will use a lossy encoder (like x264 or x265) to save space and to ensure compatibility with different playback devices (not all TVs will handle lossless video).

If you decide to scale later, you will basically compress an already compressed video twice, that is:

  1. Original VOB (already encoded to fit DVD)
  2. Encode with libx264
  3. Scale and re-encode with libx264

So you need to make sure that the output of step two is good enough to "survive" another compression step later.

Should I apply the scale filter while encoding the VOB to MP4 or scaling the MP4 will give the same quality?

You have two options:

  1. Scale your videos while you're re-encoding them from the original VOBs. This will save time and you avoid another encoding step. Make sure that for your two-pass encoding, you choose a proper bitrate for the output. For example, when scaling to 1080p or 720p, choose bitrates around 8–10 MBit/s or 3–5 MBit/s, respectively.

  2. Scale your videos later. Here, you may lose quality due to generation loss, since you're encoding twice. If that is your plan, make sure that – at least for the first encoding step – you choose a high enough bitrate or low enough constant quality factor for the output. For example, your first (unscaled) encoding process (from VOB to MP4) could use a one-pass setting with -crf 16. This ensures an almost visually lossless output.

  • In the second scenario I would not re-encode the video but rather copy the streams while applying the scale filter. Even if I don't scale the source video, If I am to watch this video on any device that supports higher resolution, It will be scaled. By using something like ffmpeg -i source -c copy -vf scale=-1:720 out.mp4 I'm just making sure the scale filter used is the ffmpeg one, Is that right? – iznav Mar 14 '17 at 11:53
  • You cannot copy the video stream and scale at the same time. As I wrote above, scaling is a destructive operation that requires changing the bitstream. Your command is not valid, and you should get an error message: "Filtergraph 'scale=-1:720' was defined for video output stream 0:0 but codec copy was selected. Filtering and streamcopy cannot be used together." – slhck Mar 14 '17 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.