Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
e4d45673
Commit
e4d45673
authored
Oct 07, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/movenc: set XDCAM codec tag correctly
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
713dcdbf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
+62
-0
movenc.c
libavformat/movenc.c
+62
-0
No files found.
libavformat/movenc.c
View file @
e4d45673
...
...
@@ -897,6 +897,65 @@ static AVRational find_fps(AVFormatContext *s, AVStream *st)
return
rate
;
}
static
int
mov_get_mpeg2_xdcam_codec_tag
(
AVFormatContext
*
s
,
MOVTrack
*
track
)
{
int
tag
=
MKTAG
(
'm'
,
'2'
,
'v'
,
'1'
);
//fallback tag
int
interlaced
=
track
->
enc
->
field_order
>
AV_FIELD_PROGRESSIVE
;
AVStream
*
st
=
track
->
st
;
int
rate
=
av_q2d
(
find_fps
(
s
,
st
));
if
(
track
->
enc
->
pix_fmt
==
AV_PIX_FMT_YUV420P
)
{
if
(
track
->
enc
->
width
==
1280
&&
track
->
enc
->
height
==
720
)
{
if
(
!
interlaced
)
{
if
(
rate
==
24
)
tag
=
MKTAG
(
'x'
,
'd'
,
'v'
,
'4'
);
else
if
(
rate
==
25
)
tag
=
MKTAG
(
'x'
,
'd'
,
'v'
,
'5'
);
else
if
(
rate
==
30
)
tag
=
MKTAG
(
'x'
,
'd'
,
'v'
,
'1'
);
else
if
(
rate
==
50
)
tag
=
MKTAG
(
'x'
,
'd'
,
'v'
,
'a'
);
else
if
(
rate
==
60
)
tag
=
MKTAG
(
'x'
,
'd'
,
'v'
,
'9'
);
}
}
else
if
(
track
->
enc
->
width
==
1440
&&
track
->
enc
->
height
==
1080
)
{
if
(
!
interlaced
)
{
if
(
rate
==
24
)
tag
=
MKTAG
(
'x'
,
'd'
,
'v'
,
'6'
);
else
if
(
rate
==
25
)
tag
=
MKTAG
(
'x'
,
'd'
,
'v'
,
'7'
);
else
if
(
rate
==
30
)
tag
=
MKTAG
(
'x'
,
'd'
,
'v'
,
'8'
);
}
else
{
if
(
rate
==
25
)
tag
=
MKTAG
(
'x'
,
'd'
,
'v'
,
'3'
);
else
if
(
rate
==
30
)
tag
=
MKTAG
(
'x'
,
'd'
,
'v'
,
'2'
);
}
}
else
if
(
track
->
enc
->
width
==
1920
&&
track
->
enc
->
height
==
1080
)
{
if
(
!
interlaced
)
{
if
(
rate
==
24
)
tag
=
MKTAG
(
'x'
,
'd'
,
'v'
,
'd'
);
else
if
(
rate
==
25
)
tag
=
MKTAG
(
'x'
,
'd'
,
'v'
,
'e'
);
else
if
(
rate
==
30
)
tag
=
MKTAG
(
'x'
,
'd'
,
'v'
,
'f'
);
}
else
{
if
(
rate
==
25
)
tag
=
MKTAG
(
'x'
,
'd'
,
'v'
,
'c'
);
else
if
(
rate
==
30
)
tag
=
MKTAG
(
'x'
,
'd'
,
'v'
,
'b'
);
}
}
}
else
if
(
track
->
enc
->
pix_fmt
==
AV_PIX_FMT_YUV422P
)
{
if
(
track
->
enc
->
width
==
1280
&&
track
->
enc
->
height
==
720
)
{
if
(
!
interlaced
)
{
if
(
rate
==
24
)
tag
=
MKTAG
(
'x'
,
'd'
,
'5'
,
'4'
);
else
if
(
rate
==
25
)
tag
=
MKTAG
(
'x'
,
'd'
,
'5'
,
'5'
);
else
if
(
rate
==
30
)
tag
=
MKTAG
(
'x'
,
'd'
,
'5'
,
'1'
);
else
if
(
rate
==
50
)
tag
=
MKTAG
(
'x'
,
'd'
,
'5'
,
'a'
);
else
if
(
rate
==
60
)
tag
=
MKTAG
(
'x'
,
'd'
,
'5'
,
'9'
);
}
}
else
if
(
track
->
enc
->
width
==
1920
&&
track
->
enc
->
height
==
1080
)
{
if
(
!
interlaced
)
{
if
(
rate
==
24
)
tag
=
MKTAG
(
'x'
,
'd'
,
'5'
,
'd'
);
else
if
(
rate
==
25
)
tag
=
MKTAG
(
'x'
,
'd'
,
'5'
,
'e'
);
else
if
(
rate
==
30
)
tag
=
MKTAG
(
'x'
,
'd'
,
'5'
,
'f'
);
}
else
{
if
(
rate
==
25
)
tag
=
MKTAG
(
'x'
,
'd'
,
'5'
,
'c'
);
else
if
(
rate
==
30
)
tag
=
MKTAG
(
'x'
,
'd'
,
'5'
,
'b'
);
}
}
}
return
tag
;
}
static
const
struct
{
enum
AVPixelFormat
pix_fmt
;
uint32_t
tag
;
...
...
@@ -944,11 +1003,14 @@ static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track)
(
track
->
enc
->
codec_id
==
AV_CODEC_ID_DVVIDEO
||
track
->
enc
->
codec_id
==
AV_CODEC_ID_RAWVIDEO
||
track
->
enc
->
codec_id
==
AV_CODEC_ID_H263
||
track
->
enc
->
codec_id
==
AV_CODEC_ID_MPEG2VIDEO
||
av_get_bits_per_sample
(
track
->
enc
->
codec_id
))))
{
// pcm audio
if
(
track
->
enc
->
codec_id
==
AV_CODEC_ID_DVVIDEO
)
tag
=
mov_get_dv_codec_tag
(
s
,
track
);
else
if
(
track
->
enc
->
codec_id
==
AV_CODEC_ID_RAWVIDEO
)
tag
=
mov_get_rawvideo_codec_tag
(
s
,
track
);
else
if
(
track
->
enc
->
codec_id
==
AV_CODEC_ID_MPEG2VIDEO
)
tag
=
mov_get_mpeg2_xdcam_codec_tag
(
s
,
track
);
else
if
(
track
->
enc
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
{
tag
=
ff_codec_get_tag
(
ff_codec_movvideo_tags
,
track
->
enc
->
codec_id
);
if
(
!
tag
)
{
// if no mac fcc found, try with Microsoft tags
...
...
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