View Single Post
Old 4th June 2019, 00:48   #1  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,902
ffmpeg Lavc MPEG2 encoder regression

Hi,
there's a regression in ffmpeg 20190603-0b7bfa8 which uses a (probably) newer/different version of the Lavc MPEG2 encoder.
With the new version, encoding in XDCAM with the very same option as before creates a legit file, which is fine metadata-wise and is playable without any issue, however BBC BMX Transwrap cannot remux it and AVID Media Composer 2018.12 fails to import it. Encoding the very same file with an older version of ffmpeg (like the one from the end of May 2018) creates a legit XDCAM file which is also recognized by AVID Media Composer for the import and by Vantage Telestream for the interplay-check in.

To reproduce the error, you can use the following scripts:

Avisynth Script:

Code:
#Indexing
video=FFVideoSource("UDN05483.mov")
audiook=FFAudioSource("UDN05483.mov")
audio=MergeChannels(audiook, audiook, audiook, audiook)
AudioDub(video, audio)

#Loudness Correction
ResampleAudio(48000)
Normalize(0.22)
ConvertAudioTo24bit()

#Clipping
Limiter(min_luma=16, max_luma=235, min_chroma=16, max_chroma=240)

#Blending
ConvertFPS(50)

#Downscale
Spline64ResizeMT(1920, 1080)

#Interlacing
assumeTFF()
separatefields()
selectevery(4,0,3)
weave()
Converttoyv16(matrix="Rec709", interlaced=true)
BAT File:

Code:
ffmpeg.exe -hwaccel dxva2 -i "AVS Script.avs" -threads 56 -pix_fmt yuv422p -vcodec mpeg2video -s 1920:1080 -aspect 16:9 -flags +ildct+ilme -r 25 -b:v 50000k -minrate 50000k -maxrate 50000k -bufsize 36408333 -af loudnorm=I=-24:LRA=1 -acodec pcm_s24le -ar 48000 -g 12 -bf 2 -profile:v 0 -level:v 2 -color_range 1 -color_primaries 1 -color_trc 1 -colorspace 1 -f mxf "output.mxf"

bmxtranswrap.exe -p -y 10:00:00:00 -t op1a -o "final.mxf" "output.mxf"

PAUSE

Whatever your source file is, it doesn't matter and the way you index it doesn't matter either, ffmpeg will always create an XDCAM File which can't be imported by AVID or checked-in in Interplay by Vantage Telestream, which is annoying as I had to revert to an older version.
The old version of ffmpeg and Lavc MPEG-2 encoder, which was the 58.20.101, wasn't perfect either as it was prone to create issues like this one unless remuxed and even with the remux it wasn't always 100% complaint, but at least it was creating files that were recognized and it was possible to import them via AVID Media Composer or check them in Interplay automatically via Telestream Vantage.
I just wanted to report it 'cause something is definitely wrong in the new version.

Cheers,
Frank.
FranceBB is offline   Reply With Quote