Following php func might help u: private static function checkForScanType($ffmpegBin, $srcFileName, $frames=1000) { /* [Parsed_idet_0 @ 0000000000331de0] Single frame detection: TFF:1 BFF:96 Progressive:2 Undetermined:1 [Parsed_idet_0 @ 0000000000331de0] Multi frame detection: TFF:0 BFF:100 Progressive:0 Undetermined:0 */ if(stristr(PHP_OS,'win')) $nullDev = "NULL"; else $nullDev = "/dev/null";
$cmdLine = "$ffmpegBin -filter:v idet -frames:v $frames -an -f rawvideo -y $nullDev -i $srcFileName -nostats 2>&1"; $lastLine=exec($cmdLine , $outputArr, $rv); if($rv!=0) { return 0; } $tff=0; $bff=0; $progessive=0; $undermined=0; foreach($outputArr as $line){ if(strstr($line, "Parsed_idet")==false) continue; $str = strstr($line, "TFF"); sscanf($str,"TFF:%d BFF:%d Progressive:%d Undetermined:%d", $t, $b, $p, $u); $tff+=$t; $bff+=$b; $progessive+=$p; $undermined+=$u; } $scanType = 0; // Default would be 'progressive' if($progessive<$tff+$bff) $scanType = 1; return $scanType; } On Thu, Feb 18, 2016 at 2:07 PM, Andy Furniss <adf.li...@gmail.com> wrote: > Just idle messing around, wanted to make an interlaced prores just to see > how players/deinterlacers handled it. > > Below is just a shortened example - also tried some variants + prores_ks > 4444/hq. > > My commands all fail in the sense that that ffprobe -show_frames doesn't > show interlaced. > > What I do see is that mediainfo shows interlaced and tff/bff as set by me. > > The question is how to see this with ffmpeg/ffprobe? > > I tried ffprobe -show_streams or -show_format - no mention. > > ffmpeg -i foo -f ffmetadata ffmeta.log = no mention. > > test case + console. > > grab a few interlaced frames into a dir > > wget > ftp://vqeg.its.bldrdoc.gov/HDTV/SVT_MultiFormat/1080i25_CgrLevels_SINC_FILTER_SVTdec05_/4_InToTree_1080i25_CgrLevels_SINC_FILTER_SVTdec05_/0256* > > I know the command is "wrong" for colour etc - just a minimal test. > > ffmpeg -f image2 -pattern_type glob -framerate 25 -i '02*.sgi' -vf > setfield=tff -c:v prores 1080i25.mov > ffmpeg version N-78563-g4dc5880 Copyright (c) 2000-2016 the FFmpeg > developers > built with gcc 5.3.0 (GCC) > configuration: --prefix=/usr --disable-doc --enable-gpl --enable-libzimg > --enable-libvpx --enable-libx265 --enable-libdcadec --enable-libmp3lame > --enable-libx264 > libavutil 55. 17.103 / 55. 17.103 > libavcodec 57. 24.103 / 57. 24.103 > libavformat 57. 25.100 / 57. 25.100 > libavdevice 57. 0.101 / 57. 0.101 > libavfilter 6. 32.100 / 6. 32.100 > libswscale 4. 0.100 / 4. 0.100 > libswresample 2. 0.101 / 2. 0.101 > libpostproc 54. 0.100 / 54. 0.100 > Input #0, image2, from '02*.sgi': > Duration: 00:00:00.40, start: 0.000000, bitrate: N/A > Stream #0:0: Video: sgi, rgb48be, 1920x1080, 25 tbr, 25 tbn, 25 tbc > [prores @ 0x30a8200] encoding with ProRes standard (apcn) profile > [prores @ 0x30cdac0] encoding with ProRes standard (apcn) profile > [prores @ 0x3111d00] encoding with ProRes standard (apcn) profile > [prores @ 0x3116660] encoding with ProRes standard (apcn) profile > [prores @ 0x309b620] encoding with ProRes standard (apcn) profile > Output #0, mov, to '1080i25.mov': > Metadata: > encoder : Lavf57.25.100 > Stream #0:0: Video: prores (apcn / 0x6E637061), yuv422p10le, > 1920x1080, q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25 tbc > Metadata: > encoder : Lavc57.24.103 prores > Stream mapping: > Stream #0:0 -> #0:0 (sgi (native) -> prores (native)) > Press [q] to stop, [?] for help > frame= 10 fps=0.0 q=-0.0 Lsize= 10208kB time=00:00:00.40 > bitrate=209065.5kbits/s speed=0.571x > video:10207kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB > muxing overhead: 0.007673% > > mediainfo 1080i25.mov > General > Complete name : 1080i25.mov > Format : MPEG-4 > Format profile : QuickTime > Codec ID : qt 0000.02 (qt ) > File size : 9.97 MiB > Duration : 400ms > Overall bit rate mode : Variable > Overall bit rate : 209 Mbps > Encoded date : UTC 1904-01-01 00:00:00 > Tagged date : UTC 1904-01-01 00:00:00 > Writing application : Lavf57.25.100 > > Video > ID : 1 > Format : ProRes > Format version : Version 0 > Format profile : 422 > Codec ID : apcn > Duration : 400ms > Bit rate mode : Variable > Bit rate : 209 Mbps > Width : 1 920 pixels > Height : 1 080 pixels > Display aspect ratio : 16:9 > Frame rate mode : Constant > Frame rate : 25.000 fps > Color space : YUV > Chroma subsampling : 4:2:2 > Scan type : Interlaced > Original scan type : Progressive > Scan type, store method : Interleaved fields > Scan order : Top Field First > Bits/(Pixel*Frame) : 4.033 > Stream size : 9.97 MiB (100%) > Writing library : fmpg > Language : English > Encoded date : UTC 1904-01-01 00:00:00 > Tagged date : UTC 1904-01-01 00:00:00 > Matrix coefficients : BT.601 > > > ffprobe -show_frames 1080i25.mov > ffprobe version N-78563-g4dc5880 Copyright (c) 2007-2016 the FFmpeg > developers > built with gcc 5.3.0 (GCC) > configuration: --prefix=/usr --disable-doc --enable-gpl --enable-libzimg > --enable-libvpx --enable-libx265 --enable-libdcadec --enable-libmp3lame > --enable-libx264 > libavutil 55. 17.103 / 55. 17.103 > libavcodec 57. 24.103 / 57. 24.103 > libavformat 57. 25.100 / 57. 25.100 > libavdevice 57. 0.101 / 57. 0.101 > libavfilter 6. 32.100 / 6. 32.100 > libswscale 4. 0.100 / 4. 0.100 > libswresample 2. 0.101 / 2. 0.101 > libpostproc 54. 0.100 / 54. 0.100 > Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1080i25.mov': > Metadata: > major_brand : qt > minor_version : 512 > compatible_brands: qt > encoder : Lavf57.25.100 > Duration: 00:00:00.40, start: 0.000000, bitrate: 209065 kb/s > Stream #0:0(eng): Video: prores (apcn / 0x6E637061), yuv422p10le, > 1920x1080, 209049 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default) > Metadata: > handler_name : DataHandler > encoder : Lavc57.24.103 prores > [FRAME] > media_type=video > stream_index=0 > key_frame=1 > pkt_pts=0 > pkt_pts_time=0.000000 > pkt_dts=0 > pkt_dts_time=0.000000 > best_effort_timestamp=0 > best_effort_timestamp_time=0.000000 > pkt_duration=512 > pkt_duration_time=0.040000 > pkt_pos=36 > pkt_size=1047859 > width=1920 > height=1080 > pix_fmt=yuv422p10le > sample_aspect_ratio=N/A > pict_type=I > coded_picture_number=0 > display_picture_number=0 > interlaced_frame=0 > top_field_first=0 > repeat_pict=0 > [/FRAME] > > > ffprobe -show_streams 1080i25.mov > ffprobe version N-78563-g4dc5880 Copyright (c) 2007-2016 the FFmpeg > developers > built with gcc 5.3.0 (GCC) > configuration: --prefix=/usr --disable-doc --enable-gpl --enable-libzimg > --enable-libvpx --enable-libx265 --enable-libdcadec --enable-libmp3lame > --enable-libx264 > libavutil 55. 17.103 / 55. 17.103 > libavcodec 57. 24.103 / 57. 24.103 > libavformat 57. 25.100 / 57. 25.100 > libavdevice 57. 0.101 / 57. 0.101 > libavfilter 6. 32.100 / 6. 32.100 > libswscale 4. 0.100 / 4. 0.100 > libswresample 2. 0.101 / 2. 0.101 > libpostproc 54. 0.100 / 54. 0.100 > Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1080i25.mov': > Metadata: > major_brand : qt > minor_version : 512 > compatible_brands: qt > encoder : Lavf57.25.100 > Duration: 00:00:00.40, start: 0.000000, bitrate: 209065 kb/s > Stream #0:0(eng): Video: prores (apcn / 0x6E637061), yuv422p10le, > 1920x1080, 209049 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default) > Metadata: > handler_name : DataHandler > encoder : Lavc57.24.103 prores > [STREAM] > index=0 > codec_name=prores > codec_long_name=ProRes > profile=unknown > codec_type=video > codec_time_base=1/12800 > codec_tag_string=apcn > codec_tag=0x6e637061 > width=1920 > height=1080 > coded_width=1920 > coded_height=1080 > has_b_frames=0 > sample_aspect_ratio=0:1 > display_aspect_ratio=0:1 > pix_fmt=yuv422p10le > level=-99 > color_range=N/A > color_space=unknown > color_transfer=unknown > color_primaries=unknown > chroma_location=unspecified > timecode=N/A > refs=1 > id=N/A > r_frame_rate=25/1 > avg_frame_rate=25/1 > time_base=1/12800 > start_pts=0 > start_time=0.000000 > duration_ts=5120 > duration=0.400000 > bit_rate=209049460 > max_bit_rate=N/A > bits_per_raw_sample=10 > nb_frames=10 > nb_read_frames=N/A > nb_read_packets=N/A > DISPOSITION:default=1 > DISPOSITION:dub=0 > DISPOSITION:original=0 > DISPOSITION:comment=0 > DISPOSITION:lyrics=0 > DISPOSITION:karaoke=0 > DISPOSITION:forced=0 > DISPOSITION:hearing_impaired=0 > DISPOSITION:visual_impaired=0 > DISPOSITION:clean_effects=0 > DISPOSITION:attached_pic=0 > TAG:language=eng > TAG:handler_name=DataHandler > TAG:encoder=Lavc57.24.103 prores > [/STREAM] > > > ffprobe -show_format 1080i25.mov > ffprobe version N-78563-g4dc5880 Copyright (c) 2007-2016 the FFmpeg > developers > built with gcc 5.3.0 (GCC) > configuration: --prefix=/usr --disable-doc --enable-gpl --enable-libzimg > --enable-libvpx --enable-libx265 --enable-libdcadec --enable-libmp3lame > --enable-libx264 > libavutil 55. 17.103 / 55. 17.103 > libavcodec 57. 24.103 / 57. 24.103 > libavformat 57. 25.100 / 57. 25.100 > libavdevice 57. 0.101 / 57. 0.101 > libavfilter 6. 32.100 / 6. 32.100 > libswscale 4. 0.100 / 4. 0.100 > libswresample 2. 0.101 / 2. 0.101 > libpostproc 54. 0.100 / 54. 0.100 > Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1080i25.mov': > Metadata: > major_brand : qt > minor_version : 512 > compatible_brands: qt > encoder : Lavf57.25.100 > Duration: 00:00:00.40, start: 0.000000, bitrate: 209065 kb/s > Stream #0:0(eng): Video: prores (apcn / 0x6E637061), yuv422p10le, > 1920x1080, 209049 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default) > Metadata: > handler_name : DataHandler > encoder : Lavc57.24.103 prores > [FORMAT] > filename=1080i25.mov > nb_streams=1 > nb_programs=0 > format_name=mov,mp4,m4a,3gp,3g2,mj2 > format_long_name=QuickTime / MOV > start_time=0.000000 > duration=0.400000 > size=10453275 > bit_rate=209065500 > probe_score=100 > TAG:major_brand=qt > TAG:minor_version=512 > TAG:compatible_brands=qt > TAG:encoder=Lavf57.25.100 > [/FORMAT] > > _______________________________________________ > ffmpeg-user mailing list > ffmpeg-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-user > _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user