You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
fftools/ffprobe: Make pix_fmt output bitexact
It is currently not due to endianness. This forced to add workarounds with sed in fate/mxf.mak (which are removed in this commit). This is supposed to fix the enhanced-flv-hevc-hdr10 test on big endian systems. Reviewed-by: Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -2651,6 +2651,31 @@ static void print_private_data(WriterContext *w, void *priv_data)
|
||||
}
|
||||
}
|
||||
|
||||
static void print_pixel_format(WriterContext *w, enum AVPixelFormat pix_fmt)
|
||||
{
|
||||
const char *s = av_get_pix_fmt_name(pix_fmt);
|
||||
enum AVPixelFormat swapped_pix_fmt;
|
||||
|
||||
if (!s) {
|
||||
print_str_opt("pix_fmt", "unknown");
|
||||
} else if (!do_bitexact ||
|
||||
(swapped_pix_fmt = av_pix_fmt_swap_endianness(pix_fmt)) == AV_PIX_FMT_NONE) {
|
||||
print_str ("pix_fmt", s);
|
||||
} else {
|
||||
const char *s2 = av_get_pix_fmt_name(swapped_pix_fmt);
|
||||
char buf[128];
|
||||
size_t i = 0;
|
||||
|
||||
while (s[i] && s[i] == s2[i])
|
||||
i++;
|
||||
|
||||
memcpy(buf, s, FFMIN(sizeof(buf) - 1, i));
|
||||
buf[i] = '\0';
|
||||
|
||||
print_str ("pix_fmt", buf);
|
||||
}
|
||||
}
|
||||
|
||||
static void print_color_range(WriterContext *w, enum AVColorRange color_range)
|
||||
{
|
||||
const char *val = av_color_range_name(color_range);
|
||||
@ -2959,9 +2984,7 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
|
||||
print_int("crop_bottom", frame->crop_bottom);
|
||||
print_int("crop_left", frame->crop_left);
|
||||
print_int("crop_right", frame->crop_right);
|
||||
s = av_get_pix_fmt_name(frame->format);
|
||||
if (s) print_str ("pix_fmt", s);
|
||||
else print_str_opt("pix_fmt", "unknown");
|
||||
print_pixel_format(w, frame->format);
|
||||
sar = av_guess_sample_aspect_ratio(fmt_ctx, stream, frame);
|
||||
if (sar.num) {
|
||||
print_q("sample_aspect_ratio", sar, ':');
|
||||
@ -3360,9 +3383,7 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
|
||||
print_str_opt("sample_aspect_ratio", "N/A");
|
||||
print_str_opt("display_aspect_ratio", "N/A");
|
||||
}
|
||||
s = av_get_pix_fmt_name(par->format);
|
||||
if (s) print_str ("pix_fmt", s);
|
||||
else print_str_opt("pix_fmt", "unknown");
|
||||
print_pixel_format(w, par->format);
|
||||
print_int("level", par->level);
|
||||
|
||||
print_color_range(w, par->color_range);
|
||||
|
@ -29,7 +29,7 @@ fate-mxf-probe-dnxhd: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)"
|
||||
|
||||
FATE_MXF_PROBE-$(call DEMDEC, MXF, JPEG2000) += fate-mxf-probe-j2k
|
||||
fate-mxf-probe-j2k: SRC = $(TARGET_SAMPLES)/imf/countdown/countdown-small.mxf
|
||||
fate-mxf-probe-j2k: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)" | sed -e "s/rgb48../rgb48/"
|
||||
fate-mxf-probe-j2k: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)"
|
||||
|
||||
FATE_MXF_PROBE-$(call DEMDEC, MXF, DVVIDEO PCM_S16LE) += fate-mxf-probe-dv25
|
||||
fate-mxf-probe-dv25: SRC = $(TARGET_SAMPLES)/mxf/Avid-00005.mxf
|
||||
@ -37,7 +37,7 @@ fate-mxf-probe-dv25: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)"
|
||||
|
||||
FATE_MXF_PROBE-$(call DEMDEC, MXF, PRORES PCM_S24LE) += fate-mxf-probe-applehdr10
|
||||
fate-mxf-probe-applehdr10: SRC = $(TARGET_SAMPLES)/mxf/Meridian-Apple_ProResProxy-HDR10.mxf
|
||||
fate-mxf-probe-applehdr10: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)" | sed -e "s/yuv422p10../yuv422p10/"
|
||||
fate-mxf-probe-applehdr10: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)"
|
||||
|
||||
# Tests remuxing ProRes as well as writing mastering display metadata.
|
||||
FATE_MXF_FFMPEG_FFPROBE-$(call REMUX, MXF, PRORES_DECODER) += fate-mxf-remux-applehdr10
|
||||
|
@ -25,7 +25,7 @@ crop_top=0
|
||||
crop_bottom=0
|
||||
crop_left=0
|
||||
crop_right=0
|
||||
pix_fmt=yuv420p10le
|
||||
pix_fmt=yuv420p10
|
||||
sample_aspect_ratio=N/A
|
||||
pict_type=I
|
||||
interlaced_frame=0
|
||||
|
Reference in New Issue
Block a user