[HELP] FFMPEG Help - x265 HDR HLG Encoding from MXF - Printable Version +- Selur's Little Message Board (https://forum.selur.net) +-- Forum: Talk, Talk, Talk (https://forum.selur.net/forum-5.html) +--- Forum: A/V Talk (https://forum.selur.net/forum-6.html) +--- Thread: [HELP] FFMPEG Help - x265 HDR HLG Encoding from MXF (/thread-1985.html) |
FFMPEG Help - x265 HDR HLG Encoding from MXF - jan2ooo - 09.09.2021 Hey folks! I need a little help with my ffmpeg setup. Source: MXF Op1A XAVC100 Rec2020 HLG 50fps with 8 mono audio streams Now i need to convert this file to 25fps (frame drop) x265 (mp4 container) with correct meta data (video) and one more move to create a stereo track from audio stream 0 and 1 (the first two mono streams) and a 4sec offset (remove the first 4 seconds). I was able to encode the video stream correctly (I guess) and I was able to generate a stereo WAV from audio stream 0 and 1. But I was not able to combine both stringt to generate a h265/aac 320k mp4 stream. With the help of FastFlix I got this (without the 4sec offset): ffmpeg -y -i "INPUT.mxf" -max_muxing_queue_size 1024 -map 0:0 -c:v libx265 -pix_fmt yuv420p10le -x265-params "aq-mode=2:repeat-headers=0:strong-intra-smoothing=1:bframes=4:b-adapt=2:frame-threads=0:colorprim=bt2020:transfer=arib-std-b67:colormatrix=bt2020nc:hdr10_opt=0:hdr10=0:chromaloc=0" -crf:v 18 -preset:v slow -map_metadata -1 -r 25 -default_mode infer_no_subs "OUTPUT.MP4" And the WAV works this way: ffmpeg -i -ss 00:00:04.00 INPUT.mxf -filter_complex "[0:1][0:2]join=inputs=2:channel_layout=stereo[a]" -map "[a]" OUTPUT.wav But I was not able to combine these two commands and use aac instead of pcm wav. Thanks for your help! RE: FFMPEG Help - x265 HDR HLG Encoding from MXF - Selur - 09.09.2021 Have you tried something like: (can't test atm., so the following is untested) ffmpeg -ss 00:00:04.0 -i "INPUT.mxf" -vn -i "INPUT.mxf" -an -max_muxing_queue_size 1024 -c:v libx265 -pix_fmt yuv420p10le -x265-params "aq-mode=2:repeat-headers=0:strong-intra-smoothing=1:bframes=4:b-adapt=2:frame-threads=0:colorprim=bt2020:transfer=arib-std-67:colormatrix=bt2020nc:hdr10_opt=0:hdr10=0:chromaloc=0" -crf:v 18 -preset:v slow -filter_complex "[0:1][0:2]join=inputs=2:channel_layout=stereo[a]" -c:a libfaac -q:a 100 -map 1:0 -map "[a]" -map_metadata -1 -r 25 -default_mode infer_no_subs "OUTPUT.MP4" -ss 00:00:04.0 -i "INPUT.mxf" -vn -i "INPUT.mxf" -anf" -max_muxing_queue_size 1024 -c:v libx265 -pix_fmt yuv420p10le -x265-params "aq-mode=2:repeat-headers=0:strong-intra-smoothing=1:bframes=4:b-adapt=2:frame-threads=0:colorprim=bt2020:transfer=arib-std-67:colormatrix=bt2020nc:hdr10_opt=0:hdr10=0:chromaloc=0" -crf:v 18 -preset:v slow -filter_complex "[0:1][0:2]join=inputs=2:channel_layout=stereo[a]" -c:a libfaac -q:a 100 "[0:1][0:2]": take stream with index 1 and index 2 from the source with index 0 "join=inputs=2:channel_layout=stereo": join these inputs using a stereo layout "[a]": output as "a" -map 1:0 -map "[a]" -map_metadata -1 -r 25 -default_mode infer_no_subs "OUTPUT.MP4" Like I wrote I'm not sure whether the '-an' and '-vn' are necessary, so the above might still not work, but should give a hint how to do it. Cu Selur RE: FFMPEG Help - x265 HDR HLG Encoding from MXF - jan2ooo - 09.09.2021 Thanks a lot! I think I got it. ffmpeg -ss 4 -i "input.mxf" -ss 4.08 -i "input.mxf" -max_muxing_queue_size 1024 -c:v libx265 -pix_fmt yuv420p10le -x265-params "aq-mode=2:repeat-headers=0:strong-intra-smoothing=1:bframes=4:b-adapt=2:frame-threads=0:colorprim=bt2020:transfer=arib-std-67:colormatrix=bt2020nc:hdr10_opt=0:hdr10=0:chromaloc=0" -crf:v 18 -preset:v slow -filter_complex "[0:1][0:2]join=inputs=2:channel_layout=stereo[a]" -c:a aac -b:a 320k -map 1:0 -map "[a]" -map_metadata -1 -r 25 -tag:v hvc1 "output.MP4" -ss 4: 4 second offset for audio -ss 4.08: 4 seconds and 2 frames offset for video (I guess because of 50fps to 25fps conversion) -c:a aac -b:a 320k: libfaac is outdated.. (?) and I need CBR @ 320k -tag:v hcv1: works with Apple Quicktime I also deleted -vn and -an, because it results in "Stream map '1:0' matches disabled streams." error. One more thing: does -ss affect the encoding speed? I just rendered a small part, but it seems to be much slower (encoded 125 frames in 20.06s (6.23 fps) VS. encoded 227 frames in 22.63s (10.03 fps)). RE: FFMPEG Help - x265 HDR HLG Encoding from MXF - Selur - 09.09.2021 Quote:-c:a aac -b:a 320k: libfaac is outdated.. (?) and I need CBR @ 320knot necessarily, but libfaac isn't included in ffmpeg unless you compile it youself due to license restrictions. Quote:-ss 4.08: 4 seconds and 2 frames offset for video (I guess because of 50fps to 25fps conversion)Nope, frame rate change doesn't change offset, but encoding to aac might. Quote:One more thing: does -ss affect the encoding speed? I just rendered a small part, but it seems to be much slower (encoded 125 frames in 20.06s (6.23 fps) VS. encoded 227 frames in 22.63s (10.03 fps)).It should not, but the start will take a lot longer if your source doesn't have an index since then the first few seconds need to be decoded until the selected time is reached. Cu Selur |