Poisondeathray....I have a problem. I tried the IVTC as you know but later on I found that anything I encode with that is not playable. The movies start out ok for a short time then the video goes black and if you try to skip through the video it goes to the end. It does this in any video player I try.
Mediainfo reports my recorded TV movies as "Interlaced....Top Field First" so should I just use a de-interlacer?
Do you have any suggestions?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 31 to 60 of 75
Thread
-
Last edited by Ronstang; 12th Sep 2021 at 13:04.
-
What is your playback setup? Does it handle 10bit HEVC ? What about a media player like MPV, or MPCHC ?
Otherwise, - not sure what why - if you IVTC in ffmpeg , it should be encoded progressive without any issues @ 23.976p . People do this everyday.
(But avisynth / vapoursynth are more reliable for this in my experience)
If you just single rate deinterlace, you get 29.97 with duplicates - we've been though this . So you're encoding 25% more frames for nothing (wasting some bitrate), and playback will be stutter -
I tried one in Emby and it will start but the video and sound are all out of sync and if you try to seek through the movie it just shows a black screen and no sound and everything locks up in the video player. This is with an 8 bit color encoding with the IVTC settings you gave me earlier in this thrread.
-
So MPV / Potplayer also have the issue locally ?
Then there is a definite problem. FFmpeg is a fluid project, sometimes a commit break something
Another benefit of avisynth or vapoursynth is you can preview scripts before encoding, so you don't waste time encoding
Post your current full commandline
I have been using Avidemux to look closer at my recorded movies and I have verified on two channels that they are definitely 2:3 pulldown.....so would I should use IVTC for that, correct?
720p channels are slightly different - they just encode duplicates for film content but it's progressive, so you just decimate the duplicates -
Here is the commandline I am using in FFmpeg Batch AV Converter:
-c:v hevc_nvenc -vf "fps=30000/1001,fieldmatch,bwdif=deint=interlaced,decimate,fo rmat=yuv420p10le" -c:a copy -c copy -preset hq -rc constqp -rc-lookahead 60 -spatial_aq 1 -aq-strength 12 -temporal_aq 1 -nonref_p 1 -cq 26
Oh, and yes...both MPV and PotPlayer have the same issue on the PC.Last edited by Ronstang; 12th Sep 2021 at 15:29.
-
I have been experimenting. I took one of my TS files of a recorded movie from TCM that I know is telecine 2:3 pulldown and opened it in DGIndex to play with it to see how that program works. I set it to "Force Film" (not sure if that is correct but I am experimenting) and saved the file.
Now the interesting part. I also demuxed the TS file using tsMuxer and the resulting video file was EXACTLY the same size as the one generated by DGIndex....so does that mean that tsMuxer automatically de-telecines the video? If so that is an easy way to process the TS files to de-telecine then remux into a TS file and then just load them into FFmpeg Batch AV and encode with no de-interlacer at all.....much faster and I can simply run my TS files through tsMuxer after the edit process to make it rather quick and automated.
EDIT.....nope, I got something wrong in DGIndex because it didn't remove the telecine either.Last edited by Ronstang; 12th Sep 2021 at 21:36.
-
Not sure, the -vf part should work. Might be a NVEnc issue, or ffmpeg version you are using. Try a different encoder like libx264 to help debug the issue , then try different ffmpeg version. There were some recent issues with NVEnc timestamps IIRC on the ffmpeg ticket tracker
No - "Force film" only alters the project file .d2v as read by avisynth. It doesn't alter the actual video (hence the same file size), only the frameserved video through avisynth
If you recorded something over HD/TV , it will never be soft telecine (repeat field flags) - it will always be hard telecine (encoded interlaced, as actually encoded repeated fields) , so "force film" is not applicable anyways, even through avisynth . You would have to use TIVTC or similar package -
-
I hope I loaded this file properly. I found the log file under appdata.
-
Nothing too helpful there
If you include -report in the command line, it should write a more verbose log
What is your input file ? Copy &paste the mediainfo (view=>text) report
I would try libx264 software encoding first, to rule in or out if it's a problem with that current version of hevc_nvenc with that version of ffmpeg you're using . Use preset:v superfast or ultrafast 8bit encoding; you're just doing a fast check to see if there are errors upstream or other issues . In fact you can downscale it smaller for the quick check for faster encoding - You're just checking in mpv/potplayer to see if those problems occur, or sync, or seek issues
Code:ffmpeg -i input.ext -vf "fps=30000/1001,fieldmatch,bwdif=deint=interlaced,decimate,scale=640:360" -c:v libx264 -preset:v superfast -crf 20 -c:a copy -c:s copy test.mkv
-
Here is the mediainfo of one of the files I tried that failed:
General
ID : 1 (0x1)
Complete name : A:\TS Temp\Stunts (1977) TCMHDU.ts
Format : MPEG-TS
File size : 7.30 GiB
Duration : 1 h 29 min
Overall bit rate mode : Variable
Overall bit rate : 11.6 Mb/s
Movie name : Bobbie Jo and the Outlaw
Law rating : TV-PG (LV)
Video
ID : 256 (0x100)
Menu ID : 1 (0x1)
Format : MPEG Video
Format version : Version 2
Format profile : Main@High
Format settings, BVOP : No
Format settings, Matrix : Default
Format settings, GOP : Variable
Format settings, picture structure : Frame
Codec ID : 2
Duration : 1 h 29 min
Bit rate mode : Variable
Bit rate : 10.4 Mb/s
Maximum bit rate : 20.0 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 29.970 (30000/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.167
Time code of first frame : 00:59:59:27
Time code source : Group of pictures header
GOP, Open/Closed : Open
Stream size : 6.53 GiB (89%)
Audio #1
ID : 257 (0x101)
Menu ID : 1 (0x1)
Format : AC-3
Format/Info : Audio Coding 3
Commercial name : Dolby Digital
Codec ID : 129
Duration : 1 h 29 min
Bit rate mode : Constant
Bit rate : 448 kb/s
Channel(s) : 6 channels
Channel layout : L R C LFE Ls Rs
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 SPF)
Compression mode : Lossy
Delay relative to video : -26 ms
Stream size : 288 MiB (4%)
Language : English
Service kind : Complete Main
Audio #2
ID : 258 (0x102)
Menu ID : 1 (0x1)
Format : AC-3
Format/Info : Audio Coding 3
Commercial name : Dolby Digital
Codec ID : 129
Duration : 1 h 29 min
Bit rate mode : Constant
Bit rate : 192 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 SPF)
Compression mode : Lossy
Delay relative to video : -26 ms
Stream size : 124 MiB (2%)
Language : Spanish
Service kind : Complete Main
Text #1
ID : 256 (0x100)-CC1
Menu ID : 1 (0x1)
Format : EIA-608
Muxing mode : A/53 / DTVCC Transport
Muxing mode, more info : Muxed in Video #1
Duration : 1 h 29 min
Bit rate mode : Constant
Stream size : 0.00 Byte (0%)
CaptionServiceName : CC1
Text #2
ID : 256 (0x100)-CC3
Menu ID : 1 (0x1)
Format : EIA-608
Muxing mode : A/53 / DTVCC Transport
Muxing mode, more info : Muxed in Video #1
Duration : 1 h 29 min
Bit rate mode : Constant
Stream size : 0.00 Byte (0%)
CaptionServiceName : CC3
Text #3
ID : 256 (0x100)-1
Menu ID : 1 (0x1)
Format : EIA-708
Muxing mode : A/53 / DTVCC Transport
Muxing mode, more info : Muxed in Video #1
Duration : 1 h 29 min
Bit rate mode : Constant
Stream size : 0.00 Byte (0%)
Text #4
ID : 256 (0x100)-2
Menu ID : 1 (0x1)
Format : EIA-708
Muxing mode : A/53 / DTVCC Transport
Muxing mode, more info : Muxed in Video #1
Duration : 1 h 29 min
Bit rate mode : Constant
Stream size : 0.00 Byte (0%)
Menu
ID : 4096 (0x1000)
Menu ID : 1 (0x1)
Duration : 1 h 29 min
List : 256 (0x100) (MPEG Video) / 257 (0x101) (AC-3, English) / 258 (0x102) (AC-3, Spanish)
Title : Bobbie Jo and the Outlaw
Language : / English / Spanish
Service name : Service01
Service provider : FFmpeg
Service type : digital television
Law rating : TV-PG (LV)
Now ever single file that failed says the same thing "interlaced..top field first" yet when view in Avidemux frame by frame ever single one shows 2 combed frames then 3 normal which keeps repeating so I thought they were all 2:3 pulldown -
Hello Poisondeathray! The spatial AQ alway caused loss of sharpness and quality. But it is not only my personal taste. There is a PSNR/SSIM calcultaor in Rigaya's NVENC , it also gives worse numbers if spatial AQ was used..
Don't use FFMPEG's NVENC, because it has only half the encoding speed of Rigaja's NEVENC, and have less encoding options and functions too. FFMPEG NVENC produces worse quality video. -
Yes, that's expected
"interlaced...top field first" only indicates the method of encoding, nothing about the actual content (progressive 23.976p in the case of movies)
ie. It just means the progressive content was organized and encoded as 59.94 fields / s interlaced. This is what hard telecine means. That's 25% extra fields for nothing. Wasted bitrate and data. The reason is to make it compatible with NTSC systems
Soft telecine would mean it's encoded progressively. Only 23.976p frames/sec are encoded. Repeat field flags simulate the repeated fields that were "physically" encoded in the hard telecine case. The quality is always better at a given bitrate (if everything else is the same). You generally only find soft telecine on DVD's -
Almost all psy options wiill lower PSNR and SSIM at a given bitrate - this is well known from other encoders. It actually tells you that in the Nvidia NVEnc instructions .
But PSNR/SSIM are problematic measures of "quality" - there are many issues with using them , and interpreting them.
More modern subjective measures of quality were introduced, such as VMAF which incorporate human perspective, but all of them still have issues
In general , increasing AQ spatial modes for any encoder will increase the bitrate at any QP or CRF - and that will increase the quality - beacuse increasing the bitrate will increase the qualtiy (but show lower quality per bitrate on metrics)
The reason for the OP was to selectively improve dark scenes, and spatial AQ does to an extent - But as discussed - not as selectively x265's modes designed for this purpose. You don't want to "balloon" the bitrate in other sections just to improve the dark scenes, otherwise you could use use a higher bitrate overall or lower CRF or QP
If you want ultimate control, you can use a qp file , but this is not available with NVEnc
Don't use FFMPEG's NVENC, because it has only half the encoding speed of Rigaja's NEVENC, and have less encoding options and functions too. FFMPEG NVENC produces worse quality video. -
OK, I understand this better now...but what do I do? I changed to the latest version of ffmpeg, I upgraded to the latest version of FFmpeg Batch, and I even upgraded my video driver as requested when I tried to do a new encode with the new versions....yet I still have corrupted videos. De-interlacing with yadif or bwdif don't work properly according to all that I have learned but the video isn't corrupted and actually plays. I need to inverse telecine but that is not working. I have thousands of movies to encode, I need to figure something out.
-
Current isn't always "better" - new commits sometimes (often) break things in ffmpeg land
What did -report say on the new test ?
Did you try software libx264 ? You have to do some test to figure out where the problem is . How do you know inverse telecine isn't working ? You don't. How do you know it's not a NVEnc issue? Or source issue (unlikely because you said same thing happened on a bunch of them). This is how you find out - you do tests to rule out the issue. If libx264 works, it's not a -vf <blah> issue, it's something else
Did you try default switches for hevc_nvenc ? Maybe one of the modes breaks things
The other worse method is just to leave it interlaced and let the player IVTC on the fly, but HEVC doesn't properly support interlace, you can only do that with AVC or MPEG2
If you double rate deinterlace (yadif2x or bwdif2x) , you encode 2.5x the number of frames, but at least it won't be as stuttery as single rate
Or just use some popular GUI that works like staxrip, handbrake, megui, etc... -
I ran the same movie through FFmpeg Batch AV Converter using the libx264 like you suggested and once again the IVTC does not work. I have exactly the same issue as I did with NVENC and HEVC so we can rule out that issue. I forgot to add the -report to the commandline string but I can run another if you need it.
So, it if is an ffmpeg issue can you suggest a build I should try that you know works? -
-report might help identify other issues
How long before problems first occur on average ? I can try it locally on a hard telecine DVD, but there might be other differences or issues with your sources -
Yes something is buggy (or at least different) with recent versions. The timestamps are messed up, at least for makedvd ripped DVD input
Let me look into it... -
Even their own example doesn't work properly right now, at least for makemkv ripped dvd input
https://ffmpeg.org/ffmpeg-filters.html#fieldmatch
Advanced IVTC, with fallback on yadif for still combed frames:
Code:fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
-
ok I think the issue was makemkv and VFR timecodes, I was getting very bizzare timecodes and average framerates like 238fps
current version of ffmpeg works ok on a CFR 1080i hard telecined source for me using
Code:-vf "fieldmatch,yadif=deint=interlaced,decimate"
Code:-vf "fieldmatch,bwdif=mode=0:deint=1,decimate
-
Thank you, I have done a bunch of testing encoding the same movie many different ways with the new parameters you poseted yesterday. but I have some issues. Any movie encoded with the new command line parameters for de-telecine have one bad side affect.
They won't play properly in MPV, the status bar shows the time constantly changing like it is scanning the movie but it never finishes, if I try to jump to a different part of the movie using the timeline bar it just jumps back to the beginning and you cannot fast forward.
PotPlayer takes about 15 seconds to load and scan the file before it will show the correct length of the movie in the timeline, it plays correctly and once fully scanned you can jump through the movie with the mouse on he timeline or use the fast forward button.
VLC loads the file and scans it for 10-15 seconds before it shows anything, then it starts to play but if you try to jump to a new spot in the movie it freezes and there is no recovery.
I loaded all my test files to my testing area in emby and they play, but the timeline never shows the length of the movie, even while playing, and you cannot fast forward...but the movie continues to play, I assume until it is over.
The quality of the files is superb and they are smaller than I have seen at this quality with the limited testing I have done but the playback issues are a problem.
This movie is one recorded from TCM. I used this because by far TCM is the largest source of material in my library.
Any ideas?? -
Not sure. It might be your source has timestamp issues too, I had the same issues with makemkv ripped DVD with ffmpeg, but the 1080i hard telecine source was ok. Playback issues like that are likely related to timestamps
It gives you the example, but sometimes it doesn't work. I can replicate some of the failures. It's almost always related to timestamps. It's just not that reliable
https://ffmpeg.org/ffmpeg-filters.html#Examples-67
It's already been suggested, but if you want it done right, just use avisynth or vapoursynth. It just works. None of this flaky buggy crap. Even on sources that ffmpeg can process properly, the ivtc quality is lower because matches are sometimes wrong. Orphaned fields and combing fallback can be processed with QTGMC, which ffmpeg cannot do alone. There was a comparison thread posted with a bunch of sources. Anyone serious about IVTC uses avisynth or vapoursynth, that's it. -
I would try avisynth if I had any clue how to use it. I do not understand scripting, language, syntax...etc. If I could find a way to try it I would but I also don't want AVI files. I also have several thousand files backlogged because I can't find a solution to my problem so manually doing each one may not be feasible.
Can avisynth process the TS files in a way to only perform the IVTC without compression so I could then run them through ffmpeg?
There has to be a solution to this, how can so many people be using this stuff WRONG. I am in quite the conundrum now as I know enough to know what I have been doing is wrong and is responsible for some of the problems I have been experiencing but at the same time there does not seem to be a workable solution. -
Start by using one of the GUI's, and slowly learn more when you have time. I'm pretty sure there are batch processing GUI's, just like there are batch scripters
Can avisynth process the TS files in a way to only perform the IVTC without compression so I could then run them through ffmpeg?
Or you can use NVEncC mentioned earlier if you were using NVEnc. NVEncC also has .avs support
There has to be a solution to this, how can so many people be using this stuff WRONG. I am in quite the conundrum now as I know enough to know what I have been doing is wrong and is responsible for some of the problems I have been experiencing but at the same time there does not seem to be a workable solution.
FFmpeg does work ok for IVTC - sometimes - when the source video has perfect timestamps, and is perfect cadence - that can be an issue for TV stuff which was is often edited before removing pulldown (cadence breaks) -
Transport streams are amongst the hardest to deal with because they can change properties at any time. Most editors look at the first header to get the A/V properties and assume those are valid for the entire file. But the first header may not reflect the properties of the rest of the video. Resolution, frame rate, codec, interlacing, etc. can all change.
Beware of DVD MPEG2 in MKV (MakeMKV rips) -- editors often screw that up as well. For example, DgIndex (commonly used to index DVD video for AviSynth doesn't work well with MKV from MakeMKV). You usually want to index the VOB files directly for that.
Similar Threads
-
Nvidia HEVC very low quality?
By Jiehfeng in forum Video ConversionReplies: 16Last Post: 25th Nov 2020, 12:23 -
Improve brightness on streaming Movies, too dark to watch on my Laptop
By koolkanga in forum ComputerReplies: 2Last Post: 9th Sep 2018, 02:40 -
Is there a way to improve the quality of this video?
By ciccioschumacher in forum RestorationReplies: 7Last Post: 26th Jul 2018, 08:29 -
HEVC and H264 bitrate/quality equivalency
By philvideofilm in forum Video ConversionReplies: 15Last Post: 29th Sep 2017, 19:41 -
Awful video quality at dark scenes encoding x265/HEVC
By TheFunkyDude in forum Video ConversionReplies: 5Last Post: 12th Sep 2017, 21:05