[FFmpeg-user] Is FFV1 able to encode interlaced video?

MrNice wxcvbn2006 at iol.ie
Mon Aug 10 22:49:08 CEST 2015



On 10/08/15 19:11, Carl Eugen Hoyos wrote:
> MrNice <wxcvbn2006 <at> iol.ie> writes:
> 
>> ./ffmpeg -debug 1 -f pulse -ar 44100 -ac 2 -channel_layout stereo
>> -thread_queue_size 512 -i alsa_input.pci-0000_00_14.2.analog-stereo -f
>> v4l2 -ts mono2abs -channel 1 -video_size 720x576 -pix_fmt yuyv422
>> -thread_queue_size 512 -i /dev/video0 -c:v ffv1 -level 3 -aspect 4:3
>> -pix_fmt yuv422p -c:a pcm_s16le /Store3/Test/t_`date +%Y%m%d_%H%M`.mkv
>> -aspect 4:3 -f sdl "Dazzle output"
>>
>> So, AFAIK, the input to ffmpeg is interlaced.
> 
> No.
> 
> What I mean is: This command cannot tell you 
> if the input is interlaced or not, you can 
> only look at the actual content as shown by 
> sdl to find out or use the idet filter.
> 
>> - All the readings I did say interlaced 
>> input should be kept interlaced.
> 
> And I tried to explain that ffv1 - because 
> it is a lossless codec - cannot make the 
> interlacing go away.
> 
> But what is actually meant with above is:
> If you use a lossy codec (and you are interested 
> in high quality with low bitrate) then you have 
> to tell your encoder that the input is interlaced 
> if it is because quality will suffer a lot.
> If you tell your encoder that your progressive 
> content is interlaced, quality will only suffer a 
> little, this is why TV stations always encode as 
> interlaced (here).
> 
> [...]
> 
>> - With mediainfo, a file encoded with x264 is 
>> noted as progressive or interlaced, whereas FFV1 
>> as no information.
> 
> mediainfo cannot tell you if your video is 
> interlaced or not. It can tell you if the encoder 
> was called with the option "interlaced encoding".
> 
>> - I tried to play FFV1 files and look the image 
>> to guess with VLC (de-interlace disabled) and it 
>> looks progressive. Seems to be odds with your 
>> answer.
> 
> Did you also look at the input?
> 
>> - In your answer, do you mean that if I take the 
>> FFV1 file in a video editor then render encoded 
>> with a encoder that can handle interlaced video 
>> (x264), I will get interlaced?
> 
> (I may misunderstand this question.)
> It is possible to interlace progressive video and 
> it is possible to de-interlace interlaced video.
> In both cases, quality will generally suffer.
> 
>> - Is it better to encode the capture in x264 
>> instead FFV1?
> 
> Only you can answer.
> (But the answer should not be: I use x264 for 
> lossless encoding because it is standardized.)
> 
>> I saw a big difference in the CPU usage it's 
>> what I stay so far with FFV1.
> 
> Sounds like one possible criterion.
> 
>> - I can read in the output:
>> The V4L2 driver is using the interlaced mode
> 
> This may mean that the content actually is 
> interlaced, I don't know.
> 
>> For my information what does mean this 
>> (interl:0) in the output?:
>> w:iw h:ih flags:'0x4' interl:0
> 
> If you use w == iw and h == ih I don't think it 
> matters.
> 
> Carl Eugen
> 
>


I added -vf idet to the command and got

...
[matroska @ 0x241da80] end duration = 19435
frame=  476 fps= 25 q=-0.0 Lq=-0.0 size=  127596kB time=00:00:19.43
bitrate=53782.7kbits/s
video:510611kB audio:3348kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: unknown
Input file #0 (alsa_input.pci-0000_00_14.2.analog-stereo):
  Input stream #0:0 (audio): 73 packets read (3428456 bytes); 73 frames
decoded (857114 samples);
  Total: 73 packets (3428456 bytes) demuxed
Input file #1 (/dev/video0):
  Input stream #1:0 (video): 477 packets read (395642880 bytes); 477
frames decoded;
  Total: 477 packets (395642880 bytes) demuxed
Output file #0 (/Store3/Test/t_20150810_2131.mkv):
  Output stream #0:0 (video): 476 frames encoded; 476 packets muxed
(127223223 bytes);
  Output stream #0:1 (audio): 73 frames encoded (857114 samples); 73
packets muxed (3428456 bytes);
  Total: 549 packets (130651679 bytes) muxed
Output file #1 (Dazzle output):
  Output stream #1:0 (video): 477 frames encoded; 477 packets muxed
(395642880 bytes);
  Total: 477 packets (395642880 bytes) muxed
550 frames successfully decoded, 0 decoding errors
[Parsed_idet_0 @ 0x23e46c0] Repeated Fields: Neither:   473 Top:     2
Bottom:     1
[Parsed_idet_0 @ 0x23e46c0] Single frame detection: TFF:   475 BFF:
1 Progressive:     0 Undetermined:     0
[Parsed_idet_0 @ 0x23e46c0] Multi frame detection: TFF:   476 BFF:     0
Progressive:     0 Undetermined:     0
[AVIOContext @ 0x2429600] Statistics: 258 seeks, 4358 writeouts
Conversion failed!

So, the input is interlaced, top first.
=> FFV1 file will be interlaced.
I hope the video editor will keep the interlace and render the final
files interlaced. I'll keep an eye on that.
Some files will be played on DVD player that can play mp3 or mkv
container, H264/MPEG4 video, DTS or AAC audio.



More information about the ffmpeg-user mailing list