Standard pal tag with 1920x1080

Questions involving a Windows version of FFmpeg.
Post Reply
Drizzik
Posts: 2
Joined: Tue Oct 15, 2019 8:09 am

Standard pal tag with 1920x1080

Post by Drizzik » Tue Oct 15, 2019 8:15 am

Hello

I am looking for a way to have the mediainfo "<standard>PAL</standard> " tag with a 1920x1080 video.
It's maybe a stupid question but I tried many things and nothing worked.

Hope that makes sense! Many thanks.

Reino
Posts: 91
Joined: Thu Aug 22, 2013 5:14 pm
Contact:

Re: Standard pal tag with 1920x1080

Post by Reino » Tue Oct 15, 2019 11:40 pm

I could be wrong, but afaik is PAL a standard from before the High Definition era. So no, it doesn't make sense and is impossible if you ask me.

Drizzik
Posts: 2
Joined: Tue Oct 15, 2019 8:09 am

Re: Standard pal tag with 1920x1080

Post by Drizzik » Wed Oct 16, 2019 7:24 am

That's what thought but I have some files transcoded by companies with the flag.
https://pastecode.xyz/view/ac09a472

here is the mediainfo I got from their file

EDIT:
I just got the answer so if you're interested

"You can set the video standard metadata to PAL:

ffmpeg -i in.mp4 -bsf:v h264_metadata=video_format=1 pal.mp4
Assuming video encoding is H.264 (AVC).

It doesn't make sense to mark 1920x1080 video as PAL, because PAL standard resolution is about 720x576 (not HD), but you can still set the metadata.

The metadata is described in a table in ISO/IEC 14496-10 document:

video_format indicates the representation of the pictures as specified in Table E-2, before being coded in accordance with this Recommendation | International Standard. When the video_format syntax element is not present, video_format value shall be inferred to be equal to 5.

Table E-2 – Meaning of video_format
video_format Meaning
0 Component
1 PAL
2 NTSC
3 SECAM
4 MAC
5 Unspecified video format

The FFmpeg h264_metadata is documented in FFmpeg Bitstream Filters Documentation"
by Rotem

pandy
Posts: 255
Joined: Mon Feb 24, 2014 1:46 pm

Re: Standard pal tag with 1920x1080

Post by pandy » Wed Oct 16, 2019 5:24 pm

You can control libx264 trough private codec options, for example:

Code: Select all


@SET 

x264opts="crf=%quality%:level=4.0:qpmin=8:vbv_maxrate=16000:vbv_bufsize=12000:cabac=1:interlaced=0:no_psnr=1:no_ssim=1:bluray_compat=1:open-gop=0:pic_struct=1:aud=1:nal_hrd=vbr:force_cfr=1:fullrange=off:overscan=show:colorprim=bt709:transfer=bt709:colormatrix=bt709:stitchable=1"

ffmpeg.exe -y -hide_banner -loglevel 32 -i %filename% -c:v libx264 -preset faster -tune film -profile:v high -level:v 4.0 -x264opts %x264opts% -x264-params %x264opts% -movflags faststart -f mp4 "%~n1_.mp4"

Such metadata are supported by x264:

Code: Select all

Video Usability Info (Annex E):
The VUI settings are not used by the encoder but are merely suggestions to
the playback equipment. See doc/vui.txt for details. Use at your own risk.

      --overscan <string>     Specify crop overscan setting ["undef"]
                                  - undef, show, crop
      --videoformat <string>  Specify video format ["undef"]
                                  - component, pal, ntsc, secam, mac, undef
      --range <string>        Specify color range ["auto"]
                                  - auto, tv, pc
      --colorprim <string>    Specify color primaries ["undef"]
                                  - undef, bt709, bt470m, bt470bg, smpte170m,
                                    smpte240m, film, bt2020, smpte428,
                                    smpte431, smpte432
      --transfer <string>     Specify transfer characteristics ["undef"]
                                  - undef, bt709, bt470m, bt470bg, smpte170m,
                                    smpte240m, linear, log100, log316,
                                    iec61966-2-4, bt1361e, iec61966-2-1,
                                    bt2020-10, bt2020-12, smpte2084, smpte428
      --colormatrix <string>  Specify color matrix setting ["???"]
                                  - undef, bt709, fcc, bt470bg, smpte170m,
                                    smpte240m, GBR, YCgCo, bt2020nc, bt2020c,
                                    smpte2085
      --chromaloc <integer>   Specify chroma sample location (0 to 5) [0]
      --nal-hrd <string>      Signal HRD information (requires vbv-bufsize)
                                  - none, vbr, cbr (cbr not allowed in .mp4)
      --filler                Force hard-CBR and generate filler (implied by
                              --nal-hrd cbr)
      --pic-struct            Force pic_struct in Picture Timing SEI
      --crop-rect <string>    Add 'left,top,right,bottom' to the bitstream-level
                              cropping rectangle 

So by adding 'videoformat=pal' to private libx264 options you should be able to mimic metadata coded in provided reference.

Code: Select all


@SET 

x264opts="crf=%quality%:level=4.0:qpmin=8:vbv_maxrate=16000:vbv_bufsize=12000:cabac=1:interlaced=0:no_psnr=1:no_ssim=1:bluray_compat=1:open-gop=0:pic_struct=1:aud=1:nal_hrd=vbr:force_cfr=1:fullrange=off:overscan=show:colorprim=bt709:transfer=bt709:colormatrix=bt709:videoformat=pal:stitchable=1"

ffmpeg.exe -y -hide_banner -loglevel 32 -i %filename% -c:v libx264 -preset faster -tune film -profile:v high -level:v 4.0 -x264opts %x264opts% -x264-params %x264opts% -movflags faststart -f mp4 "%~n1_.mp4"


Post Reply
'