VideoHelp Forum
+ Reply to Thread
Results 1 to 12 of 12
Thread
  1. Member
    Join Date
    Mar 2022
    Location
    Les Sables D'Olonne, France
    Search Comp PM
    Good evening to all.
    I have several videos in H264 or H264 in 1080p resolution, I want to convert them to Av1 in 720p resolution without visible quality loss.
    To convert these H264 and H265 codecs to Av1 keeping the same resolution, I use the following commands:
    Code:
    ffmpeg -i video.mkv -map 0:v:0 -pix_fmt yuv420p10le -f yuv4mpegpipe -strict -1 - | SvtAv1EncApp -i stdin --preset 6 --keyint 240 --input-depth 10 --crf 30 --rc 0 --passes 1 --film-grain 0 -b av1.ivf
    ffmpeg -i av1.ivf -i video.mkv -map 0:v -map 1:a:0 -c:v copy -c:a copy video.av1.mkv
    If someone has an idea?
    Thanks.
    Ignace.
    Quote Quote  
  2. First of all, 1080p to 720p will result in visual quality loss. Second, encoding with any lossy codec, at any bitrate will result in some quality loss -- maybe not too visible if you if you use enough bitrate. Third, AV1 is interminably slow and it's benefits really only show up at 1080p and above. Fourth, libsvtav1 is included in ffmpeg now so there may be no reason to pipe to an external encoder.

    https://www.ffmpeg.org/ffmpeg-all.html#libsvtav1

    It doesn't support a lot of options so maybe that's why you're piping.

    In the end, unless this is just some experiment, I think you're wasting your time and ruining your videos.
    Quote Quote  
  3. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    You can't encode them to a lower resolution without quality lose,if your gonna stick to a 1080p resolution and never upgrade then try your encodes and see if you notice any quality lose.
    I think,therefore i am a hamster.
    Quote Quote  
  4. Member
    Join Date
    Jul 2009
    Location
    United States
    Search Comp PM
    As johns0 and jagabo have said there will be some quality loss but if you still want to have ffmpeg resize the video then add something like
    <code>-vf scale=-1:720</code>
    before the -f flag in your example.
    see https://trac.ffmpeg.org/wiki/Scaling for details.
    Quote Quote  
  5. Member
    Join Date
    Mar 2022
    Location
    Les Sables D'Olonne, France
    Search Comp PM
    Good evening, Jagabo and johns0.
    Okay, so I'll keep my 1080p in 1080p.
    As for the interest of the Av1 codec:
    Even for resolutions lower than 1080p, there is one big advantage, and that is the file weight.
    In 720p I gain 30 to 45% in file size compared to H265.
    In DVD format (720 × 576) I gain another 20% in file size compared to H265.
    There is only in smaller format (512x280) where I have a loss of 5,5 % in file size compared to H265.
    The options available by libsvtav1 in FFmpeg do not allow me to get the result I want, I have either small files, but of mediocre quality or good quality files, but of enormous weight.
    By passing the video tracks to SvtAv1EncApp, I get the weight gains I mentioned earlier in this post and the quality of the video tracks is very good.
    The conversion time is certainly significant, but given the file weight gains, it overrides the issue of conversion time which for me is not important, as I let the conversion work in the background while I do other things on the computer and at night the conversion does not bother me, as my computer does not make noise even at high loads.

    Good evening, zing269.
    Sorry, our messages got crossed.
    Actually, I know the option:
    Code:
    -vf scale=-1:720
    Personally, I would have gone for :
    Code:
    -vf scale=1280:-1
    because in fact with 720p, the length of the image resolution must be 1280 which is no longer the case if the image resolution is not exactly 1280x720, because for formats in 2:35 for example, the conversion with :
    Code:
    -vf scale=-1:720
    will not give 720p anymore.
    The same goes for 1080p, the length of the image resolution must be 1920.
    This option is only useful to make 720p when the length of the 1080p video is less than 1920 pixels like TV shows before the switch to 16:9 or old movies.
    The question I was asking myself is that as I send the video track to SvtAv1EncApp the option
    -vf scale=
    option would still work or would I have to use an option in the SvtAv1EncApp command.
    I probably explained myself badly in my first message.
    I'm going to try converting from 1080p to 720p to see if there is any noticeable deterioration in quality, or if the quality is good enough for me or not, but I wanted to ask before I do anything stupid because I had converted several videos just with FFmpeg before noticing that the image quality was poor.
    So I had to start the conversions again with SvtAv1EncApp.
    Ignace.
    Last edited by ignace72; 1st Apr 2022 at 18:36.
    Quote Quote  
  6. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    The only reason you gain size is when you use more bitrate in your encoding,just use the best bitrate for your file type.
    I think,therefore i am a hamster.
    Quote Quote  
  7. You can use clever FFmpeg-GUI.

    Image
    [Attachment 63987 - Click to enlarge]


    Fast encode, if you have an Intel CPU.
    Control the image quality with the CRF value (the smaller the better, but also larger file).

    Download: https://files.videohelp.com/u/292773/clever_ffmpeg_gui_newest_beta.7z
    Quote Quote  
  8. Member
    Join Date
    Mar 2022
    Location
    Les Sables D'Olonne, France
    Search Comp PM
    Hello, ProWo.
    Thanks, I'll try this later this afternoon, as I have a conversion in progress and need to get out.
    Ignace.
    Quote Quote  
  9. Originally Posted by ignace72 View Post
    As for the interest of the Av1 codec:
    Even for resolutions lower than 1080p, there is one big advantage, and that is the file weight.
    In 720p I gain 30 to 45% in file size compared to H265.
    So you converted an h265 video to av1 at crf 30 and got a 45 percent smaller file? That doesn't mean av1 is 45 percent more efficient than h265. Using crf 30 was just a random choice that happened to reduce that source to a 45 percent smaller file. How do you know that reencoding the same video with x265 couldn't do the same quality at the same size? Note that crf values between different encoders don't necessarily correspond to each other. A crf 30 encoding with x265 and svtav1 don't necessarily deliver the same size or or same quality. It's really just an arbitrary number.
    Quote Quote  
  10. Member
    Join Date
    Mar 2022
    Location
    Les Sables D'Olonne, France
    Search Comp PM
    Good evening, jagabo.
    All the reading I've done says that the Av1 performs better than the H265.
    Here is a page that summarizes everything I have read on the subject.
    https://www.winxdvd.com/convert-hevc-video/av1-vs-hevc.htm
    After that, I don't force anyone to believe me and it doesn't matter to me.
    I say what I think. That's all.
    On the other hand, nothing you all have told me contradicts me.
    I simply notice that with the same visual quality, Av1 files are less heavy than H265 ones.
    This is just an observation but it is not the subject of the thread I opened.
    I asked a question, I got an answer.
    That is enough for me.
    After that, if you want to debate whether so-and-so is better, worse or the same as so-and-so, I'm not interested.
    Ignace.
    Quote Quote  
  11. Of course av1 can compress better than hevc. My point was that the way you appeared to have measured the difference made no sense.

    Support for av1 is nonexistent outside a computer. So hope you don't try to watch on anything else anytime soon.
    Quote Quote  
  12. Member
    Join Date
    Mar 2022
    Location
    Les Sables D'Olonne, France
    Search Comp PM
    Good evening to all.
    I tried clever FFmpeg-GUI but I don't like it, in fact I prefer the command line.

    The poor support of the Av1 doesn't bother me because I only use my computer and I don't have a TV.

    I finally tested the conversion of a 1080p to 720p video track from an H264 format to Av1 by adding to my conversion command:
    Code:
    -vf scale=1280:-1
    The 1080p video track in H264 is 14,6 Gio and the converted video track in 720p in Av1 is 784,1 Mio, the weight of the video track is comparable to the 720p video tracks in Av1 that I have already been able to convert from a 720p source in H265 or H264.
    The quality of this video track is very good.
    So, I will convert my other videos from 1080p to H265 or H264 to 720p to Av1.
    Ignace.
    Last edited by ignace72; 1st Apr 2022 at 18:40.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!