Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
c49c42a4
Commit
c49c42a4
authored
Feb 09, 2015
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc/faq: explain DAR/SAR preserving.
parent
b4917514
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
faq.texi
doc/faq.texi
+34
-0
No files found.
doc/faq.texi
View file @
c49c42a4
...
...
@@ -467,6 +467,40 @@ point acceptable for your tastes. The most common options to do that are
@option
{
-
qscale
}
and @option
{
-
qmax
}
, but you should peruse the documentation
of the encoder you chose.
@section I have a stretched video, why does scaling does not fix it?
A lot of video codecs and formats can store the @emph
{
aspect ratio
}
of the
video: this is the ratio between the width and the height of either the full
image
(
DAR, display aspect ratio
)
or individual pixels
(
SAR, sample aspect
ratio
)
. For example, EGA screens at resolution
640
×
350
had
4
:
3
DAR and
35
:
48
SAR.
Most still image processing work with square pixels, i.e.
1
:
1
SAR, but a lot
of video standards, especially from the analogic
-
numeric transition era, use
non
-
square pixels.
Most processing filters in FFmpeg handle the aspect ratio to avoid
stretching the image: cropping adjusts the DAR to keep the SAR constant,
scaling adjusts the SAR to keep the DAR constant.
If you want to stretch, or “unstretch”, the image, you need to override the
information with the
@url
{
http:
//
ffmpeg.org
/
ffmpeg
-
filters.html#setdar
_
002
c
-
setsar, @code
{
setdar or setsar filters
}}
.
Do not forget to examine carefully the original video to check whether the
stretching comes from the image or from the aspect ratio information.
For example, to fix a badly encoded EGA capture, use the following commands,
either the first one to upscale to square pixels or the second one to set
the correct aspect ratio or the third one to avoid transcoding
(
may not work
depending on the format
/
codec
/
player
/
phase of the moon
)
:
@example
ffmpeg
-
i ega
_
screen.nut
-
vf scale
=
640
:
480
,setsar
=
1
ega
_
screen
_
scaled.nut
ffmpeg
-
i ega
_
screen.nut
-
vf setdar
=
4
/
3
ega
_
screen
_
anamorphic.nut
ffmpeg
-
i ega
_
screen.nut
-
aspect
4
/
3
-
c copy ega
_
screen
_
overridden.nut
@end example
@chapter Development
@section Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment