Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > New and alternative a/v containers

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd October 2019, 17:33   #1  |  Link
nji
Registered User
 
Join Date: Mar 2018
Location: Germany
Posts: 50
How to encode a movie with mostly still images?

First ... I'm a newbie to these things ... if me question should sound strange ;-)

In youtube you can find many "videos" that actually aren't videos at all.
In the sense that it is (for example) the audio from an old LP record,
and the video consists of nothing else but a still image of the cover art,
maybe with some blending at both ends and blending of the individual tracks.
Although there are new codecs used, the video information makes about 2/3.
For example
https://youtu.be/NJnRHc7tp10
56% (37 MB) only for 7s of blending and 10 track title frames (= less than 1 MB).
My question:
Why do the video codecs do so bad on that?
Is there a more clever way to combine audio and video in that cases?
Optimal would be to set times/ frames from where to show a still image
or a few frames...
Strange idea?
nji is offline   Reply With Quote
Old 3rd October 2019, 17:55   #2  |  Link
Mick
Registered User
 
Mick's Avatar
 
Join Date: Nov 2013
Location: France
Posts: 55
Hi nji,

I have seen Videos like that you mentioned here. The Quality drops with the Time of the Still images because they are static, means no movement between the Key-frames. When I do a Animation with Photos or Images then I use a Plugin like the "Ken Burns Effect". I also make sure that the Length of the GoP is short.

For PAL I use 1 Key-frame every 25 Frames (Short GoP) and for NTSC 1 Key-frame every 30 Frames (Short GoP). In case "Ken Burns" is new to you, the Effect slightly zooms In or out of the Photo or Image. The Effect can also pan over a Photo or Image. This way Photos or Images are no longer static/still. I hope this was helpful for you.

Cheers

Mick

P.S.: GoP = Group of Pictures
__________________
-> May U live 2 C the Dawn <-
Mick is offline   Reply With Quote
Old 3rd October 2019, 18:27   #3  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 203
Quote:
Originally Posted by Mick View Post
I also make sure that the Length of the GoP is short.
Why would you want to do that? You just narrowed your options of having an efficient compression.
Cary Knoop is offline   Reply With Quote
Old 3rd October 2019, 19:19   #4  |  Link
Mick
Registered User
 
Mick's Avatar
 
Join Date: Nov 2013
Location: France
Posts: 55
Hi Cary,

with a short GoP the resulting Movie of Photos or Images become more consumable and don't suffer from too many P/B Frames between Key-Frames which reduce the Quality and clarity in Medium or Long GoP's. With Movies it's different because there is more movement in the Frames.

Cheers

Mick
__________________
-> May U live 2 C the Dawn <-
Mick is offline   Reply With Quote
Old 3rd October 2019, 19:27   #5  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 203
Quote:
Originally Posted by Mick View Post
with a short GoP the resulting Movie of Photos or Images become more consumable and don't suffer from too many P/B Frames between Key-Frames which reduce the Quality and clarity in Medium or Long GoP's. With Movies it's different because there is more movement in the Frames.
What makes you think that long GOP reduces quality compared to short or no GOP with a similar bitrate?
Cary Knoop is offline   Reply With Quote
Old 3rd October 2019, 19:42   #6  |  Link
Mick
Registered User
 
Mick's Avatar
 
Join Date: Nov 2013
Location: France
Posts: 55
Hi Cary,

because P/B Frames only store a part of the Key-Frame. In a Long GoP it simply takes too long between the Key-Frames. Again, I refer to animated Photos or Images, not about Movies which are a total different thing. BTW, "no GoP" would mean Key-Frame only (I-Frame). I think you are familiar how compression works I suggest you do a Test yourself with static Images or Photos in a Long GoP to see for yourself, then you might understand what I mean okay ?

Cheers

Mick
__________________
-> May U live 2 C the Dawn <-
Mick is offline   Reply With Quote
Old 3rd October 2019, 20:03   #7  |  Link
nji
Registered User
 
Join Date: Mar 2018
Location: Germany
Posts: 50
Thank you for the reply.

Still - I am probably misunderstood.

My problem is not the potential degradation of the still image.

My question is why codecs/ containers (mp4, avc etc.) do so
bad compression ratio on still image.
I mean - it actually is no movement, but just still image,
and still it needs 37 MB, although the "necessary" info would
be less than about 1 MB.
And related question:
If the codecs/ containers for some reason can't do better...
is then there a adequate way to do that?
It's like a kind of ... "presentation" (maybe I should take powerpoint ;-)

Greetings!
nji is offline   Reply With Quote
Old 3rd October 2019, 20:28   #8  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 203
Quote:
Originally Posted by Mick View Post
I suggest you do a Test yourself with static Images or Photos in a Long GoP to see for yourself, then you might understand what I mean okay ?
A test with the same average bitrate or do you want to compare apples with pears?
Cary Knoop is offline   Reply With Quote
Old 3rd October 2019, 20:44   #9  |  Link
nji
Registered User
 
Join Date: Mar 2018
Location: Germany
Posts: 50
Thank you for the reply.

Still - I am probably misunderstood.

My problem is not the potential degradation of the still image.

My question is why codecs/ containers (mp4, avc etc.) do so
bad compression ratio on still image.
I mean - it actually is no movement, but just still image,
and still it needs 37 MB, although the "necessary" info would
be less than about 1 MB.
And related question:
If the codecs/ containers for some reason can't do better...
is then there a adequate way to do that?
It's like a kind of ... "presentation" (maybe I should take powerpoint ;-)

Greetings!
nji is offline   Reply With Quote
Old 3rd October 2019, 22:04   #10  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,975
It has to do with the way youtube re-encodes it.

Sometimes they distribute the encode over multiple encoders so there are more keyframes than you would expect. In theory, you could use 1 frame if it was just a static image (ie. for a video that didn't have fades) . Keyframes "cost" a lot because they encode the entire image complete - there is no temporal compression from adjacent frames

But you need at least some keyframes for seeking . eg. If viewer wants to skip to end of song for example. A super long keyframe interval would make seeking difficult and slow if it had a high fps, or the gradation too wide (not able to seek to fine points, but only in big chunks like 5 minutes instead of 1 second)

If they used more efficient settings it could be much smaller (more b frames, longer GOP intervals) . But this negatively impacts processing time , and playback experience (seek latency increase), so YT has to make some tradeoffs

In theory, you could encode a fractional FPS video, this would mean many fewer images. "b" frames don't "cost" a lot in terms of size for adjacent still frames - but they still cost something. Something is more than nothing. The lowest framerate from YT is 6 (if you upload a 1 fps video, it will be duplicated to 6). (Or at least it used to be when testing a few years ago, it might have changed)


The more clever way for you, if it's not for YT (you cannot do much about how YT re-encodes the video, although a lower framerate to 6 will help if it's "still" image)

1) "VFR" . Still sections get lower framerates, even fractional. A still image for 6 minute presentation might be 1 frame. Fast action sequences get higher framerates appropriately

2) And to use efficient encoding settings; larger GOP sizes, slower encoding settings, more b-frames
poisondeathray is offline   Reply With Quote
Old 3rd October 2019, 22:54   #11  |  Link
nji
Registered User
 
Join Date: Mar 2018
Location: Germany
Posts: 50


No, I'm not about YT, that was just an example.

VFR - never used that before. Thought it is dead.

Is that a property of the container, or of the codec?
On VD2/ avc1 codec options ... no VFR anywhere.
nji is offline   Reply With Quote
Old 3rd October 2019, 23:04   #12  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,975
Quote:
Originally Posted by nji View Post


No, I'm not about YT, that was just an example.

VFR - never used that before. Thought it is dead.

Is that a property of the container, or of the codec?
On VD2/ avc1 codec options ... no VFR anywhere.

Just using ideal encoding settings will make a massive difference compared to how YT re-encodes it


But to answer the question -

There are different types of VFR

The one I'm referring to is known as timecode (or timestamp) based VFR . And that is a property of timecodes which get muxed with the container.

It basically tells the player when, and how long a certain frame should display. If you look at the mkvmerge documentation, there is a section on "timestamps", and that explains the different types of timestamps (in the past, they were referred to as "timecodes", but it's the same thing)

Certain hardware players might have problems playing back timecode VFR, but all common software players should support it

Common containers that support VFR are MP4, MKV . mkvmerge can be used for mkv , mp4fpsmod for mp4

If your content is "easy", it's probably simple enough to make the timecodes/timestamps manually . But there are avisynth functions that can decimate duplicates and generate the timescodes as well
poisondeathray is offline   Reply With Quote
Old 3rd October 2019, 23:22   #13  |  Link
nji
Registered User
 
Join Date: Mar 2018
Location: Germany
Posts: 50
I'm baffled once more.

An ocean of detail knowledge in these media things.

You didn't mention VirtualDub/2 ... so VFR mode(s) won't be available there?
(I ask, because that's my tool, and - if possible - would like to avoid to open new tins ;-)

Last edited by nji; 4th October 2019 at 00:34.
nji is offline   Reply With Quote
Old 3rd October 2019, 23:25   #14  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,975
Quote:
Originally Posted by nji View Post
I'm baffled once more.

An ocean of detail knowledge in these media things.

You did't mentioned VirtualDub/2 ... so VFR mode(s) won't be available there?
(I ask, because that's my tool, and - if possible - would like to avoid to open new tins ;-)
VFR not directly possible with vd2 ; you'd still have to mux in VFR timecodes with other tools

But encoding it just properly, good settings will make a massive difference compare to how YT processes it

Also there is more to learn about - the preprocessing and filtering side. For example , depending on what your source is, just denosing can significantly improve compression
poisondeathray is offline   Reply With Quote
Old 4th October 2019, 00:33   #15  |  Link
nji
Registered User
 
Join Date: Mar 2018
Location: Germany
Posts: 50
Thanks again.

So, first I will have a look at mkvmerge documentation.

BTW: How could you know about my de Bergerac nose? :-))

Last edited by nji; 4th October 2019 at 10:30. Reason: BTW added
nji is offline   Reply With Quote
Old 5th October 2019, 13:08   #16  |  Link
nji
Registered User
 
Join Date: Mar 2018
Location: Germany
Posts: 50
Seeking in VFR

... ok then, if I encode a "movie" with say 10 frames, every lasts several mins (fps = 0,000x), while "background audio" does.

Will sw-players (MPC for example) be able to seek by time (s), or only by frame?
nji is offline   Reply With Quote
Old 17th October 2019, 16:13   #17  |  Link
nji
Registered User
 
Join Date: Mar 2018
Location: Germany
Posts: 50
Quote:
Originally Posted by nji View Post
... ok then, if I encode a "movie" with say 10 frames, every lasts several mins (fps = 0,000x), while "background audio" does.

Will sw-players (MPC for example) be able to seek by time (s), or only by frame?
Found out myself:

MPC-HC is able to seek by timeline.
nji is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:20.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.