Trying to transcode 720 progressive or 1080 progressive to 1080 interlaced, TFF.
“Interlaced” and “Top Field First” are selected in “Video” box of advanced export settings.
MediaInfo reports the scan type of exported video is still Progressive.
FWIW, I’m told ffmpeg needs -vf tinterlace=4 to do proper interlacing, top field first.
-vf tinterlace=5 gives bottom field first.
When making this conversion the interlaced frame rate (2 fields) should be half the progressive frame rate, e.g. 59.94 frames progressive would be 29.97 frames interlaced.
I just made a test of 720p to 720i using the Export default without hardware encoder but making the changes to Scan mode and Field order, and it worked:
Scan type : MBAFF
Scan type, store method : Interleaved fields
Scan order : Top Field First
I just made another test, this time changing resolution in export from 1280x720 to 1920x1080, and that also succeeded.
What are your full export settings? I also need to know if you are changing the resolution, aspect ratio, or frame rate. Basically, upload the XML of the export job. It has been reported that ffmpeg does not write interlace correct using some combinations of container and codec, or at least not in a way that agrees with mediainfo and maybe some video players.
Shotcut is not a ffmpeg command line front-end except for Properties > Reverse/Convert/Extract. Those rules do not apply here.
That XML is missing the critical <consumer> element that I need to see because it was not taken from the export JOB. The consumer contains all of the export settings. Please right-click an export job and choose View XML.
This XML job code fails to deliver interlaced output according to MediaInfo:
<?xml version='1.0' encoding='utf-8'?>
<mlt parent="producer0" title="Shotcut version 19.04.30" out="00:02:57.174" in="00:00:00.000" root="C:\Program Files\Shotcut" version="6.15.0" LC_NUMERIC="en_US">
<profile width="1280" description="HD 1080p 25 fps" sample_aspect_den="1" frame_rate_den="1001" display_aspect_num="16" height="720" sample_aspect_num="1" display_aspect_den="9" colorspace="709" progressive="1" frame_rate_num="60000"/>
<consumer ab="192k" vcodec="mpeg2video" acodec="pcm_s16le" channels="2" target="D:/Videos/InterlaceTest.avi" height="720" bf="0" rescale="hyper" qscale="1" top_field_first="1" aspect="1.77778" width="1280" real_time="-4" g="1" deinterlace_method="yadif" threads="7" ar="48000" f="avi" progressive="0" mlt_service="avformat"/>
<producer title="Shotcut version 19.04.30" id="producer0" out="00:02:57.174" in="00:00:00.000">
<property name="length">00:02:57:11</property>
<property name="eof">pause</property>
<property name="resource">D:/Programs/ffmpeg/BroadcastVideo/C0008.MP4</property>
<property name="audio_index">1</property>
<property name="video_index">0</property>
<property name="mute_on_pause">0</property>
<property name="mlt_service">avformat-novalidate</property>
<property name="seekable">1</property>
<property name="aspect_ratio">1</property>
<property name="creation_time">2018-09-19T22:31:52</property>
<property name="shotcut:hash">2e3fb1c98410c3b5318df9ac43bff91a</property>
<property name="ignore_points">0</property>
<property name="shotcut:caption">C0008.MP4</property>
<property name="shotcut:skipConvert">1</property>
<property name="global_feed">1</property>
<property name="xml">was here</property>
<property name="shotcut:projectAudioChannels">2</property>
<property name="shotcut:projectFolder">0</property>
</producer>
</mlt>
Here is the output from MediaInfo:
Video
ID : 0
Format : MPEG Video
Format version : Version 2
Format profile : Main@High 1440
Format settings, BVOP : No
Format settings, Matrix : Default
Format settings, GOP : N=1
Format settings, picture structure : Frame
Codec ID : mpg2
Codec ID/Info : (MPEG-1/2) FFmpeg
Codec ID/Hint : Ffmpeg
Duration : 2 min 57 s
Bit rate mode : Variable
Bit rate : 170 Mb/s
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate : 59.940 (60000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Original scan type : Interlaced
Original scan order : Top Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 3.070
Stream size : 3.50 GiB (99%)
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Is there a bug in Shotcut or MediaInfo? The scan type of the original is progressive according to the camcorder manufacturer (Sony) despite what MediaInfo says.
MediaInfo is reporting “Original scan type: Interlaced” and Shotcut Properties reports the output AVI as interlaced (according to FFmpeg libs). An older version of MediaInfo that I have (v0.7.75) does not report two different scan types. I think you are mislead by what it is reporting. I think it is reporting that the video is coded as interlace but the AVI lacks some metadata indicating interlace, which would be a shortcoming of either the format or ffmpeg’s avi muxer.
I confirmed (with SC and Telestream) that the test interlaced video is indeed TFF.
Don’t know what version you used, perhaps the “ident” filter is broken in the latest version.
EDIT:
Results seem to vary depending on codec used.
Below a test of some footage from a Blu-ray which is correct, whilst my previous test
with a XDCAM (essentially mpeg2) video was completely wrong:
I’m getting the same results. It appears anything to do with interlace in ffmpeg is broken, or at least is too questionable to be trusted. I also tested all 7 modes of ffmpeg’s tinterlace filter and it reported them all “undetermined”.
ffmpeg is broken as far as interlacing goes and MediaInfo does not actually check the frames/fields, it just relies on the flags being properly set and reports those.
I can tell you that exports with SC (still using 19.04), using XDCAM and DNxHD in mxf (not mov) are properly interlaced.
Have confirmed with Telestream, CineXtools and actually playing them out of our Omneon servers for broadcasts.
Had a closer look at the acrovid software and I see they use not only MediaInfo.dll, but also
avcodec-58.dll, avformat-58.dll and avfilter-7.dll.
AFAIK they are from the ffmpeg family, even the LGPL.txt file is included in the installation.
This then poses two questions:
If they are from ffmpeg and MediaInfo, how accurate are they?
If somehow it is accurate, the API calls to these dll’s should be documented somewhere and hence making a pgm to interface to the libs and extracting codec/scan info from a clip should be do-able.
EDIT
Just checked, it does use the libs from ffmpeg and MediaInfo:
Would you mind testing H.264 and H.265 for interlace as exported by Shotcut using Telestream, CineXtools and your Omneon servers? You need to be in 1920 x 1080 and “CRF=0” must be present in the “Other” field.
This would be useful information if you must deliver to CBS, NBC or PBS.
Sorry about the delay, had some shows to take care of.
OK, the results:
We don’t normally accept footage in H.264 or 265 but I tried it anyway.
The H.265 was rejected (could be a codec issue) and the H.264 was accepted but failed for a number of reasons.
Even though my source was XDCAM 50i 4:2:2, the resulting chroma was 4:2:0
I suspect that most broadcasters will not accept 4:2:0 as well.
You may have to add a “pix_fmt …” option to SC.
The output was “interlaced” but failed on the account that it was MBAFF.
MBAFF = Macroblock-Adaptive Frame/Field Coding and although flagged as interlaced, there
is no guarantee that the actual frames are interlaced.
The resulting GOP was IPIPPPPPPBPPPPPPPB…Then only frame 125 was I again.
We only accept all I frame or long GOP mpeg2 which is IBBPBBPBBPBBI,
i.e. every 12th frame must be an I frame.
Other broadcasters may have similar criteria.
You will need to adjust the GOP length in SC to suit.
I left the GOP length to the SC default which I only checked after the results and sure enough
it was set to 125.
The CRF=0 flag made no difference, the results were the same in both cases.
So the safe option is XDCAM which is 4:2:2 and uses the mpeg-2 encoder. Do you agree?
“my source was XDCAM 50i 4:2:2”
Is that 50 fields per second which equals 25 frames per second?
In the U.S. some services are distributing in H.264.
Thanks again. I may have more later if you’re game, but so far this information is very useful.
I found I wasn’t getting interlace from Shotcut in H.265 without the CRF=0 line, but it’s kind of moot now.
It might be worthwhile to check some progressive-scan clips as well as interlace. Something tells me it’s not going to have an easy time with anything but mpeg-2. Those QC power tools are kind of pricey and we have determined that ffmpeg and MediaInfo aren’t of much use.