Your question made me curious all day. I've been playing around on an Ubuntu VM for the past hour and did a little digging.
The first two set of options you are using:
cvlc --fullscreen --vout glx --no-autoscale --scale 0.65 video.mp4
and
cvlc --fullscreen --vout glx --width 800 --height 519 video.mp4
are targeting window scaling. If you remove --fullscreen
from your command, you will see that the window opening is the exact size as you specify, but once you enable fullscreen, the video plays in the original size.
I have tried every single option that includes the word width/height in the official VLC command-line help and the result is the same.
Your third command is your best case. The third command is the only one that affects the video stream and not the window. So you have to find the best percentage that will play your video exactly as you want to.
The suggestions I made in the comments for Devilspie2 and kpie are affecting the size of the window as well, so they may not seem appropriate in your case.
Right now, your best shot is to find the ideal number for the --zoom
option
Zoom will not give you the exact size that you are looking for since there is no way to specify width and height with --zoom
. If you are willing to give transcoding a shot, then you might get the expected results
MP4 files can have the metadata chunk at the beginning or at the end. It is usually at the end for freshly encoded files because the encoder might not know what values to write until it's done encoding the whole video (especially the parts needed for seeking).
But when preparing MP4 files for online streaming, it is common to move metadata to the beginning, e.g. as described in this blog post. (In other words, you're not the first to want to do this – it's everyday business for web browsers.)
Note: Although the post shows a full re-encode being done, I am not sure whether that is actually needed – it should be enough to just remux with -codec copy -movflags faststart
and avoid the quality loss.
There are tools you can use to see the actual structure of a given MP4 file, e.g.:
$ AtomicParsley test.m4a -T
Atom ftyp @ 0 of size: 24, ends @ 24
Atom free @ 24 of size: 8, ends @ 32
Atom mdat @ 32 of size: 4038152, ends @ 4038184
Atom moov @ 4038184 of size: 58035, ends @ 4096219
Atom mvhd @ 4038192 of size: 108, ends @ 4038300
Atom trak @ 4038300 of size: 57386, ends @ 4095686
Atom tkhd @ 4038308 of size: 92, ends @ 4038400
...
Atom udta @ 4095686 of size: 533, ends @ 4096219
Atom meta @ 4095694 of size: 525, ends @ 4096219
Atom hdlr @ 4095706 of size: 33, ends @ 4095739
Atom ilst @ 4095739 of size: 279, ends @ 4096018
Atom ©nam @ 4095747 of size: 31, ends @ 4095778
...
Segmentation fault (core dumped)
Here mdat
contains the actual audio/video data (just a single audio stream in this case) and moov
contains the metadata (e.g. moov.udta.meta.ilst.©nam
is the track title).
Best Answer
Try adding
--no-embedded-video --no-autoscale
.