On 2025-09-06 00:34, Ferdi Scholten via ffmpeg-user wrote:
Hi,

I'm watching a serial. Those files are made at 3840 x 1604 pixels, and display badly on my old and small Lenovo Yoga laptop connected via HDMI cable to my sitting room TV set (the sound plays well, but the video is jumpy, it can stop for several seconds). I tested several conversions to an "easier on the cpu" files, and one of these worked:

    ffmpeg -t 10:0 -i movie.mkv \
        -vf scale=960:802  -c:v mpeg4 -vtag xvid -qscale:v 3  -c:a copy -c:s copy -c:s copy  \
        3b_movie.mkv

You may notice that the scale is wrong. The original aspect ratio is 2.3940, while this has 1.1970, so when VLC plays it it has to change the displayed aspect ratio at runtime so that it displays correctly. So I corrected the command line:

    ffmpeg -t 10:0 -i movie.mkv \
        -vf scale=-1:802  -c:v mpeg4 -vtag xvid -qscale:v 3  -c:a copy -c:s copy -c:s copy  \
        3c_movie.mkv

which produces a 1920 x 802 as the same aspect ratio as the original 2.3940. However, it displays badly (haltingly) on the laptop!

Why?

(note: TV set is 1920 x 1080)

...



Both the original video codec (HEVC) as the codec you choose for transcoding (mpeg4) are unsupported by your hardware. And because your hardware is not very powerful, you have bad performance. At least choose a codec that has hardware support and on your hardware, the only valid choice is H264 which is the only codec having hardware support for both encoding and decoding on your hardware. So you might get a (much) more performant playback if you encode with libx264 instead of mpeg4 and probably also better quality of the encoded video


Thanks, but that is what I tried first and doesn't work well. test 1b, the 
video stutters badly:

ffmpeg -t 10:0 -i movie.mkv \
    -vf scale=-1:802  -c:v libx264 -preset fast -crf 22 -tune fastdecode 
-profile:v baseline  -c:a copy -c:s copy -c:s copy  \
  1b_movie.mkv

I just tried with the wrong pixel ratio, also bad:

time ffmpeg -t 10:0 -i movie.mkv  \
    -vf scale=960:802  -c:v libx264 -preset fast -crf 22 -tune fastdecode 
-profile:v baseline  -c:a copy -c:s copy -c:s copy  \
    1c_movie.mkv


1b:

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High 10@L4
Format settings                          : 2 Ref Frames
Format settings, CABAC                   : No
Format settings, Reference frames        : 2 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 10 min 0 s
Bit rate                                 : 3 966 kb/s
Width                                    : 1 920 pixels
Height                                   : 802 pixels
Display aspect ratio                     : 2.39:1
Frame rate mode                          : Variable
Frame rate                               : 130.170 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 10 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.020
Stream size                              : 1.50 GiB
Writing library                          : x264 core 164
Encoding settings                        : cabac=0 / ref=2 / deblock=0:0:0 / 
analyse=0x1:0x111 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / 
me_range=16 / chroma_me=1 / trell
is=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / 
threads=18 / lookahead_threads=3 / sliced_threads=0 / nr=0 / decimate=1 / 
interlaced=0 / bluray_compat=0 / con
strained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=23 / 
scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=crf / mbtree=1 / crf=22.0 
/ qcomp=0.60 / qpmin=0 / qpmax=81 / qps
tep=4 / ip_ratio=1.40 / aq=1:1.00
Default                                  : Yes
Forced                                   : No


1c:

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High [email protected]
Format settings                          : 2 Ref Frames
Format settings, CABAC                   : No
Format settings, Reference frames        : 2 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 10 min 0 s
Bit rate                                 : 3 966 kb/s
Width                                    : 960 pixels
Height                                   : 802 pixels
Display aspect ratio                     : 2.39:1
Frame rate mode                          : Variable
Frame rate                               : 130.170 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 10 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.040
Stream size                              : 1.50 GiB
Writing library                          : x264 core 164
Encoding settings                        : cabac=0 / ref=2 / deblock=0:0:0 / 
analyse=0x1:0x111 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / 
me_range=16 / chroma_me=1 / trell
is=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / 
threads=18 / lookahead_threads=3 / sliced_threads=0 / nr=0 / decimate=1 / 
interlaced=0 / bluray_compat=0 / con
strained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=23 / 
scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=crf / mbtree=1 / crf=22.0 
/ qcomp=0.60 / qpmin=0 / qpmax=81 / qps
tep=4 / ip_ratio=1.40 / aq=1:1.00
Default                                  : Yes
Forced                                   : No




I tried several conversions, only "3b" worked.

No: -vf scale=-1:802  -c:v libx264 -preset fast -crf 22 -tune fastdecode 
-profile:v baseline  -c:a copy -c:s copy -c:s copy

No: -vf scale=960:802  -c:v libx264 -preset fast -crf 22 -tune fastdecode 
-profile:v baseline  -c:a copy -c:s copy -c:s copy

No: -vf scale=960:802  -c:v libx264 -preset fast -crf 22 -tune fastdecode 
-profile:v main  -c:a copy -c:s copy -c:s copy

Works:
    -vf scale=960:802  -c:v mpeg4 -vtag xvid -qscale:v 3  -c:a copy -c:s copy 
-c:s copy  \

No:
    -vf scale=-1:802  -c:v mpeg4 -vtag xvid -qscale:v 3  -c:a copy -c:s copy 
-c:s copy

No: -vf scale=960:802  -c:v libx264 -preset medium -crf 22 -tune fastdecode 
-profile:v baseline  -c:a copy -c:s copy -c:s copy

No: -vf scale=960:802  -c:v libx264 -preset medium -crf 22 -tune fastdecode 
-profile:v main  -c:a copy -c:s copy -c:s copy



I just noticed the frame rate, it goes too fast:

Original Frame rate                               : 23.976 (24000/1001) FPS


1b: Frame rate                               : 130.170 FPS
1c: Frame rate mode                          : Variable
    Frame rate                               : 130.170 FPS

3b: Frame rate mode                          : Variable
    Frame rate                               : 130.170 FPS


I didn't know the frame rate changed with the conversion. I don't think my 
laptop can cope with that frame rate. :-?
Or I am misunderstanding?

I did a quick test:

time ffmpeg -t 10:0 -r 24 -i movie.mkv  \
    -vf scale=-1:802  -c:v libx264 -preset fast -crf 22 -tune fastdecode 
-profile:v baseline  -c:a copy -c:s copy -c:s copy  \
    -r 24 1d_movie.mkv

Doesn't work, stutters badly. So that's not it.


I have to sleep.


--
Cheers / Saludos,

                Carlos E. R.
                (from 15.6 x86_64 at Telcontar)

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
ffmpeg-user mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to