ffmpeg MXF HDF01
It must be in two steps to get HDF01 files. First transcode with ffmpeg:
{{ $stfldCmd := "" }}
{{ $deintCmd := "" }}
{{ $cropCmd := "" }}
{{ $scaleCmd := "" }}
{{ $padCmd := "" }}
{{ $interlfpsCmd := "" }}
{{ $colorspaceCmd := "" }}
{{ $vfCmd := "" }}
{{ $audioIn := "" }}
{{ $amergeCmd := "" }}
{{ $asplitCmd := "" }}
{{ $audioMapCmd := "" }}
{{/* bwdif=1:-1:1 = Auto bwdif=1:0:1 = TFF bwdif=1:1:1 = BFF */}}
{{/* wenn scanntype nicht progressiv und nicht unbekannt und height=1080 und (framerate 25/1 oder 50/2) */}}
{{ $scanntype := .GetMIValue "video" "ScanType" 0}}
{{ $format := .GetMIValue "general" "Format_Commercial_IfAny" 0 }}
{{ if eq $scanntype "Interlaced" }}
{{ $deintCmd = "bwdif=1:-1:0,scale=1920:1080,interlace=tff:2" }}
{{ else if eq $format "IMX 50" }}
{{ $deintCmd = "bwdif=1:-1:1,crop=in_w:in_h-32:0:32:1,scale=1920:1080,interlace=tff:2" }}
{{ end }}
{{ $audioIn = "[0:a]" }}
{{if ne $deintCmd ""}}
-vf
{{ $deintCmd }}
{{ else }}
-vf
scale=1920:1080,interlace=tff:2
{{end}}
-sws_flags
lanczos
-r
25
-c:v
mpeg2video
-pix_fmt
yuv422p
-aspect
16:9
-field_order
tt
-top
1
-flags
+ildct+ilme
-alternate_scan
1
-color_range
tv
-color_primaries
bt709
-color_trc
bt709
-colorspace
bt709
-dc
10
-intra_vlc
1
-non_linear_quant
1
-g
12
-bf
2
-qscale:v
1
-qmin
1
-lmin
1*QP2LAMBDA
-qmax
28
-lmax
56*QP2LAMBDA
-b:v
50000000
-minrate
50000000
-maxrate
50000000
-bufsize
17825792
-rc_init_occupancy
17825792
-sc_threshold
1000000000
-map
0:v:0
{{/*-map_channel [input_file_id.stream_specifier.channel_id|-1][?][:output_file_id.stream_specifier]*/}}
{{ $count := 0 }}
{{ if eq .GetNumberOfAudioChannels 0 }}
{{ .SetVariable "no_audio" true }}
{{ else }}
-acodec
pcm_s24le
-ar
48000
-ac
1
{{ .SetVariable "no_audio" false }}
{{ range $i, $e := until .GetNumberOfAudioChannels }}
{{ $Stereo := $.IsStereo (int (add1 $i)) }}
{{ if and (eq $Stereo true) (lt $count 8)}}
-filter_complex
[0:a:0]channelsplit=channel_layout=stereo[{{$count}}][{{add1 $count}}]
-map
[{{$count}}]
{{ $count = add1 $count }}
-map
[{{$count}}]
{{ $count = add1 $count }}
{{ else if and (ne $Stereo true) (lt $count 9)}}
-map
0:a:{{$count}}?
{{ $count = add1 $count }}
{{ end }}
{{ end }}
{{ end }}
{{ .AddVariable "noas" "int" $count }}
-f
mxf
Second wrap with bmxtranswrap:
--ard-zdf-hdf
-t
rdd9
--prod-info
DW
VITA-BMXTranswrap
{{ env "VUE_APP_VERSION" }}
VITA-{{ env "VUE_APP_VERSION" }}-bmx
976a6a86-78fb-4915-92d2-481aaae47878
--afd
8
-a
16:9
{{ $noas := int64 (.GetVariable "noas") }}
{{ if eq $noas 8 }}
--track-map
mono
{{ else }}
--track-map
m0-{{ sub $noas 1 }},s{{ sub 8 $noas }}
{{ end }}
-o
These code snippets are from Thomas Boda DW.
No comments to display
No comments to display