I am using mencoder to convert TV mpeg2 recordings to mpeg4: -vc mpeg12 -ovc lavc -lavcopts vcodec=mpeg4:v4mv:autoaspect:... This works only to a degree: the mpeg4 file seems to get the aspect ratio that the mpeg2 input file has at the beginning (16:9 or 4:3), but when the aspect ratio changes within the input mpeg2 file, then this does not correctly gets translated into the mpeg4 file. What is see is that both xbmc and vlc will correctly switch to the initial aspect ratio at the beginning of the file, but not during the ongoing playback of the file. On the other hand, they do correctly change the aspect ratio while playing the original mpeg2 files. I encode the mpeg4 files with avi header, so the aspect ratio does not come from the file header. Is this supposed to work with mencoder ? If not, how difficult would it to add this to mencoder ? Thanks Toerless
Toerless Eckert <Toerless.Eckert <at> Informatik.Uni-Erlangen.de> writes:
-vc mpeg12 -ovc lavc -lavcopts vcodec=mpeg4:v4mv:autoaspect:...
This works only to a degree: the mpeg4 file seems to get the aspect ratio that the mpeg2 input file has at the beginning (16:9 or 4:3), but when the aspect ratio changes within the input mpeg2 file, then this does not correctly gets translated into the mpeg4 file.
Is this supposed to work with mencoder ?
I can only tell you that it works fine with ffmpeg (just tested).
If not, how difficult would it to add this to mencoder ?
Please note that mencoder is not actively maintained and that you should use ffmpeg for most transcoding. Carl Eugen
On Mon, Sep 20, 2010 at 09:05:37PM +0000, Carl Eugen Hoyos wrote:
Toerless Eckert <Toerless.Eckert <at> Informatik.Uni-Erlangen.de> writes:
-vc mpeg12 -ovc lavc -lavcopts vcodec=mpeg4:v4mv:autoaspect:...
This works only to a degree: the mpeg4 file seems to get the aspect ratio that the mpeg2 input file has at the beginning (16:9 or 4:3), but when the aspect ratio changes within the input mpeg2 file, then this does not correctly gets translated into the mpeg4 file.
Is this supposed to work with mencoder ?
I can only tell you that it works fine with ffmpeg (just tested).
Hmm. Not for me unfortunately. Can you tell me what you did exactly to test this ? I tried both mp4 and avi output file and both didn't work: ffmpeg -i 001.mpg -vcodec mpeg4 -b 1500k 001.avi ffmpeg -i 001.mpg -vcodec mpeg4 -b 1500k 001.mp4 Input file is normal PAL resolution MPEG2 from TV, first with 4:3 aspect ratio, then after a minute or so widescreen AR 16:9. VLC 1.1.4 nicely switches AR on the mpg file, but not on the avi/mp4 file - but stays at 4:3. FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers built on Sep 20 2010 18:00:40 with gcc 4.3.4 configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/u sr/share/man --enable-static --enable-shared --cc=i686-pc-linux-gnu-gcc --disabl e-debug --disable-network --enable-libmp3lame --enable-libvorbis --enable-libx26 4 --enable-libxvid --disable-indev=v4l --disable-indev=v4l2 --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-x11grab --disable-vdpau --dis able-vaapi --disable-altivec --cpu=i686 --enable-gpl --enable-version3 --enable- postproc --enable-avfilter --enable-avfilter-lavf --disable-stripping --enable-hardcoded-tables --disable-doc libavutil 50.15. 1 / 50.15. 1 libavcodec 52.72. 2 / 52.72. 2 libavformat 52.64. 2 / 52.64. 2 libavdevice 52. 2. 0 / 52. 2. 0 libavfilter 1.19. 0 / 1.19. 0 libswscale 0.11. 0 / 0.11. 0 libpostproc 51. 2. 0 / 51. 2. 0 [mpeg @ 0x807b420]max_analyze_duration reached Input #0, mpeg, from '001.mpg': Duration: 00:02:23.88, start: 0.200000, bitrate: 2777 kb/s Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x576 [PAR 16:15 DAR 4:3], 7000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, 2 channels, s16, 192 kb/s Output #0, mp4, to '001.mp4': Metadata: encoder : Lavf52.64.2 Stream #0.0: Video: mpeg4, yuv420p, 720x576 [PAR 16:15 DAR 4:3], q=2-31, 1500 kb/s, 25 tbn, 25 tbc Stream #0.1: Audio: aac, 48000 Hz, 2 channels, s16, 64 kb/s Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 Press [q] to stop encoding frame= 3593 fps= 75 q=3.7 Lsize= 27522kB time=143.84 bitrate=1567.5kbits/s video:26278kB audio:1161kB global headers:0kB muxing overhead 0.303276%
If not, how difficult would it to add this to mencoder ?
Please note that mencoder is not actively maintained and that you should use ffmpeg for most transcoding.
If ffmpeg is supported it should have a better man page. Took me eternities to figure out there's something like '-flags +ildct+ilme'. Wonder how many other flags are also not on the document ;-( Cheers Toerless
Carl Eugen
Toerless Eckert <Toerless.Eckert <at> Informatik.Uni-Erlangen.de> writes:
I tried both mp4 and avi output file and both didn't work:
ffmpeg -i 001.mpg -vcodec mpeg4 -b 1500k 001.avi
Works fine with a not-too-ancient version (only latest svn is supported, the same is true for MPlayer/MEncoder).
ffmpeg -i 001.mpg -vcodec mpeg4 -b 1500k 001.mp4
Does not work... [...]
If not, how difficult would it to add this to mencoder ?
Please note that mencoder is not actively maintained and that you should use ffmpeg for most transcoding.
If ffmpeg is supported it should have a better man page.
The project maintainer does not disagree;-) http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/117633/focus=117728
Took me eternities to figure out there's something like '-flags +ildct+ilme'.
But you qualified by finding them;-) Note that I would advise you to de-interlace instead - the patch for yadif in FFmpeg is ready, but not yet committed ;-( Carl Eugen
On Wed, Sep 22, 2010 at 03:27:20PM +0000, Carl Eugen Hoyos wrote:
ffmpeg -i 001.mpg -vcodec mpeg4 -b 1500k 001.avi
Works fine with a not-too-ancient version (only latest svn is supported, the same is true for MPlayer/MEncoder).
Unfortunately i couldn't get it to work, not even with the latest SVN. I'd really appreciate if you could tell me anything more about the parameters you used to test. I am also of course not 100% sure that the players i use support to switch the aspect ratio on an mpeg4 stream (vlc, mplayer with ffmpeg). Cheers Toerless P.S.:As far as de-interlacing is concerned: I just have not found the time to figure out the best possible de-interlacer/parameters , so i am delaying that decision to the decoder where i can change it over time. Also: I understand how i would loose some quality/bitrate by using interlaced encoding, but i also have not seen sufficient evidence that that de-interlcidng would result in ultimately a better viewing experience than interlaced displaying of the non-de-interlaced encoding. P.S.2: my ffmpeg version:
ffmpeg --version FFmpeg version SVN-r25190, Copyright (c) 2000-2010 the FFmpeg developers built on Sep 25 2010 01:50:11 with gcc 4.3.4 configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --enable-static --enable-shared --cc=i686-pc-linux-gnu-gcc --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --disable-stripping --disable-debug --disable-doc --disable-network --disable-vaapi --disable-static --disable-vdpau --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-libxvid --disable-indev=v4l --disable-indev=v4l2 --disable-indev=oss --disable-indev=jack --enable-x11grab --disable-outdev=oss --disable-altivec --cpu=i686 --enable-hardcoded-tables libavutil 50.28. 0 / 50.28. 0 libavcore 0. 9. 0 / 0. 9. 0 libavcodec 52.90. 0 / 52.90. 0 libavformat 52.78. 5 / 52.78. 5 libavdevice 52. 2. 2 / 52. 2. 2 libavfilter 1.44. 0 / 1.44. 0 libswscale 0.11. 0 / 0.11. 0 libpostproc 51. 2. 0 / 51. 2. 0
---- end
ffmpeg -i 001.mpg -vcodec mpeg4 -b 1500k 001.mp4
Does not work...
[...]
If not, how difficult would it to add this to mencoder ?
Please note that mencoder is not actively maintained and that you should use ffmpeg for most transcoding.
If ffmpeg is supported it should have a better man page.
The project maintainer does not disagree;-) http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/117633/focus=117728
Took me eternities to figure out there's something like '-flags +ildct+ilme'.
But you qualified by finding them;-) Note that I would advise you to de-interlace instead - the patch for yadif in FFmpeg is ready, but not yet committed ;-(
Carl Eugen
_______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
Toerless Eckert <Toerless.Eckert <at> Informatik.Uni-Erlangen.de> writes:
On Wed, Sep 22, 2010 at 03:27:20PM +0000, Carl Eugen Hoyos wrote:
ffmpeg -i 001.mpg -vcodec mpeg4 -b 1500k 001.avi
Works fine with a not-too-ancient version (only latest svn is supported, the same is true for MPlayer/MEncoder).
Unfortunately i couldn't get it to work, not even with the latest SVN. I'd really appreciate if you could tell me anything more about the parameters you used to test. I am also of course not 100% sure that the players i use support to switch the aspect ratio on an mpeg4 stream (vlc, mplayer with ffmpeg).
I transcoded an ORF sample - 16/9 -> 4/3 (Monk) - with the command line you provided, and MPlayer (latest svn) correctly played the transcoded sample (switching aspect ratio at the right time with both -demuxer lavf and avi and -vc ffodivx and ffodivxvdpau). Since my recording is a transport stream and yours a program stream, I transcoded my sample to mpeg and that one to avi and both samples still switched aspect ratio correctly with MPlayer (and vlc and ffplay). Could you confirm that the aspect ratio switch correctly works with your original sample with MPlayer (or am I misunderstanding your problem)? While I see nothing wrong with your FFmpeg configure line, consider just using ./configure && make. Carl Eugen
Toerless Eckert <Toerless.Eckert <at> Informatik.Uni-Erlangen.de> writes:
P.S.:As far as de-interlacing is concerned: I just have not found the time to figure out the best possible de-interlacer/parameters , so i am delaying that decision to the decoder where i can change it over time.
I forgot to add that yadif should be the de-interlacer of your choice: mcdeint is significantly slower, and I am not convinced you can spot any difference. Originally this meant you had to use mencoder, but since yesterday, FFmpeg also supports yadif;-) Carl Eugen
Ok. Not sure what happened, but now it works also for me with the latest SVN build of ffmpeg *sigh*. Will have to find some more time trying to translate all remaining parameters from mencoder to ffmpeg. I seem to be missing some encoding parameters in ffmpeg, but that would be strange because i thought that mencoder was just relying on the ffmpeg libraries anyhow. As far as yadif is concerned, i am still confused as to the benefit of deinterlacing during encoding as opposed to when displaying the media. So, i do have PAL TV media sent as 720i50 MPEG2. I don't think there is any indication in the MPEG stream whether or not the content is actually interlaced or not. As far as i know it's always indicated to just be 720i50 MPEG2. Factually 50% of the content is actually interlaced and the other 50% is non-interlaced: it was recorded with 720p25 cameras and is just sent as 720i50 (aka: anything newer usually is recorded progressive). So ultimately, i do not know what content type it is. So, when i do have original 720p25 content i receive as 720i50 and i use a deinterlacer like yadif then i should always loose resolution/sharpness due to the interpolation happening in the deinterlacer. Right ? For such content the best encoding would simply be to merge both fields back and encode as progressive 720p25. I think this is what would happen in ffmpeg if i would not specify progressive encoding, but not specify any deinterlacer. Right ? Now, when i do have original interlaced content, and i would not deinterlace it during encoding, but just want to display the interlaced 720i50 content on a progressive display (like LCD), then i would apply a deinterlacer that converts the content into 720p50 so that i do not loose temporal resolution. Eg: I would not want to deinterlace into 720p25 because then sports would look more stuttering [ Of course, original 720p25 content would have the same problem, but when it is actually generated with 720p25 camera settings, the camera man is aware of the problem and will control the motion appropriately ]. But if i would do deinterlacing into 720p50 before re-encoding into mpeg4 then i would have just have doubled the number of bits to encode over the origianl 720i50 input i had. Are you really claiming that if i re-encode into eg: 1500 kbps mpeg4 (part 2 ;-), that i do get a better result with the deinterlaced 720p50 input as opposed to the interlaced 720i50 input (given the duplicate number of input bit's ) ???? My current conclusion is that i really do not need a deinterlacer for the content, but i need a detection whether the input is real 720i50 content or interlaced sent 720p25 content. If it's original 720p25 content i would like it to be encoded as 720p25 (after simple field merge), and if it was original 720i50 content then i would prefer to encode it as interlaced 720i50. Of course, something like a deinterlacer algorithm would be required to decide whether or not the content was interlaced or not. And because the TV recording will switch mid-stream between either case, this decision would need to be made continuous resulting in a media stream switching between 720i50 and 720p25 - and the encoder should according encode interlaced and progressive. If ffmpeg could do that, it would really be a mayor step forward for my TV encoding ;-)) Short of that it still sounds most prudent to continue encoding interlaced everything as 720i50. Cheers Toerless On Mon, Sep 27, 2010 at 10:46:58AM +0000, Carl Eugen Hoyos wrote:
Toerless Eckert <Toerless.Eckert <at> Informatik.Uni-Erlangen.de> writes:
P.S.:As far as de-interlacing is concerned: I just have not found the time to figure out the best possible de-interlacer/parameters , so i am delaying that decision to the decoder where i can change it over time.
I forgot to add that yadif should be the de-interlacer of your choice: mcdeint is significantly slower, and I am not convinced you can spot any difference.
Originally this meant you had to use mencoder, but since yesterday, FFmpeg also supports yadif;-)
Carl Eugen
_______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
Ok. Not sure what happened, but now it works also for me with the latest
SVN build of ffmpeg *sigh*. Will have to find some more time trying to translate all remaining parameters from mencoder to ffmpeg. I seem to be missing some encoding parameters in ffmpeg, but that would be strange because i thought that mencoder was just relying on the ffmpeg libraries anyhow.
As far as yadif is concerned, i am still confused as to the benefit of deinterlacing during encoding as opposed to when displaying the media.
Mencoder has a sweet set of additional filters and IMHO far more advanced input processing (i.e. to actually read a dvd instead of VOBs, etc.) I know opinions differ here. The reason why deinterlacing at encoding time is advantageous is that the codec has a much easier time compressing deinterlaced than interlaced material. At the same bitrate you are likely to have poorer results during interlaced encoding. (x264 has made great strides in this area but there is no magic bullet). Let's face it - you are going to lose resolution before or after no matter what. You might as well do so upfront to get better compression results than to lose the advantage of progressive encoding. /re
On Fri, Oct 01, 2010 at 03:43:46PM -0500, Rolf Ernst wrote:
Mencoder has a sweet set of additional filters and IMHO far more advanced input processing (i.e. to actually read a dvd instead of VOBs, etc.) I know opinions differ here.
I still have encoding errors with mencoder and because i only archive some content and can not visually check all of it, it's always a hard bargain trying to see whether newer versions improve. So i even try to build freaking static binaries so i can stick to an old, fairly well known version of mencoder while the rest of my system (gentoo) continuously updates. So i wouldn't mind a better maintained software for a change although it's not even clear to me whether the encoding bug i see are not also ffmpeg created bugs ;-))
The reason why deinterlacing at encoding time is advantageous is that the codec has a much easier time compressing deinterlaced than interlaced material.
Sure, but should that be my main concern ? I've got CPU time to spend that's not the problem. The problem is the result at a given bitrate.
At the same bitrate you are likely to have poorer results during interlaced encoding. (x264 has made great strides in this area but there is no magic bullet).
Right. But i do not want to yet move from mpeg4/part2 to part10 for most of my encodings (except HD) because of decoder compatibility issues in the devices i use. But what's wrong with me asking to be able to get real interlaced content automatically encoded interlaced and non-interlaced encoding encoded non-interlaced. why can ffmpeg and/or mencoder not support this automatic selection ??? At least as long as nobody proves me with better arguments (DATA) that deinterlacing of real interlaced content and then encodingdoes create a better result. Cheers Toerless
The reason why deinterlacing at encoding time is advantageous is that the codec has a much easier time compressing deinterlaced than interlaced material.
My comment did not pertain to CPU power during compression. Compressing interlaced material requires more space at the same quality compared to progressive source. Say you need 1GB for interlaced material you can squeeze out the same quality using 750MB is you deinterlace it first. Since you deinterlace it afterwards anyhow this is the preferred method.
Although x264 now has an option for 'pure interlaced' and I am not certain what exactly does. I suspect it still doesn't measure up to deinterlaced source. -- /re This is America. Huge multinationals choose our political officials here.
As far as yadif is concerned, i am still confused as to the benefit of deinterlacing during encoding as opposed to when displaying the media. There are two big reasons. First, progressive video is more compressible
So, i do have PAL TV media sent as 720i50 MPEG2. I don't think there is any indication in the MPEG stream whether or not the content is actually interlaced or not. As far as i know it's always indicated to just be 720i50 MPEG2. Factually 50% of the content is actually interlaced and the other 50% is non-interlaced: it was recorded with 720p25 cameras and is just sent as 720i50 (aka: anything newer usually is recorded progressive). So ultimately, i do not know what content type it is. I am not sure how 25p -> 50i is handled. It's possible that you are receiving 25p video flagged as interlaced if the original is recorded at 25p. You can play video back frame-by-frame with MPlayer by pausing it and pressing the period key to advance a frame. If you see full frames, it's progressive. If you see combing, it's interlaced. So, when i do have original 720p25 content i receive as 720i50 and i use a deinterlacer like yadif then i should always loose resolution/sharpness due to the interpolation happening in the deinterlacer. Right ? If you use a deinterlacer on progressive content, you will likely have very noticeable distortions. If the 25p video was interlaced before broadcast, you've already lost (a very small amount of) quality. For such content the best encoding would simply be to merge both fields back and encode as progressive 720p25. I think this is what would happen in ffmpeg if i would not specify progressive encoding, but not specify any deinterlacer. Right ? AFAIK, it's not possible to losslessly restore progressive frames once
On 10/1/2010 3:36 PM, Toerless Eckert wrote: than interlaced video with any codec. Second, the video would only need to be deinterlaced once instead of every time you want to watch it. the video is interlaced while maintaining a constant frame rate and resolution throughout. I'm not sure what you mean by merging fields.
But if i would do deinterlacing into 720p50 before re-encoding into mpeg4 then i would have just have doubled the number of bits to encode over the origianl 720i50 input i had. Are you really claiming that if i re-encode into eg: 1500 kbps mpeg4 (part 2 ;-), that i do get a better result with the deinterlaced 720p50 input as opposed to the interlaced 720i50 input (given the duplicate number of input bit's ) ???? You will get better quality if you deinterlace to 25p (Yadif can output one frame for every pair of fields) than if you stay with 50i. Yes, technically, quality is lost when you deinterlace, but it's not much of a loss. If you are so concerned about the quality loss from deinterlacing, don't re-encode it. The bits you'd save (if any) would be too few to justify the time spent to encode whether you encode 50i or 50p. Seriously, take material that you know is recorded at 50i and compare the quality when encoded at 25p, 50p and 50i. Yadif is an excellent deinterlacer. I don't know about ffmpeg, but MEncoder has mcdeint, which will reduce the very small amount of quality loss that Yadif introduces. Of course, mcdeint is very slow and only worth the time if you are obsessed with reducing temporal artifacts (which you seem to be). And because the TV recording will switch mid-stream between either case, this decision would need to be made continuous resulting in a media stream switching between 720i50 and 720p25 - and the encoder should according encode interlaced and progressive. It shouldn't switch during a program. It could switch when ads come on, but you would have those cut out anyway. Short of that it still sounds most prudent to continue encoding interlaced everything as 720i50. As I said, compare encodes. You'll see that the quality loss that comes from the encoder not being able to handle interlaced material efficiently is going to be much more than the loss from deinterlacing.
As I said, compare encodes. You'll see that the quality loss that comes from the encoder not being able to handle interlaced material efficiently is going to be much more than the loss from deinterlacing. _______________________________________________ Someone adviced not to deinterlace because in the future the devices will support instant deinterlacing on playback. But you conviced me,
that when encoding at bitrates like 900kbps, it's better to deinterlace. I did those tests on a material captured from tv and the difference is big. Thanks. Jarek
On Sat, Oct 02, 2010 at 10:46:06AM +0200, Jarek Czekalski wrote:
As I said, compare encodes. You'll see that the quality loss that comes from the encoder not being able to handle interlaced material efficiently is going to be much more than the loss from deinterlacing. _______________________________________________ Someone adviced not to deinterlace because in the future the devices will support instant deinterlacing on playback. But you conviced me, that when encoding at bitrates like 900kbps, it's better to deinterlace. I did those tests on a material captured from tv and the difference is big. Thanks.
Honestly, it all depends on what you need. Some people cannot stand 25/30 fps content, they have the choice of either coding at 60 fps or interlaced at 60 fps and use a good, upsampling deinterlacer. When the alternative is deinterlacing to 60 fps, keeping it interlaced might be the better alternative, also since deinterlacers particularly for that use case might still become better in the next years.
On 10/2/2010 3:46 AM, Jarek Czekalski wrote:
Someone adviced not to deinterlace because in the future the devices will support instant deinterlacing on playback. They already do. I don't know of any hardware player that won't do at least a simple blend deinterlace when it plays back interlaced material unless it's specifically configured not to.
On Sat, Oct 02, 2010 at 12:53:40AM -0500, Andrew Berg wrote:
There are two big reasons. First, progressive video is more compressible than interlaced video with any codec. Second, the video would only need to be deinterlaced once instead of every time you want to watch it.
There are billions of TV sets out there dong deinterlacing every time they receive something so the second part of the argument isn't all that persuasive ;-)
I am not sure how 25p -> 50i is handled. It's possible that you are receiving 25p video flagged as interlaced if the original is recorded at 25p. You can play video back frame-by-frame with MPlayer by pausing it and pressing the period key to advance a frame. If you see full frames, it's progressive. If you see combing, it's interlaced.
Unfortunately i always see full frames. Have you tried it ? mplayer seems to alwas be showing a full frame somehow interlaced from two field *sigh*.
If you use a deinterlacer on progressive content, you will likely have very noticeable distortions. If the 25p video was interlaced before broadcast, you've already lost (a very small amount of) quality.
"if the 25p video was interlaced" ? What do you mean with that ?
For such content the best encoding would simply be to merge both fields back and encode as progressive 720p25. I think this is what would happen in ffmpeg if i would not specify progressive encoding, but not specify any deinterlacer. Right ? AFAIK, it's not possible to losslessly restore progressive frames once the video is interlaced while maintaining a constant frame rate and resolution throughout. I'm not sure what you mean by merging fields.
Why not ? If i receive an MPEG2 stream that indicates it's 50 fields per second interlaced, but every 2 fields actually belong to a single frame, then my deinterlacing operation is simple to combine the two fields into a field without any interpolation. Right ?
You will get better quality if you deinterlace to 25p (Yadif can output one frame for every pair of fields) than if you stay with 50i. Yes, technically, quality is lost when you deinterlace, but it's not much of a loss.
Somehow this seems to be a mantra everybody repeats without knowing real evidence. How can you maintain 50 field/sec smoothness of motion after deinterlacing into 25p ?
If you are so concerned about the quality loss from deinterlacing, don't re-encode it. The bits you'd save (if any) would be too few to justify the time spent to encode whether you encode 50i or 50p. Seriously, take material that you know is recorded at 50i and compare the quality when encoded at 25p, 50p and 50i.
Why do i have to do this. Why does nobody here have pointers to example encoded streams at the same bitrate ;-))
Yadif is an excellent deinterlacer. I don't know about ffmpeg, but MEncoder has mcdeint, which will reduce the very small amount of quality loss that Yadif introduces. Of course, mcdeint is very slow and only worth the time if you are obsessed with reducing temporal artifacts (which you seem to be).
I am not obsessed. I don't want to deinterlace except when i know it is 25p content in the first place. But everybody else here seems to want me to deinterlace in all cases ;-)))
And because the TV recording will switch mid-stream between either case, this decision would need to be made continuous resulting in a media stream switching between 720i50 and 720p25 - and the encoder should according encode interlaced and progressive. It shouldn't switch during a program. It could switch when ads come on, but you would have those cut out anyway.
Well, TV recordings usually willhave some pre and post roll which can have separate encodings from the main program recorded. In addition, if the recording is a made-4-tv news report or the like then it will be cut together from all type of input clips, some of them 4:3 AR, some 16:9, some interlaced, some 25p.
Not if you have
Short of that it still sounds most prudent to continue encoding interlaced everything as 720i50. As I said, compare encodes. You'll see that the quality loss that comes from the encoder not being able to handle interlaced material efficiently is going to be much more than the loss from deinterlacing.
So far i' ve not been too unhappy with mencoder and interlaced, except for what i think are bugs, and maybe those bugs are more common in less often used combination of options, and if everybody here subscribes to the church of deinterlacing, then i can see why i have more bugs in my encodings ;-)) What rates do you think is sufficient for deinterlaced PAL (720@576x25p) ? I am using 1500kbps for interlaced. I alredy know it's not ideal for noisy (older) content, but its pretty good for newer (less noisy) content. Cheers Toerless
On Sat, Oct 02, 2010 at 12:53:40AM -0500, Andrew Berg wrote:
There are two big reasons. First, progressive video is more compressible than interlaced video with any codec. Second, the video would only need to be deinterlaced once instead of every time you want to watch it.
There are billions of TV sets out there dong deinterlacing every time they receive something so the second part of the argument isn't all that persuasive ;-) It's inefficient because takes power and CPU cycles to deinterlace. With hardware players, this isn't a huge issue, but it's unnecessary overhead for software players.
I am not sure how 25p -> 50i is handled. It's possible that you are receiving 25p video flagged as interlaced if the original is recorded at 25p. You can play video back frame-by-frame with MPlayer by pausing it and pressing the period key to advance a frame. If you see full frames, it's progressive. If you see combing, it's interlaced.
Unfortunately i always see full frames. Have you tried it ? mplayer seems to alwas be showing a full frame somehow interlaced from two field *sigh*. If you're not seeing any combing, then it's very likely the video is
If you use a deinterlacer on progressive content, you will likely have very noticeable distortions. If the 25p video was interlaced before broadcast, you've already lost (a very small amount of) quality.
"if the 25p video was interlaced" ? What do you mean with that ? I mean if the original progressive was interlaced (the verb, not the adjective) before broadcast. 25p -> 50i. Why not ? If i receive an MPEG2 stream that indicates it's 50 fields per second interlaced, but every 2 fields actually belong to a single frame, then my deinterlacing operation is simple to combine the two fields into a field without any interpolation.
Right ? No. If you have frames, you leave the video alone. Honestly, I don't know what's allowed to be in a broadcast stream in Europe, so I wouldn't know if a station could broadcast pure 25p alongside pure 50i or not.
You will get better quality if you deinterlace to 25p (Yadif can output one frame for every pair of fields) than if you stay with 50i. Yes, technically, quality is lost when you deinterlace, but it's not much of a loss.
Somehow this seems to be a mantra everybody repeats without knowing real evidence. How can you maintain 50 field/sec smoothness of motion after deinterlacing into 25p ? You can't, but you are free to not deinterlace. If it is such an issue, either don't re-encode or live with the fact that interlaced video is less compressible than progressive video and have either larger files or reduced quality. Try encoding with a constant quality (higher quality is better since you're testing) and compare bitrates and quality among 25p/50i/50p. If you still think the higher bitrate is less of a problem
But everybody else here seems to want me to deinterlace in all cases ;-))) That's because we consider the tradeoff to be very worthwhile. Well, TV recordings usually willhave some pre and post roll which can have separate encodings from the main program recorded. In addition, if the recording is a made-4-tv news report or the like then it will be cut together from all type of input clips, some of them 4:3 AR, some 16:9, some interlaced, some 25p. If the stream truly switches like that, then you have a real problem for which I have no solution. So far i' ve not been too unhappy with mencoder and interlaced, except for what i think are bugs, and maybe those bugs are more common in less often used combination of options, and if everybody here subscribes to the church of deinterlacing, then i can see why i have more bugs in my encodings ;-)) It's far from dogma. It's a matter of opinion and most people would find
On 10/5/2010 7:01 PM, Toerless Eckert wrote: progressive. Broadcast MPEG-TS flags can never be trusted to indicate whether a video stream is interlaced or progressive. I use this method to help determine whether video is true 30i or telecined 24p if I'm unsure. I tried this with pure 30i content and it's not as obvious as I thought to see interlacing. You'll have to look very closely for combing, especially if your input is the same resolution as your display. than the temporal resolution (I think that's the right term) loss, then by all means, encode interlaced. the efficiency gain worth the quality loss from deinterlacing after doing their own tests.
What rates do you think is sufficient for deinterlaced PAL (720@576x25p) ? I am using 1500kbps for interlaced. I alredy know it's not ideal for noisy (older) content, but its pretty good for newer (less noisy) content. That depends on what you consider to be sufficient quality and on what kind of content you're dealing with (noise is far from the only factor). I've never dealt much with MPEG-4 part 2 and I don't ever plan to, so I can't help you here.
Broadcast MPEG-TS flags can never be trusted to indicate whether a video stream is interlaced or progressive. I don't think it's a good point of view for an mplayer programmer. If
there's a flag the program should be able to adapt to it. Then you could say: we do everything all right, blame the mpeg stream for not setting the flag correctly. Automatic choosing of encoding type (interlaced/noninterlaced) would be beneficial to both advanced and simple users.
On Wed, Oct 06, 2010 at 01:48:33AM -0500, Andrew Berg wrote:
It's inefficient because takes power and CPU cycles to deinterlace. With hardware players, this isn't a huge issue, but it's unnecessary overhead for software players.
To me that is the cost of maximizing quality. Show me any TV station that's sending out it's interlaced material deinterlaced. Or DVDs for that matter.
If you're not seeing any combing, then it's very likely the video is progressive.
No. I am quite certain it is interlaced. Heck, mplayer already tells me the stream is 25fps. When i play it back with vlc, it shows me the stram has 50 frames/sigh) (*sigh*). Now where is the player that correctly tells me that is 50 FIELDS/sec interlaced and where i can single frame through the picture ;-))
Broadcast MPEG-TS flags can never be trusted to indicate whether a video stream is interlaced or progressive.
Sure. I still remember the many years when de-interlacing in DVD players was evolving and the more often than not solely relied on that flag. NOw this isn't an issue talked about much at all anymore because the players deinterlacers take care of it. So, if i single step through a movie with mplayer, would i have to press '.' 50 times for a second, or 25 times ? It's hard to say. I see a movement in the picture every time. It's just hard to judge whether there are interlacing artefacts...
I use this method to help determine whether video is true 30i or telecined 24p if I'm unsure.
Right. Haven't tried this with NTSC material for a long time but remember from the past (not sure which program i used) to check whether i would see the same picture for the usual 3:2 sequences.
I tried this with pure 30i content and it's not as obvious as I thought to see interlacing. You'll have to look very closely for combing, especially if your input is the same resolution as your display.
Right. The way you described it initially i was hoping for a nice display of alternating black and picture lines for interlaced input material ;-))
Why not ? If i receive an MPEG2 stream that indicates it's 50 fields per second interlaced, but every 2 fields actually belong to a single frame, then my deinterlacing operation is simple to combine the two fields into a field without any interpolation.
Right ? No. If you have frames, you leave the video alone.
Well, i thought that the encoder (ffmpeg/mencoder) would ultimately need to have real 25 frames/sec when i want it to do progressive encoding, and if the input is 50i fields (originating from an actual 25p material), then the final 25 frames/sec are created by combining two fields back into a frame - without any interpolations.
You can't, but you are free to not deinterlace. If it is such an issue, either don't re-encode or live with the fact that interlaced video is less compressible than progressive video and have either larger files or reduced quality. Try encoding with a constant quality (higher quality is better since you're testing) and compare bitrates and quality among 25p/50i/50p. If you still think the higher bitrate is less of a problem than the temporal resolution (I think that's the right term) loss, then by all means, encode interlaced.
Hmm. remind me, what would be the right parameter to get encoding purely based on quality, not target bitrate ? I guess that would be possible then to do with single pass ?
Well, TV recordings usually willhave some pre and post roll which can have separate encodings from the main program recorded. In addition, if the recording is a made-4-tv news report or the like then it will be cut together from all type of input clips, some of them 4:3 AR, some 16:9, some interlaced, some 25p. If the stream truly switches like that, then you have a real problem for which I have no solution.
But that's just because the encoders do not support this, right ?
What rates do you think is sufficient for deinterlaced PAL (720@576x25p) ? I am using 1500kbps for interlaced. I alredy know it's not ideal for noisy (older) content, but its pretty good for newer (less noisy) content. That depends on what you consider to be sufficient quality and on what kind of content you're dealing with (noise is far from the only factor). I've never dealt much with MPEG-4 part 2 and I don't ever plan to, so I can't help you here.
How about part 10 ? I have been doing 900kbps for 1280x720@30frames. Cheers Toerless
On 10-10-06 9:19 AM, Toerless Eckert wrote:
On Wed, Oct 06, 2010 at 01:48:33AM -0500, Andrew Berg wrote:
It's inefficient because takes power and CPU cycles to deinterlace. With hardware players, this isn't a huge issue, but it's unnecessary overhead for software players. To me that is the cost of maximizing quality. Show me any TV station that's sending out it's interlaced material deinterlaced. Or DVDs for that matter.
If you're not seeing any combing, then it's very likely the video is progressive. No. I am quite certain it is interlaced. Heck, mplayer already tells me the stream is 25fps. When i play it back with vlc, it shows me the stram has 50 frames/sigh) (*sigh*). Now where is the player that correctly tells me that is 50 FIELDS/sec interlaced and where i can single frame through the picture ;-)) There are no flags in PAL video that differentiate 25fps progressive vs. 50 fields per second. That's an NTSC thing. All you can do is manually observe the material and deinterlace where necessary.
Show me any TV station that's sending out it's interlaced
Not a single premium network channel is broadcasting interlaced. Not sure about standard over the air HD but it's my guess that none or only very few broadcast interlaced. (1080i would be the only option in the U.S. and an idiotic one at best). All licensing requires digital broadcast by law. Not sure about Europe. They, of course, could be more mindless. -- /re "Don't ask what the world needs. Ask what makes you come alive, and go do it. Because what the world needs is people who have come alive." Howard Thurman
Not a single premium network channel is broadcasting interlaced. Not sure about standard over the air HD but it's my guess that none or only very few broadcast interlaced. (1080i would be the only option in the U.S. and an idiotic one at best). Most stations in the US (this includes network, cable and premium channels) broadcast 1080i60, the rest do 720p60. Many programs (especially sports) are recorded 1080i60. 1080p30 and 1080p60 are not
Show me any TV station that's sending out it's interlaced material deinterlaced. Or DVDs for that matter. I can't be 100% certain, but I would say that deinterlacing would cost money (we're dealing with extremely expensive commercial encoders, not
Well, i thought that the encoder (ffmpeg/mencoder) would ultimately need to have real 25 frames/sec when i want it to do progressive encoding, and if the input is 50i fields (originating from an actual 25p material), then the final 25 frames/sec are created by combining two fields back into a frame - without any interpolations. The only way to losslessly deinterlace would be to use a filter that turns each full-height field into half-height frames (e.g. tfields=0). This halves the resolution and doubles the framerate. Of course, the
On 10/6/2010 11:25 PM, Rolf Ernst wrote: options. On 1080i channels, either the original 60i material is broadcast or 24p material is telecined to 60i. SDTV is 480i60 except in a few rare cases. the free ones that are available for personal use) and CPU cycles that broadcasters are not willing to spend and therefore deinterlacing is not part of the standards. As for DVDs (and BDs for that matter), the bitrate available is usually enough to accommodate interlaced material, and of course there's money issue, so I can see why deinterlacing is not part of those standards either. And in both cases, they want to provide the original format. There are situations where deinterlacing would be good, but everyone has to follow the standards. picture will flicker because of the way interlacing works and it's not as efficiently encoded as a stream that was deinterlaced using a standard filter like yadif. Regardless of how the material was originally recorded, you either have fields or frames. If the material was recorded progressive, but broadcast interlaced, you can't magically revert it to its original state. You will have to deinterlace with a filter like yadif to get 25p again, and it won't be 100% lossless (though it will be extremely close since it was never 50Hz to begin with).
Hmm. remind me, what would be the right parameter to get encoding purely based on quality, not target bitrate ? I guess that would be possible then to do with single pass ? With x264, it's CRF. Don't know about other encoders. Yes, constant quality is done in one pass.
How about part 10 ? I have been doing 900kbps for 1280x720@30frames. 900kbps is extremely low, even for x264, when dealing with 1280x720. You'd get much better quality at that bitrate if you reduce the resolution. With sane settings, you'd need at least 1500kbps to get decent quality with x264 with 720p material, if your source is clean. It all depends on how much noise and artifacting your source has, as well as what kind of material it is. A noisy, artifacted program with a lot of motion can have 5-8x as many bits as a clean and flat cartoon and still have worse quality. If you're aiming to have everything the same size, pick a size you're comfortable with and use 2-pass. If you want everything to have the same quality (source quality matters here, but overall you can have varied types of programs and bitrate will be adjusted to keep a specified quality), use a constant quality setting. This is a bit complicated and VERY subjective, so I can't tell you what is best for you. Broadcast quality is pretty good in Europe (at least what I've seen from Sky Sports), so a CRF value between 19 and 22 is good. For a clean DVD, 18-20, 21 or 22 if it has heavy artifacting. For BDs, 17-19 is good. Lower CRF=higher bitrate and higher quality. Type of content (cartoons/sitcoms/sports) and resolution don't matter much, but source quality does.
On Thu, Oct 07, 2010 at 11:13:20PM -0500, Andrew Berg wrote:
Most stations in the US (this includes network, cable and premium channels) broadcast 1080i60, the rest do 720p60.
Well. My comcast cable has way too many channels but only < 100 of them are HD, eg: 1080i or 720p. The rest is all 480i. Sure, there is a bunch of those that are just downsampled HD material, but likewise i commonly see upsampled SD material on HD channels. I think There are just 480i cameras and HD cameras supporting 720p/1080i ;-) So i guess the question is what is "most stations". Maybe you mean "most stations except lots of strange programming on cable"? ;-))
Many programs (especially sports) are recorded 1080i60. 1080p30 and 1080p60 are not options. On 1080i channels, either the original 60i material is broadcast or 24p material is telecined to 60i. SDTV is 480i60 except in a few rare cases.
right.
As for DVDs (and BDs for that matter), the bitrate available is usually enough to accommodate interlaced material, and of course there's money issue, so I can see why deinterlacing is not part of those standards either. And in both cases, they want to provide the original format.
Right. And i would also like to avoid doing any steps that introduce new errors...
There are situations where deinterlacing would be good, but everyone has to follow the standards.
Which standard ? DVD does support 24p and 30p, right ? And converts it to 50/60i...
The only way to losslessly deinterlace would be to use a filter that turns each full-height field into half-height frames (e.g. tfields=0). This halves the resolution and doubles the framerate. Of course, the picture will flicker because of the way interlacing works and it's not as efficiently encoded as a stream that was deinterlaced using a standard filter like yadif. Regardless of how the material was originally recorded, you either have fields or frames. If the material was recorded progressive, but broadcast interlaced, you can't magically revert it to its original state.
No, i totally do not understand that. Assume i have 25p material and want to broadcat it as 50i. What i do then is that i just split up every frame into even and odd lines and broadcast first the odd lines as one field and then the even lines as the second field. Of course i shuold be able to recombine these two fields to a full frame without any loss.
You will have to deinterlace with a filter like yadif to get 25p again, and it won't be 100% lossless (though it will be extremely close since it was never 50Hz to begin with).
Well, let's just assume original 25p -> 50i -> 25p and 30p -> 60i -> 30p. Those cases should be lossless. Even 24p -> 60i -> 24p should be lossless. Not sure which case you are thinking of. 24p -> 50i should be possible to convert lossless for vide back to 24p, just the audio needs to be speed up/down by 4%.
How about part 10 ? I have been doing 900kbps for 1280x720@30frames. 900kbps is extremely low, even for x264, when dealing with 1280x720. You'd get much better quality at that bitrate if you reduce the resolution. With sane settings, you'd need at least 1500kbps to get decent quality with x264 with 720p material, if your source is clean. It all depends on how much noise and artifacting your source has, as well as what kind of material it is. A noisy, artifacted program with a lot of motion can have 5-8x as many bits as a clean and flat cartoon and still have worse quality. If you're aiming to have everything the same size, pick a size you're comfortable with and use 2-pass. If you want everything to have the same quality (source quality matters here, but overall you can have varied types of programs and bitrate will be adjusted to keep a specified quality), use a constant quality setting. This is a bit complicated and VERY subjective, so I can't tell you what is best for you. Broadcast quality is pretty good in Europe (at least what I've seen from Sky Sports), so a CRF value between 19 and 22 is good. For a clean DVD, 18-20, 21 or 22 if it has heavy artifacting. For BDs, 17-19 is good. Lower CRF=higher bitrate and higher quality. Type of content (cartoons/sitcoms/sports) and resolution don't matter much, but source quality does.
Thanks, but why would you use a high CRF == low bitrate for material with heavy artifacting ? SHhouldn't that lower bitrate just aggravate artifacts ? Cheers Toerless
On Sat, Oct 09, 2010 at 07:24:50AM +0200, Toerless Eckert wrote:
No, i totally do not understand that. Assume i have 25p material and want to broadcat it as 50i. What i do then is that i just split up every frame into even and odd lines and broadcast first the odd lines as one field and then the even lines as the second field. Of course i shuold be able to recombine these two fields to a full frame without any loss.
Yes, and it's one of the reasons why the encoding method is useless to decode whether something is indeed interlaced or not. It is no problem at all to encode 25p as 50i (I don't know any encoders that need you to split the frame into fields for that, it is just a question of setting the encoder options), as long as you don't care about maybe 20% loss in encoder efficiency. You can also encode interlaced content as progressive, as long as you don't mind in that case really horrible quality. There are obviously even peopl who have no problem scaling interlaced content like progressive, though those really deserve an angry mob hunting them for excessive cruelty to innocent video material :-)
On Thu, Oct 07, 2010 at 11:13:20PM -0500, Andrew Berg wrote:
Most stations in the US (this includes network, cable and premium channels) broadcast 1080i60, the rest do 720p60.
Well. My comcast cable has way too many channels but only < 100 of them are HD, eg: 1080i or 720p. The rest is all 480i. I meant as far as HD channels go. Which standard ? DVD does support 24p and 30p, right ? And converts it to 50/60i... AFAIK, NTSC DVDs can have only 60i (24p is telecined to 60i) and PAL can have 50i. No, i totally do not understand that. Assume i have 25p material and want to broadcat it as 50i. What i do then is that i just split up every frame into even and odd lines and broadcast first the odd lines as one field and then the even lines as the second field. Of course i shuold be able to recombine these two fields to a full frame without any loss. No. That kind of interlacing would double the resolution and halve the
Well, let's just assume original 25p -> 50i -> 25p and 30p -> 60i -> 30p. Those cases should be lossless. Not if you maintain a constant resolution. Even 24p -> 60i -> 24p should be lossless. I think so, but I'm not 100% sure. Thanks, but why would you use a high CRF == low bitrate for material with heavy artifacting ? SHhouldn't that lower bitrate just aggravate artifacts ? The idea is that the original artifacts are going to be more obvious and distracting than any introduced by raising the CRF value. You'll have a lower bitrate and not notice the additional artifacting. It's also important to remember that heavily artifacted material with little detail is not nearly as compressible as very clean material, even if it has a lot of genuine detail. No encoder is smart enough, nor should it even try, to detect what is artifacting and what is genuine detail. That is for a human to decide. The encoder will preserve video quality, but it won't know whether it's
On 10/9/2010 12:24 AM, Toerless Eckert wrote: frame rate. To maintain frame rate and resolution, all fields have to represent a different point in time. This is done with interpolation. preserving wanted details or nasty blocks.
On Sat, Oct 09, 2010 at 06:41:08AM -0500, Andrew Berg wrote:
AFAIK, NTSC DVDs can have only 60i (24p is telecined to 60i) and PAL can have 50i.
http://en.wikipedia.org/wiki/24p#24p_on_DVD
No, i totally do not understand that. Assume i have 25p material and want to broadcat it as 50i. What i do then is that i just split up every frame into even and odd lines and broadcast first the odd lines as one field and then the even lines as the second field. Of course i shuold be able to recombine these two fields to a full frame without any loss. No. That kind of interlacing would double the resolution and halve the frame rate. To maintain frame rate and resolution, all fields have to represent a different point in time. This is done with interpolation.
All fields "should"represent a different point in time, but when TV stations or DVD players convert 24/25/30p to 50/60i, then this usually does not happen.
Well, let's just assume original 25p -> 50i -> 25p and 30p -> 60i -> 30p. Those cases should be lossless. Not if you maintain a constant resolution. Even 24p -> 60i -> 24p should be lossless. I think so, but I'm not 100% sure. Thanks, but why would you use a high CRF == low bitrate for material with heavy artifacting ? SHhouldn't that lower bitrate just aggravate artifacts ? The idea is that the original artifacts are going to be more obvious and distracting than any introduced by raising the CRF value. You'll have a lower bitrate and not notice the additional artifacting.
Hmm.. then the additional artefacting shuold be 'nicer'than the usual mpeg blocking i know ;-)
It's also important to remember that heavily artifacted material with little detail is not nearly as compressible as very clean material, even if it has a lot of genuine detail.
Right. Which is why i had always considered to require more bits in encoding the older the material (old == usually more noisy).
No encoder is smart enough, nor should it even try, to detect what is artifacting and what is genuine detail. That is for a human to decide. The encoder will preserve video quality, but it won't know whether it's preserving wanted details or nasty blocks.
Yeah, well, but the human (me) wants to outsource all the ongoing work to the DVR/software and not bother about the encoding for clips individually ;-) Cheers Toerless
On 10/9/2010 11:11 AM, Toerless Eckert wrote:
http://en.wikipedia.org/wiki/24p#24p_on_DVD I see. I've only encountered a few DVDs with 24p material and all were telecined to 60i, so I figured that was how all 24p material was handled for DVD. All fields "should"represent a different point in time, but when TV stations or DVD players convert 24/25/30p to 50/60i, then this usually does not happen. Now that I think about it some more, it may be possible to split a frame into two fields without loss, but I'm not sure.
Well, let's just assume original 25p -> 50i -> 25p and 30p -> 60i -> 30p. Those cases should be lossless. Not if you maintain a constant resolution. Even 24p -> 60i -> 24p should be lossless. I think so, but I'm not 100% sure. Thanks, but why would you use a high CRF == low bitrate for material with heavy artifacting ? SHhouldn't that lower bitrate just aggravate artifacts ? The idea is that the original artifacts are going to be more obvious and distracting than any introduced by raising the CRF value. You'll have a lower bitrate and not notice the additional artifacting.
Hmm.. then the additional artefacting shuold be 'nicer'than the usual mpeg blocking i know ;-) It's not that they're nicer, but rather that they're unnoticeable. In very clean material (e.g. a good Blu-ray source) they would stick out (which is why I almost always use CRF=18 for Blu-ray), but in artifacted material, they blend in and don't harm much of the remaining actual detail. Yeah, well, but the human (me) wants to outsource all the ongoing work to the DVR/software and not bother about the encoding for clips individually ;-) I rarely configure options on a clip-by-clip basis, but rather group material by source quality. Using CRF makes it even easier since I don't have to worry about what kind of material it is (I use a separate set of encoding options for animation, but the CRF can remain constant).
On 10-10-08 11:24 PM, Toerless Eckert wrote:
No, i totally do not understand that. Assume i have 25p material and want to broadcat it as 50i. What i do then is that i just split up every frame into even and odd lines and broadcast first the odd lines as one field and then the even lines as the second field. Of course i shuold be able to recombine these two fields to a full frame without any loss. Correct. Except that there are no flags at all in the stream that will let you differentiate between 25p and 50i programmatically. You would have to do this part yourself by visual inspection of the material. If you want to always ensure that the output is going to be 25p, then you will always deinterlace, using something like yadiff. Yadiff will not deinterlace parts of the frame that do not need it - it is only applied where material differs line by line by some set threshold value.
You will have to deinterlace with a filter like yadif to get 25p again, and it won't be 100% lossless (though it will be extremely close since it was never 50Hz to begin with). Well, let's just assume original 25p -> 50i -> 25p and 30p -> 60i -> 30p. Those cases should be lossless. Even 24p -> 60i -> 24p should be lossless. Not sure which case you are thinking of. 24p -> 50i should be possible to convert lossless for vide back to 24p, just the audio needs to be speed up/down by 4%. Generally, 24fps material is simply sped up a little to give you 25p material for PAL. In those cases, yes, it is possible to losslessly reconvert 60i or 50i streams back down to the original 24fps. In the case of NTSC material encoded with MPEG2, there are flags in the stream that indicate frame cadence, and these can be used to reconstruct the original progressive frames.
However, this discussion only really applies to productions shot on film or HD video for display in movie theaters. Stuff shot for television is going to always be a mixed bag of progressive material shot on film or HD, older material shot in 60i for 50i, programming where progressive and interlaced material has been freely edited together with no regard for "recoverability" of the frames, etc. All bets are off when talking about cable HD programming - especially sport broadcasts. Your best bet is simply treat it all as 60i material, deinterlace with YADIF where necessary. Then you are not recovering frames - you are simply making the material more suitable to display on a computer and more compressible in the stream.
participants (7)
-
Andrew Berg -
Carl Eugen Hoyos -
James Hastings-Trew -
Jarek Czekalski -
Reimar Döffinger -
Rolf Ernst -
Toerless Eckert