• Re: Resizing mp4

    From Mike Scott@21:1/5 to All on Sun Jul 20 15:37:13 2025
    On 20/07/2025 14:40, db wrote:
    .....

    Is there a way to make the equivalent of a thumbnail video? Xconvert
    does not seem to be it.

    ffmpeg?

    eg https://superuser.com/questions/624563/how-to-resize-a-video-to-make-it-smaller-with-ffmpeg


    --
    Mike Scott
    Harlow, England

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Ahlstrom@21:1/5 to Mike Scott on Sun Jul 20 11:52:38 2025
    Mike Scott wrote this post while blinking in Morse code:

    On 20/07/2025 14:40, db wrote:
    .....

    Is there a way to make the equivalent of a thumbnail video? Xconvert
    does not seem to be it.

    ffmpeg?

    eg https://superuser.com/questions/624563/how-to-resize-a-video-to-make-it-smaller-with-ffmpeg

    Here's a script I once used, including comments:

    ========================================

    #!/bin/sh
    #
    # Basic upscaling of a single file to 2560x1440 while converting to MP4.
    #
    # https://write.corbpie.com/upscaling-and-downscaling-video-with-ffmpeg/
    #
    # To change a video file to be 1080p in FFmpeg:
    #
    # ffmpeg -i input.mp4 -vf scale=1920x1080:flags=lanczos output_1080p.mp4
    #
    # To change a video file to be 1080p in FFmpeg:
    #
    # ffmpeg -i input.mp4 -vf scale=1920x1080:flags=lanczos -c:v libx264 -preset
    # slow -crf 21 output_compress_1080p.mp4
    #
    # To upscale to 4k video:
    #
    # ffmpeg -i input.mp4 -vf scale=3840x2560:flags=lanczos -c:v libx264 -preset
    # slow -crf 21 output_compress_4k.mp4
    #
    # To downscale video all you need to know is popular dimensions. Given you have # a source video of 1280 x 720; 640 x 480, 480 x 360 and 426 x240.
    #
    # ffmpeg -i input.mp4 -vf scale=640x480:flags=lanczos -c:v libx264 -preset slow # -crf 21 output_compress_480p.mp4

    VC="ffmpeg"
    NAME="$1"
    BASE=${NAME%.*}
    $VC -i "$NAME" -vf scale=2560x1440:flags=lanczos "$BASE.mp4"

    ========================================

    --
    He walks as if balancing the family tree on his nose.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eli the Bearded@21:1/5 to dieterhansbritz@gmail.com on Sun Jul 20 16:48:01 2025
    In comp.os.linux.misc, db <dieterhansbritz@gmail.com> wrote:
    Occasionally I have video files in mp4 format. I tried the online
    service xconvert but this only reduced the resolution so that I get
    the same size on the creen but fuzzy.

    Is there a way to make the equivalent of a thumbnail video? Xconvert
    does not seem to be it.

    I use ffmpeg for video scaling. I wrote a blog entry on it, mostly to
    collect my own thoughts for future refence:

    https://qaz.wtf/qz/blosxom/2025/01/06/on-ffmpeg

    Since then I've added an "adjust compression" line to some of my
    scaling jobs:

    -c:v libx264 -b:v 2M -c:a aac -b:a 192k

    It goes somewhere after the `-map 0` option and is incompatible
    with the `-acodec copy` option. For thumbnail purposes, I suspect
    you might want smaller numbers than "2M" video rate and "192k" audio.

    Elijah
    ------
    needed a few years to become comfortable with ffmpeg command line

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Computer Nerd Kev@21:1/5 to dieterhansbritz@gmail.com on Mon Jul 21 08:41:11 2025
    db <dieterhansbritz@gmail.com> wrote:
    I have a photo gallery online, where I display jpg and png photos
    in slightly reduced form to save space /using the convert command) and
    each one is seen as a thumbnail, reduced much more, to be clicked on
    to see the larger picture. This works.

    Occasionally I have video files in mp4 format. I tried the online
    service xconvert but this only reduced the resolution so that I get
    the same size on the creen but fuzzy.

    So your browser is scaling the video back up again?

    Is there a way to make the equivalent of a thumbnail video? Xconvert
    does not seem to be it.

    It sounds like the Xconvert output works, but the web page where
    you use it isn't right. If you're using the HTML5 "<video>" tag to
    make the thumbnail video playable, make sure the width= and height=
    parameters are set to the reduced resolution of the Xconvert
    output.

    https://www.w3schools.com/html/html5_video.asp

    Alternatively you could make much smaller animated GIFs or APNGs
    with single-frame snapshots from the video every few minutes. That
    would be much nicer on bandwidth when loading the page. Or just one
    thumbnail JPEG frame from near the start of the video (which is the
    only option I'd want a page I visit to use). I believe Ffmpeg can
    be used for those conversions as well as the full video
    downscaling.

    --
    __ __
    #_ < |\| |< _#

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Eli the Bearded on Mon Jul 21 05:48:20 2025
    On Sun, 20 Jul 2025 16:48:01 -0000 (UTC), Eli the Bearded wrote:

    needed a few years to become comfortable with ffmpeg command line

    Not the only one. ;)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From c186282@21:1/5 to All on Fri Jul 25 00:02:28 2025
    On 7/20/25 9:40 AM, db wrote:
    I have a photo gallery online, where I display jpg and png photos
    in slightly reduced form to save space /using the convert command) and
    each one is seen as a thumbnail, reduced much more, to be clicked on
    to see the larger picture. This works.

    Occasionally I have video files in mp4 format. I tried the online
    service xconvert but this only reduced the resolution so that I get
    the same size on the creen but fuzzy.

    Is there a way to make the equivalent of a thumbnail video? Xconvert
    does not seem to be it.

    While you can do it one at a time with maybe VLC,
    doing it as a a batch ... look into command-line
    solutions like 'ffmpeg'. Note the params required
    are complicated and docs vary. DO use it to shrink
    an IP cam image - which is close to what you want.
    It will accept files rather than an active stream.
    The batch job, well, you'll have to work it ...
    maybe a small Python script is easiest though it
    could be done in Bash.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From c186282@21:1/5 to Eli the Bearded on Fri Jul 25 04:00:11 2025
    On 7/20/25 12:48 PM, Eli the Bearded wrote:
    In comp.os.linux.misc, db <dieterhansbritz@gmail.com> wrote:
    Occasionally I have video files in mp4 format. I tried the online
    service xconvert but this only reduced the resolution so that I get
    the same size on the creen but fuzzy.

    Is there a way to make the equivalent of a thumbnail video? Xconvert
    does not seem to be it.

    I use ffmpeg for video scaling. I wrote a blog entry on it, mostly to
    collect my own thoughts for future refence:

    https://qaz.wtf/qz/blosxom/2025/01/06/on-ffmpeg

    Since then I've added an "adjust compression" line to some of my
    scaling jobs:

    -c:v libx264 -b:v 2M -c:a aac -b:a 192k

    It goes somewhere after the `-map 0` option and is incompatible
    with the `-acodec copy` option. For thumbnail purposes, I suspect
    you might want smaller numbers than "2M" video rate and "192k" audio.

    Elijah
    ------
    needed a few years to become comfortable with ffmpeg command line


    FFMPEG is really the ONLY thing for what he wants.
    It's the all-purpose tool - IF you can find good
    examples for the command line.

    Currently I'm using ffmpeg to dynamically re-size
    AND change the frame rate for an IP cam. It works.
    Audio IS preserved.

    If he needs to do batches, well, he will have to
    write his own Bash/Python scripts.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)