#7157 closed defect (needs_more_info)
Fieild Order isn't recognized
| Reported by: | ponpon | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | undetermined |
| Version: | unspecified | Keywords: | |
| Cc: | Blocked By: | ||
| Blocking: | Reproduced by developer: | no | |
| Analyzed by developer: | no |
Description
Fieild Order isn't recognized
Source
ffmpeg -f lavfi -i yuvtestsrc=r=50 -vf tinterlace=interleave_top,setfield=mode=tff -x264opts tff=1 -t 1 -field_order tt -pix_fmt yuv420p -y tff.mp4
ffmpeg -i tff.mp4
ffmpeg version N-90810-g153e920892 Copyright (c) 2000-2018 the FFmpeg developers
built with clang version 5.0.1 (tags/RELEASE_501/final)
configuration: --prefix=/sw --cc=clang-mp-5.0 --cxx=clang++-mp-5.0 --disable-shared --enable-static --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --optflags=-Ofast --extra-cflags='-I/sw/include -I/opt/local/include ' --extra-ldflags=' -L/sw/lib -L/opt/local/lib -fopenmp' --extra-ldsoflags='-L/sw/lib -L/opt/local/lib -static--target-os=darwin' --arch=x86_64 --cpu=kabylake --enable-avresample --enable-libfdk-aac --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libxvid --enable-libfreetype --enable-gcrypt --enable-gmp --enable-openssl --enable-librtmp --enable-libass --enable-fontconfig --enable-libfribidi --enable-libbluray --enable-libdc1394 --enable-libmodplug --enable-lzma --enable-libx264 --enable-libx265 --enable-libzimg --enable-libvidstab --enable-libsoxr --enable-libsmbclient --enable-libcdio --enable-libtesseract --enable-opengl --enable-opencl --pkg-config-flags=' --libs --static'
libavutil 56. 15.100 / 56. 15.100
libavcodec 58. 19.100 / 58. 19.100
libavformat 58. 13.100 / 58. 13.100
libavdevice 58. 4.100 / 58. 4.100
libavfilter 7. 19.100 / 7. 19.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
libpostproc 55. 2.100 / 55. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tff.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.13.100
Duration: 00:00:01.00, start: 0.000000, bitrate: 24 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 14 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
At least one output file must be specified
ffprobe -select_streams v:0 -show_entries stream=field_order tff.mp4
ffprobe version N-90810-g153e920892 Copyright (c) 2007-2018 the FFmpeg developers
built with clang version 5.0.1 (tags/RELEASE_501/final)
configuration: --prefix=/sw --cc=clang-mp-5.0 --cxx=clang++-mp-5.0 --disable-shared --enable-static --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --optflags=-Ofast --extra-cflags='-I/sw/include -I/opt/local/include ' --extra-ldflags=' -L/sw/lib -L/opt/local/lib -fopenmp' --extra-ldsoflags='-L/sw/lib -L/opt/local/lib -static--target-os=darwin' --arch=x86_64 --cpu=kabylake --enable-avresample --enable-libfdk-aac --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libxvid --enable-libfreetype --enable-gcrypt --enable-gmp --enable-openssl --enable-librtmp --enable-libass --enable-fontconfig --enable-libfribidi --enable-libbluray --enable-libdc1394 --enable-libmodplug --enable-lzma --enable-libx264 --enable-libx265 --enable-libzimg --enable-libvidstab --enable-libsoxr --enable-libsmbclient --enable-libcdio --enable-libtesseract --enable-opengl --enable-opencl --pkg-config-flags=' --libs --static'
libavutil 56. 15.100 / 56. 15.100
libavcodec 58. 19.100 / 58. 19.100
libavformat 58. 13.100 / 58. 13.100
libavdevice 58. 4.100 / 58. 4.100
libavfilter 7. 19.100 / 7. 19.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
libpostproc 55. 2.100 / 55. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tff.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.13.100
Duration: 00:00:01.00, start: 0.000000, bitrate: 24 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 14 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
[STREAM]
field_order=unknown
[/STREAM]
Attachments (4)
Change History (16)
by , 8 years ago
comment:1 by , 8 years ago
comment:2 by , 8 years ago
| Resolution: | → needs_more_info |
|---|---|
| Status: | new → closed |
comment:3 by , 8 years ago
Sorry for not enough explanation.
As the above log, the fieild order of interlaced video made by libx264 isn't displayed.
On the other hand, mediainfo displays it.
mediainfo --"Output=Video;%ScanOrder%" tff.mp4 TFF
As reference, the fieild order of mpeg2 interlaced video made by ffmpeg is displayed as below.
ffmpeg -f lavfi -i yuvtestsrc=r=50 -vf tinterlace=interleave_top,setfield=mode=tff -c:v mpeg2video -flags +ildct+ilme -top 1 -t 1 -pix_fmt yuv420p -y tffmpeg2.vob
ffmpeg version N-92458-gfc94e9704e Copyright (c) 2000-2018 the FFmpeg developers
built with clang version 5.0.2 (tags/RELEASE_502/final)
configuration: --prefix=/sw --cc=clang-mp-5.0 --cxx=clang++-mp-5.0 --disable-shared --enable-static --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --optflags=-Ofast --extra-cflags='-I/sw/include -I/opt/local/include ' --extra-ldflags=' -L/sw/lib -L/opt/local/lib -fopenmp' --extra-ldsoflags='-L/sw/lib -L/opt/local/lib -static--target-os=darwin' --arch=x86_64 --cpu=kabylake --enable-avresample --enable-libfdk-aac --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libxvid --enable-libfreetype --enable-gcrypt --enable-gmp --enable-openssl --enable-librtmp --enable-libass --enable-fontconfig --enable-libfribidi --enable-libbluray --enable-libdc1394 --enable-libmodplug --enable-lzma --enable-libx264 --enable-libx265 --enable-libzimg --enable-libvidstab --enable-libsoxr --enable-libsmbclient --enable-libcdio --enable-opengl --enable-opencl --pkg-config-flags=' --libs --static'
libavutil 56. 23.101 / 56. 23.101
libavcodec 58. 39.100 / 58. 39.100
libavformat 58. 22.100 / 58. 22.100
libavdevice 58. 6.100 / 58. 6.100
libavfilter 7. 44.100 / 7. 44.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
Input #0, lavfi, from 'yuvtestsrc=r=50':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo (444P / 0x50343434), yuv444p, 320x240 [SAR 1:1 DAR 4:3], 50 tbr, 50 tbn, 50 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg2video (native))
Press [q] to stop, [?] for help
[svcd @ 0x7fff22856200] VBV buffer size not set, using default size of 230KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, svcd, to 'tffmpeg2.vob':
Metadata:
encoder : Lavf58.22.100
Stream #0:0: Video: mpeg2video (Main), yuv420p(top first), 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 90k tbn, 25 tbc
Metadata:
encoder : Lavc58.39.100 mpeg2video
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 25 fps=0.0 q=1.6 Lsize= 14kB time=00:00:00.92 bitrate= 124.7kbits/s speed=43.5x
video:12kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 20.127367%
Result of ffprobbe
ffprobe -select_streams v:0 -show_entries stream=field_order tffmpeg2.vob
ffprobe version N-92458-gfc94e9704e Copyright (c) 2007-2018 the FFmpeg developers
built with clang version 5.0.2 (tags/RELEASE_502/final)
configuration: --prefix=/sw --cc=clang-mp-5.0 --cxx=clang++-mp-5.0 --disable-shared --enable-static --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --optflags=-Ofast --extra-cflags='-I/sw/include -I/opt/local/include ' --extra-ldflags=' -L/sw/lib -L/opt/local/lib -fopenmp' --extra-ldsoflags='-L/sw/lib -L/opt/local/lib -static--target-os=darwin' --arch=x86_64 --cpu=kabylake --enable-avresample --enable-libfdk-aac --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libxvid --enable-libfreetype --enable-gcrypt --enable-gmp --enable-openssl --enable-librtmp --enable-libass --enable-fontconfig --enable-libfribidi --enable-libbluray --enable-libdc1394 --enable-libmodplug --enable-lzma --enable-libx264 --enable-libx265 --enable-libzimg --enable-libvidstab --enable-libsoxr --enable-libsmbclient --enable-libcdio --enable-opengl --enable-opencl --pkg-config-flags=' --libs --static'
libavutil 56. 23.101 / 56. 23.101
libavcodec 58. 39.100 / 58. 39.100
libavformat 58. 22.100 / 58. 22.100
libavdevice 58. 6.100 / 58. 6.100
libavfilter 7. 44.100 / 7. 44.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
Input #0, mpeg, from 'tffmpeg2.vob':
Duration: 00:00:00.72, start: 0.540000, bitrate: 159 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 320x240 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc
[STREAM]
field_order=tt
[/STREAM]
Result of mediainfo
mediainfo --"Output=Video;%ScanOrder%" tffmpeg2.vob TFF
The result of libx265 is also strange though it may be another ticket.
ffmpeg -f lavfi -i yuvtestsrc=r=50 -vf tinterlace=interleave_top,setfield=mode=tff -c:v libx265 -x265-params interlace=tff -t 1 -pix_fmt yuv420p -y tffx265.mp4
ffmpeg version N-92458-gfc94e9704e Copyright (c) 2000-2018 the FFmpeg developers
built with clang version 5.0.2 (tags/RELEASE_502/final)
configuration: --prefix=/sw --cc=clang-mp-5.0 --cxx=clang++-mp-5.0 --disable-shared --enable-static --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --optflags=-Ofast --extra-cflags='-I/sw/include -I/opt/local/include ' --extra-ldflags=' -L/sw/lib -L/opt/local/lib -fopenmp' --extra-ldsoflags='-L/sw/lib -L/opt/local/lib -static--target-os=darwin' --arch=x86_64 --cpu=kabylake --enable-avresample --enable-libfdk-aac --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libxvid --enable-libfreetype --enable-gcrypt --enable-gmp --enable-openssl --enable-librtmp --enable-libass --enable-fontconfig --enable-libfribidi --enable-libbluray --enable-libdc1394 --enable-libmodplug --enable-lzma --enable-libx264 --enable-libx265 --enable-libzimg --enable-libvidstab --enable-libsoxr --enable-libsmbclient --enable-libcdio --enable-opengl --enable-opencl --pkg-config-flags=' --libs --static'
libavutil 56. 23.101 / 56. 23.101
libavcodec 58. 39.100 / 58. 39.100
libavformat 58. 22.100 / 58. 22.100
libavdevice 58. 6.100 / 58. 6.100
libavfilter 7. 44.100 / 7. 44.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
Input #0, lavfi, from 'yuvtestsrc=r=50':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo (444P / 0x50343434), yuv444p, 320x240 [SAR 1:1 DAR 4:3], 50 tbr, 50 tbn, 50 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> hevc (libx265))
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 2.8+68-fa57fa584898
x265 [info]: build info [Mac OS X][clang 5.0.2][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [warning]: Support for interlaced video is experimental
x265 [info]: Main profile, Level-2 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: Slices : 1
x265 [info]: frame threads / pool features : 3 / wpp(4 rows)
x265 [warning]: Source height < 720p; disabling lookahead-slices
x265 [info]: Interlaced field inputs : tff
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut / bias: 25 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb : 1 / 1 / 0
x265 [info]: References / ref-limit cu / depth : 3 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 rskip signhide tmvp strong-intra-smoothing
x265 [info]: tools: deblock sao
Output #0, mp4, to 'tffx265.mp4':
Metadata:
encoder : Lavf58.22.100
Stream #0:0: Video: hevc (libx265) (hev1 / 0x31766568), yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 25 fps, 12800 tbn, 25 tbc
Metadata:
encoder : Lavc58.39.100 libx265
frame= 25 fps=0.0 q=-0.0 Lsize= 4kB time=00:00:00.88 bitrate= 41.0kbits/s speed=9.39x
video:1kB audio:0kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 258.393005%
x265 [info]: frame I: 1, Avg QP:26.62 kb/s: 74.40
x265 [info]: frame P: 5, Avg QP:33.00 kb/s: 5.24
x265 [info]: frame B: 19, Avg QP:35.74 kb/s: 4.52
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: consecutive B-frames: 16.7% 0.0% 0.0% 16.7% 66.7%
encoded 25 frames in 0.09s (291.11 fps), 7.46 kb/s, Avg QP:34.82
Result of ffprobe
ffprobe -select_streams v:0 -show_entries stream=field_order tffx265.mp4
ffprobe version N-92458-gfc94e9704e Copyright (c) 2007-2018 the FFmpeg developers
built with clang version 5.0.2 (tags/RELEASE_502/final)
configuration: --prefix=/sw --cc=clang-mp-5.0 --cxx=clang++-mp-5.0 --disable-shared --enable-static --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --optflags=-Ofast --extra-cflags='-I/sw/include -I/opt/local/include ' --extra-ldflags=' -L/sw/lib -L/opt/local/lib -fopenmp' --extra-ldsoflags='-L/sw/lib -L/opt/local/lib -static--target-os=darwin' --arch=x86_64 --cpu=kabylake --enable-avresample --enable-libfdk-aac --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libxvid --enable-libfreetype --enable-gcrypt --enable-gmp --enable-openssl --enable-librtmp --enable-libass --enable-fontconfig --enable-libfribidi --enable-libbluray --enable-libdc1394 --enable-libmodplug --enable-lzma --enable-libx264 --enable-libx265 --enable-libzimg --enable-libvidstab --enable-libsoxr --enable-libsmbclient --enable-libcdio --enable-opengl --enable-opencl --pkg-config-flags=' --libs --static'
libavutil 56. 23.101 / 56. 23.101
libavcodec 58. 39.100 / 58. 39.100
libavformat 58. 22.100 / 58. 22.100
libavdevice 58. 6.100 / 58. 6.100
libavfilter 7. 44.100 / 7. 44.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tffx265.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf58.22.100
Duration: 00:00:01.00, start: 0.000000, bitrate: 36 kb/s
Stream #0:0(und): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv, top coded first (swapped)), 320x240 [SAR 1:1 DAR 4:3], 10 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
Metadata:
handler_name : VideoHandler
[STREAM]
field_order=tb
[/STREAM]
Result of mediainfo
mediainfo --"Output=Video;%ScanOrder%" tffx265.mp4 TFF
by , 8 years ago
| Attachment: | tffmpeg2.vob added |
|---|
by , 8 years ago
| Attachment: | tffx265.mp4 added |
|---|
follow-up: 6 comment:5 by , 8 years ago
For mov/mp4 files, only fiel atom signals field order from stream level. And it is not set for h264 codec.
comment:6 by , 8 years ago
Replying to richardpl:
Thank you for your reply and help.
For h265,
[STREAM] field_order=tb [/STREAM]
is displayed though -x265-params interlace=tff is set.
Should I make a new ticket?
comment:8 by , 8 years ago
Replying to richardpl:
I understand that tb is top coded first and bottom displayed first.
I expected tt (top field coded and displayed first).
My misunderstanding?
follow-up: 10 comment:9 by , 8 years ago
For h265 case you do not set field_order at all.
For h264 i sent patch.
comment:10 by , 8 years ago
Replying to richardpl:
For h264 i sent patch.
GJ! The patch works well in my test!
For h265 case you do not set field_order at all.
Is -x265-params interlace=tff a wrong option?
comment:12 by , 8 years ago
Replying to richardpl:
Thank you for the explanation.
I am looking forward to merge your patch.
In my retest, progressive is not displayed. Is it normal?
ffmpeg -f lavfi -i yuvtestsrc=r=50 -t 1 -pix_fmt yuv420p -y prog.mp4
ffprobe -select_streams v:0 -show_entries stream=field_order prog.mp4
ffprobe version N-92499-gfe9b990ec9 Copyright (c) 2007-2018 the FFmpeg developers
built with clang version 5.0.2 (tags/RELEASE_502/final)
configuration: --prefix= --cc=clang-mp-5.0 --cxx=clang++-mp-5.0
libavutil 56. 23.101 / 56. 23.101
libavcodec 58. 39.100 / 58. 39.100
libavformat 58. 22.100 / 58. 22.100
libavdevice 58. 6.100 / 58. 6.100
libavfilter 7. 46.100 / 7. 46.100
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'prog.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.22.100
Duration: 00:00:01.00, start: 0.000000, bitrate: 26 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 15 kb/s, 50 fps, 50 tbr, 12800 tbn, 100 tbc (default)
Metadata:
handler_name : VideoHandler
[STREAM]
field_order=unknown
[/STREAM]



It is written in frames, use -show_frames with ffprobe.