Exported Video Not Interlaced


#1

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.


#2

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.


#5

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.


#6

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.


#7

This code produces interlaced, 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 vcodec="mpeg2video" target="D:/Videos/InterlaceTest.avi" audio_off="1" height="1080" bf="3" rescale="hyper" an="1" vmaxrate="6M" vminrate="6M" top_field_first="1" aspect="1.77778" vbufsize="12288000" width="1920" real_time="-4" g="300" deinterlace_method="yadif" threads="7" sc_threshold="0" f="mxf" progressive="0" vb="6M" 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>

MediaInfo output:

Video
ID                                       : 2
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main@High
Format settings                          : BVOP
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Default
Format settings, GOP                     : M=4, N=300
Format settings, picture structure       : Frame
Format settings, wrapping mode           : Frame
Codec ID                                 : 0D01030102046001-0401020201030300
Duration                                 : 2 min 57 s
Bit rate mode                            : Variable
Bit rate                                 : 6 000 kb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 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                                : Interlaced
Scan order                               : Top Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.048
Time code of first frame                 : 00:00:00:00
Time code source                         : Group of pictures header
Stream size                              : 127 MiB (94%)
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Other #1
ID                                       : 1-Material
Type                                     : Time code
Format                                   : MXF TC
Time code of first frame                 : 00:00:00:00
Time code settings                       : Material Package
Time code, striped                       : Yes

Other #2
ID                                       : 1-Source
Type                                     : Time code
Format                                   : MXF TC
Time code of first frame                 : 00:00:00:00
Time code settings                       : Source Package
Time code, striped                       : Yes

Other #3
Type                                     : Time code
Format                                   : SMPTE TC
Muxing mode                              : SDTI
Time code of first frame                 : 00:00:00:01

#8

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.

https://sourceforge.net/p/mediainfo/discussion/297609/thread/ccb20cb7/


#9

Thanks for the excellent detective work.

It looks like the video is interlaced after all.


#10

http://www.aktau.be/2013/09/22/detecting-interlaced-video-with-ffmpeg/