VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 18 of 18
Thread
  1. Member
    Join Date
    Jan 2014
    Location
    Germany
    Search Comp PM
    Hi,

    I wonder whether you can set let's say x264 (which I often use within Avidemux) configure in such a way that the output of a source file looks like an MPEG / AVI file from around 2000, with big macroblocks etc. I'm talking about videogame footage and trailers that had like 480x360 resolutions, that sort of stuff. Unfortunately I cannot link a YouTube video, as the inevitable YouTube re-encoding algorithm itself has smoothed over the material of course.

    First of all, I can't take MPEG2 itself as it seems to be restricted to 16:9 / 4:3 (at least in my x264 settings).

    Secondly, I'd take the improved efficiency of H.264 of course, if possible.

    I have come close to the desired look by deactivating the "deblock" feature and by lowering the bitrate. However, H.264 seems still too "smart" and not rigid enough about really compressing the image data, as some uniform areas still look smooth and have hardly any blocking or other artefacts apart from being blurry.
    I'm OddTheodora. I'm open for everyone, and I'm for free.
    Quote Quote  
  2. Use a mpeg2 encoder instead, g.e. ffmpeg -i inputvideo -c:v mpeg2video -c:a copy output.mpg
    Quote Quote  
  3. Member
    Join Date
    Jan 2014
    Location
    Germany
    Search Comp PM
    That worked quite nicely in fact, thanks! The only problem was I had to re-encode first with Avidemux because ffmpeg rejected the AAC audio channel of the source file.

    I'm still wondering whether all this could also be achieved with x264 choosing the right settings so I could have the efficiency of H.264 and also would save myself the command line of ffmpeg.
    I'm OddTheodora. I'm open for everyone, and I'm for free.
    Quote Quote  
  4. With x264 you can turn off the deblocker (--no-deblock) and use a very low bitrate (or high qp or crf). Might as well use very fast settings and 15 frame GOPs too.
    Quote Quote  
  5. Member
    Join Date
    Jan 2014
    Location
    Germany
    Search Comp PM
    Originally Posted by jagabo View Post
    With x264 you can turn off the deblocker (--no-deblock) and use a very low bitrate (or high qp or crf). Might as well use very fast settings and 15 frame GOPs too.
    As I mentioned, deblock and low bitrate I already used. They don't produce consistent blocks though (too smart apparently). Those 15 frame GOPs I will google and check out.

    Edit: I'm not sure how the GOP (group of frames, I'd like to think of them as keyframe interval) comes into play here, but I set it to 5/15 (min/max).

    Still, it seems as though x264 produces other blocks because it works differently, more holistically maybe so that you don't get that nice grid of blocks but rather blocky areas.

    Comparison:

    x264 Encoder in Avidemux 2.7.5
    Constant quality (CRF) 40
    No deblock
    GOP min/max 5/15
    4x4 pixel block sizes (8x8 unchecked)



    MPEG2 (ffmpeg 20200713), no custom variables

    Last edited by OddTheodora; 14th Jul 2020 at 18:05.
    I'm OddTheodora. I'm open for everyone, and I'm for free.
    Quote Quote  
  6. Originally Posted by OddTheodora View Post
    That worked quite nicely in fact, thanks! The only problem was I had to re-encode first with Avidemux because ffmpeg rejected the AAC audio channel of the source file.
    Then try: ffmpeg -i inputvideo -c:v mpeg2video -an output.mpg
    This encodes the videostream only. Then remux the new output.mpg with the AAC audio from the source file. Use MkvToolNix to mux to mkv.
    If you want to mux to mp4, use my clever FFmpeg-GUI (https://www.videohelp.com/software/clever-FFmpeg-GUI).
    Last edited by ProWo; 15th Jul 2020 at 04:56.
    Quote Quote  
  7. Originally Posted by OddTheodora View Post
    Originally Posted by jagabo View Post
    With x264 you can turn off the deblocker (--no-deblock) and use a very low bitrate (or high qp or crf). Might as well use very fast settings and 15 frame GOPs too.
    They don't produce consistent blocks though (too smart apparently).
    Yes, i see. Forcing the keyframe interval to 1 (all I frames) and --partitions "none" comes closer to the MPEG 2 image. But I think it still includes 16x16, 16x8, and 8x16 blocks as well as 8x8. And the files will be very large. Or keep the P and B frames but force the partition size to 8x8 --partitions "p8x8,b8x8,i8x8" or "none".

    But using a real MPEG 2 encoder as suggested will work better. Why don't you just use a container that supports the original aac audio along with the mpeg 2 video -- mp4 for example.

    Code:
    ffmpeg -i inputvideo -c:v mpeg2video -c:a copy output.mp4
    Quote Quote  
  8. Member
    Join Date
    Jan 2014
    Location
    Germany
    Search Comp PM
    Originally Posted by ProWo View Post
    Originally Posted by OddTheodora View Post
    That worked quite nicely in fact, thanks! The only problem was I had to re-encode first with Avidemux because ffmpeg rejected the AAC audio channel of the source file.
    Then try: ffmpeg -i inputvideo -c:v mpeg2video -an output.mpg
    This encodes the videostream only. Then remux the new output.mpg with the AAC audio from the source file. Use MkvToolNix to mux to mkv.
    If you want to mux to mp4, use my clever FFmpeg-GUI (https://www.videohelp.com/software/clever-FFmpeg-GUI).
    I usually use the awesome MKV. These are a lot of steps though for a simple video, can't you configure ffmpeg to accept AAC input? Heck it even encodes in AAC, I thought decoding was always the easier part.
    I'm OddTheodora. I'm open for everyone, and I'm for free.
    Quote Quote  
  9. Member
    Join Date
    Jan 2014
    Location
    Germany
    Search Comp PM
    Originally Posted by jagabo View Post
    Originally Posted by OddTheodora View Post
    Originally Posted by jagabo View Post
    With x264 you can turn off the deblocker (--no-deblock) and use a very low bitrate (or high qp or crf). Might as well use very fast settings and 15 frame GOPs too.
    They don't produce consistent blocks though (too smart apparently).
    Yes, i see. Forcing the keyframe interval to 1 (all I frames) and --partitions "none" comes closer to the MPEG 2 image. But I think it still includes 16x16, 16x8, and 8x16 blocks as well as 8x8. And the files will be very large. Or keep the P and B frames but force the partition size to 8x8 --partitions "p8x8,b8x8,i8x8" or "none".

    But using a real MPEG 2 encoder as suggested will work better. Why don't you just use a container that supports the original aac audio along with the mpeg 2 video -- mp4 for example.

    Code:
    ffmpeg -i inputvideo -c:v mpeg2video -c:a copy output.mp4
    I agree that MPEG2 does exactly what I'm looking for, but unfortunately with longer game captures that would amount to large filesizes which I'd like to avoid if I can. But H.264 seems to always produce different kinds of blocks (not a grid anyway), even with very specific block settings I tried, such as only 8x8.

    Here are the available options of Avidemux's x264 (default checkboxes though):

    I'm OddTheodora. I'm open for everyone, and I'm for free.
    Quote Quote  
  10. Originally Posted by OddTheodora View Post
    I usually use the awesome MKV. These are a lot of steps though for a simple video, can't you configure ffmpeg to accept AAC input?
    Here you go:
    Code:
    ffmpeg -i inputvideo -c:v mpeg2video -c:a copy output.mkv
    Quote Quote  
  11. If your goal is just to create a video of 8x8 blocks you can scale down to 1/8 size then back up to full size with a point resize filter.

    Code:
    ffmpeg -i input.mkv -vf zscale=w=160:h=96,zscale=w=1280:h=720:f=point -c:v libx264 -preset veryfast -acodec copy "output.mkv"
    Quote Quote  
  12. Member
    Join Date
    Jan 2014
    Location
    Germany
    Search Comp PM
    Originally Posted by jagabo View Post
    If your goal is just to create a video of 8x8 blocks you can scale down to 1/8 size then back up to full size with a point resize filter.

    Code:
    ffmpeg -i input.mkv -vf zscale=w=160:h=96,zscale=w=1280:h=720:f=point -c:v libx264 -preset veryfast -acodec copy "output.mkv"
    Those would be giant pixels though, macroblocks have at least some color variation within them.
    I'm OddTheodora. I'm open for everyone, and I'm for free.
    Quote Quote  
  13. Member
    Join Date
    Jan 2014
    Location
    Germany
    Search Comp PM
    Originally Posted by ProWo View Post
    Originally Posted by OddTheodora View Post
    I usually use the awesome MKV. These are a lot of steps though for a simple video, can't you configure ffmpeg to accept AAC input?
    Here you go:
    Code:
    ffmpeg -i inputvideo -c:v mpeg2video -c:a copy output.mkv
    Nah, as I said, ffmpeg moans about the AAC audio channel.
    I'm OddTheodora. I'm open for everyone, and I'm for free.
    Quote Quote  
  14. Member
    Join Date
    Jan 2014
    Location
    Germany
    Search Comp PM
    I guess it's very hard to get the same artifacts with H.264 that MPEG2 so effortlessly produces. MPEG2 does work quite nicely already, only for anything longer than a couple of minutes it would take up too much space I'm afraid.

    Thank you for your tips! Much appreciated.
    I'm OddTheodora. I'm open for everyone, and I'm for free.
    Quote Quote  
  15. Member
    Join Date
    Jan 2014
    Location
    Germany
    Search Comp PM
    I'm just wondering why ffmpeg rejects AAC as input when it clearly has an AAC decoder..?
    https://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/aacdec_template.c;h=2f270bc...b5;hb=HEAD#l43
    Last edited by OddTheodora; 15th Jul 2020 at 16:18.
    I'm OddTheodora. I'm open for everyone, and I'm for free.
    Quote Quote  
  16. Member
    Join Date
    Jan 2014
    Location
    Germany
    Search Comp PM
    Originally Posted by OddTheodora View Post
    Originally Posted by ProWo View Post
    Originally Posted by OddTheodora View Post
    I usually use the awesome MKV. These are a lot of steps though for a simple video, can't you configure ffmpeg to accept AAC input?
    Here you go:
    Code:
    ffmpeg -i inputvideo -c:v mpeg2video -c:a copy output.mkv
    Nah, as I said, ffmpeg moans about the AAC audio channel.
    EDIT: Sorry, I overlooked that it actually copies the AAC instead of decoding it. You knew what I wanted before I did lol. Thanks!
    I'm OddTheodora. I'm open for everyone, and I'm for free.
    Quote Quote  
  17. ffmepg complained about your aac audio before when you were trying to remux into an MPG container. The problem wasn't that ffempg doesn't support aac, it's that MPG doesn't support aac. There's no problem remuxing aac into mp4 or mkv.
    Quote Quote  
  18. Member
    Join Date
    Jan 2014
    Location
    Germany
    Search Comp PM
    Originally Posted by jagabo View Post
    ffmepg complained about your aac audio before when you were trying to remux into an MPG container. The problem wasn't that ffempg doesn't support aac, it's that MPG doesn't support aac. There's no problem remuxing aac into mp4 or mkv.
    Okay, then the error message was misleading (or overly simplistic).
    I'm OddTheodora. I'm open for everyone, and I'm for free.
    Quote Quote  



Similar Threads