VideoHelp Forum

+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. Member
    Join Date
    Jun 2020
    Location
    Sydney, Australia
    Search Comp PM
    Hello everyone,

    I am having an issue creating an RDD9 compliant MXF using FFMPEG within FFASTrans.
    I am transcoding from a QT Pro Res 422 HQ MOV to XDCAM MXF then re-wrapping using BMX Trans Wrap to ensure RDD9 compliance.

    The expected file specs after transcode are:

    PAL 1920x1080 50i XDCAM 422 50mbps long-gop, closed gop. M=3, N=12
    2x AES PCM audio streams, 1 channel in each.

    My command is as follows:

    c:\FFAStrans1.0.0\FFAStrans1.0.0\Processors\ffmpeg \x64>ffmpeg.exe -i "z:\100_incoming_media\OM_TEST.mov" -profile:v 0 -level:v 2 -map 0:1 -r 25 -pix_fmt yuv422p -aspect 16:9 -intra_vlc 1 -b:v 50000000 -minrate 50000000 -maxrate 50000000 -bufsize 17825792 -rc_init_occupancy 17825792 -sc_threshold 1000000000 -non_linear_quant 1 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -seq_disp_ext 1 -video_format component -color_range 1 -chroma_sample_location topleft -signal_standard 4 -dc 8 -qmin 3 -qmax 28 -mpv_flags +strict_gop -strict 1 -g 12 -bf 2 -field_order tt -top 1 -flags +cgop+ildct+ilme -alternate_scan 1 -map 0:2 -map 0:3 "z:\10000_temp\MXFTEST\OM_Test_Out.mxf"

    Everything is fine, except for the GOP structure.
    Running FFProbe, the GOP structure is IBB PBB PBB PBP
    I submit this to clients Baton File QC and they fail it, as the expected GOP is: IBB PBB PBB PBB

    If I remove the +cgop flag from the command I do get the desired IBB PBB PBB PBB
    But as expected, the GOP isn't closed and fails file QC.

    What else is interesting, doing the exact same transcode with the same parameters within Telestreams Vantage transcoding system
    I get a GOP structure that looks like this at the very beginning "BB IBB PBB PBB PBB". It opens with two B frames at the beginning of the file and then subsequently follows the correct closed GOP pattern throughout.

    I'm thinking I am either doing something wrong with the FFMPEG Command, or just missing something.
    Or the outputted file from FFMPEG and its GOP structure is correct and Baton File QC parameters are being too strict.
    Or there is slim chance that there is bug with FFMPEG creating XDCAM Closed Gop files.

    At the end of the day, it's down to the difference between a "B" frame and "P" frame at the end of a Closed GOP outputted from FFMPEG.
    I understand that Closed GOPs are separate and don't cross reference each other, hence why there would be a P frame at the end of the closed GOP and not a B frame...
    Just annoying that the clients Baton file QC says this can't be so... a literal "computer says no" moment.

    Anways, hope this made sense. Happy to clarify further.
    Quote Quote  
  2. Did you ever get this worked out? I suspect your "client" is the same as mine

    This thread (https://ffmpeg-user.ffmpeg.narkive.com/TXOnNTfT/ffmpeg-mpeg-2-gop-structure) suggests that the issue is with FFMPEG, though.
    Quote Quote  
  3. Member
    Join Date
    Jun 2020
    Location
    Sydney, Australia
    Search Comp PM
    Hello magarnicle,

    Ii did. In the end I just had to have a sit down with the client and explain that just because Baton QC software is complaining, doesn't necessarily mean it won't fail on play out.

    Just a pedantic Client at the end of the day.

    I'm in the middle of a house move, but can send you tomorrow the ffmpeg code I use for our client, if you like.
    Quote Quote  
  4. Oh, that would be great! Thanks.
    Quote Quote  
  5. Member
    Join Date
    Jun 2020
    Location
    Sydney, Australia
    Search Comp PM
    Sorry for the late reply mate!,

    here is the FFmpeg parameters I used:

    -profile:v 0 -level:v 2 -map 0:0 -r 25 -pix_fmt yuv422p -aspect 16:9 -intra_vlc 1 -b:v 50000000 -minrate 50000000 -maxrate 50000000 -bufsize 17825792 -rc_init_occupancy 17825792 -sc_threshold 1000000000 -bf 2 -non_linear_quant 1 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -seq_disp_ext 1 -video_format component -color_range 1 -chroma_sample_location topleft -signal_standard 4 -dc 8 -qmin 3 -qmax 28 -strict 2 -g 12 -mpv_flags +strict_gop -field_order tt -top 1 -flags +ildct+ilme+cgop -alternate_scan 1 -map 0:1 -map 0:2

    I also use BMXTransWrap as well, to re-wrap it to an RDD9 compliant container.
    https://sourceforge.net/p/bmxlib/home/Home/

    I do all this within FFAStrans - as its all part of greater workflow/automation.
    https://ffastrans.com/wp/

    Hope this helps.
    Quote Quote  
  6. Forgot to thank you for this!

    For anyone who stumbles across this later, I spied on what FFAStrans was doing to wrap the file and it was just calling ffmpeg again. I'm not entirely sure about all the flags being called, but the workflow I've found that got files that were accepted by the client was to call ffmpeg twice, first to encode then second to wrap it:

    Encode based on ausmetal's answer:

    ffmpeg -i "$input_file" -y -vcodec mpeg2video -ar:a:1 48000 -b:a:1 1152000 -minrate:a:1 1152000 -c:a:1 pcm_s24le -profile:v 0 -level:v 2 -r 25 -pix_fmt yuv422p -aspect 16:9 -intra_vlc 1 -b:v 50000000 -minrate:v 50000000 -maxrate:v 50000000 -bufsize 17825792 -rc_init_occupancy 17825792 -sc_threshold 1000000000 -bf 2 -b_strategy 0 -keyint_min 12 -non_linear_quant 1 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -seq_disp_ext 1 -video_format component -color_range 1 -chroma_sample_location topleft -signal_standard 4 -dc 8 -qmin 3 -qmax 28 -strict 2 -g 12 -mpv_flags +strict_gop -field_order tt -top 1 -flags +ildct+ilme+cgop -alternate_scan 1 \
    -ar:a:0 48000 -b:a:0 1152000 -minrate:a:0 1152000 -c:a:0 pcm_s24le \
    "$output_file"

    I've left out mapping channels, as that depends on the structure of the input file.

    Wrap:
    ffmpeg -analyzeduration 33554432 \
    -hide_banner -follow 1 -rw_timeout 1000000 -i "$input_file" -f lavfi -i aevalsrc=0 -f lavfi -i color=color=blackize=1920x1080 -shortest -map_metadata -1 -map 0:0 -map 0:1 -map 0:2 -c:a:0 pcm_s24le -c:a:1 pcm_s24le -c:a:2 pcm_s24le -timecode 00:00:00:00 -ignore_unknown -c:v copy -r 25 -f mxf -max_muxing_queue_size 700 -map_metadata -1 -metadata creation_time=now -y "$output_file"

    If I knew ffmpeg better I'm sure this could all be done in one call, but the second is very quick to run so I have no incentive to fix this up any more.
    Quote Quote  



Similar Threads