[Cin] dvdcreate and filempeg patches

Terje J. Hanssen terjejhanssen at gmail.com
Tue Jun 6 15:54:08 CEST 2023



Den 05.06.2023 20:51, skrev Andrew Randrianasulu:
>
>
> пн, 5 июн. 2023 г., 20:23 Andrew Randrianasulu <randrianasulu at gmail.com>:
>
>
>
>     пн, 5 июн. 2023 г., 20:18 Terje J. Hanssen <terjejhanssen at gmail.com>:
>
>
>
>         Den 05.06.2023 16:14, skrev Andrew Randrianasulu:
>>
>>
>>         пн, 5 июн. 2023 г., 15:34 Andrew Randrianasulu
>>         <randrianasulu at gmail.com>:
>>
>>
>>
>>             пн, 5 июн. 2023 г., 15:31 Terje J. Hanssen
>>             <terjejhanssen at gmail.com>:
>>
>>
>>
>>                 Den 04.06.2023 21:58, skrev Andrew Randrianasulu:
>>>
>>>
>>>                 вс, 4 июн. 2023 г., 15:07 Terje J. Hanssen
>>>                 <terjejhanssen at gmail.com>:
>>>
>>>
>>>
>>>                     Den 31.05.2023 07:24, skrev Andrew Randrianasulu
>>>                     via Cin:
>>>                     > I ......
>>>                     >
>>>                     > ===
>>>                     >
>>>                     > and mpeg2enc line looked like this
>>>                     >
>>>                     > FileMPEG::open_file: Running
>>>                     > /dev/shm/cinelerra/cinelerra-5.1/bin//mpeg2enc
>>>                     -v 0  -b 8000 -q 1 -a 2
>>>                     > -F 3 -H -c -I 1 -M 4 -z b -f 8 -g 15 -G 15 -R 0 -o
>>>                     > '/dev/shm/tmp/dvd_20230531-081921/dvd.m2v'
>>>                     >
>>>                     >
>>>
>>>                     Is it possible to get the mpeg2enc command line
>>>                     to test it with a dv
>>>                     input file directly outside Cinelerra?
>>>
>>>
>>>                 try line like this?
>>>
>>>                 ffmpeg -i input.dv -f yuv4mpegpipe - \
>>>                   |mpeg2enc {flags and output file as shown }
>>>
>>
>>                 Yes, this fixed the BFF issue, but still Interlaced
>>                 and 4:3 format.
>>                 Stream #0:0: Video: mpeg2video (Main), yuv420p(tv,
>>                 bt470bg, bottom first), 720x576 [SAR 16:15 DAR 4:3],
>>                 25 fps, 25 tbr, 1200k tbn
>>
>>                 What I want is to get and try Progressive and 16:9
>>                 wide format. By cropping 720x576 to 720x405, bottom
>>                 65 and top 106 (top) preserves the displayed timestam
>>                 at bottom.
>>
>>
>>
>>             Then you should try ffmpeg's deinterlacing and cropping
>>             before passing it to mpeg2enc.
>>
>
>         I tried
>         ffmpeg -i dv01.dv -aspect 16:9 -vf crop=iw-0-0:ih-106-65:0:106
>         -f yuv4mpegpipe -
>         that resulted in interlaced bff:
>         Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, bt470bg,
>         bottom first), 720x404 [SAR 101:135 DAR 4:3], 25 fps, 25 tbr,
>         1200k tbn
>
>
>     I think mpeg2enc part of full cmd line need their own tweaks
>     relative to one you get from cingg, for progressive and aspect
>     ratio corrected output .....
>
Here were a lot to sort out:

The dvd-wide-ffmpeg+mpeg2enc.m2v from here is also scaled or streched 
too high in vertical direction.
VLC deinterlaced on playback  (keyboard D) on interlaced m2v gives 
better quality.

>
>
>         In comparision the ffmpeg command line I have used is:
>         ffmpeg  -i dv01.dv -f dvd -target pal-dvd -aspect 16:9 -vb
>         8000k -mbd rd -trellis 1 -cmp 0 -subcmp 2 -vf
>         crop=iw-0-0:ih-106-65:0:
>         which results in progressive and DAR 16:9, but still not so
>         good edge quality
>
>
> May be "progressive" here is error, and ffmpeg still encodes 
> interlaced-as-progressive, so VLC for example does not enable 
> deinterlacer at playback automatically?

VLC Deinterlaced ON playback of Progressive  dvd-wide-dv01.mpg results 
in more coarced jagged or saw-toothed round edges

>
> Have you tried to add interlaced flags manually to ffmpeg's command line?
-flags +ilme+ildct  gives interlaced bff

>
>
> Did you also tried to force deinterlacer in VLC? (or may be xine).
>
> I hope my next mail contain enough of filtering lines for you to try 
> after interlaced crop.
>
>
>
>         Stream #0:0[0x1bf]: Data: dvd_nav_packet
>           Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv,
>         progressive), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr,
>         90k tbn
>             Side data:
>               cpb: bitrate max/min/avg: 9000000/0/0 buffer size:
>         1835008 vbv_delay: N/A
>           Stream #0:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 448 kb/s
>         Unsupported codec with id 98312 for input stream 0
>
>
>
>>
>>         http://macilatthefront.blogspot.com/2021/05/which-deinterlacing-algorithm-is-best.html?m=1
>>
>>         talks about some algos on ffmpeg I never considered:
>>
>>
>>               Estdif / Bwdif
>>
>>         TS. bwdif  V->V       Deinterlace the input image.
>>          TSC estdif V->V       Apply Edge Slope Tracing deinterlace.
>>
>>
>
>         Yes, of interest if I knew how to put this into the ffmpeg
>         command line above, with reference to the blog:
>         /*Bwdif (FFMPEG): *//Good at reconstructing smooth lines and
>         retaining overall image detail with SD content, faster than
>         QTGMC but not as good.
>         //*QTGMC
>         <https://macilatthefront.blogspot.com/2021/01/deinterlacing-with-avisynth-and-qtgmc.html>:*
>         Best retention of original image detail and handling of edge
>         case artifacts,
>
>         /
>>
>>
>>
>>             Can you clarify even with my patches AND deinterlacing
>>             checkbox set in dvd creation window and "use ffmpeg"
>>             unchecked you still get interlaced?
>>
>>
>
>         I can do it, when it is included with the next Cin apps.
>
>>
>>
>>
>>>                 quite amazing ffmpeg in this most basic case still
>>>                 works after nearly 20 years, line stolen (and
>>>                 modified)  from
>>>
>>>                 https://avva.livejournal.com/1188593.html
>>>
>>>
>>                 Creating DVD with typical ffmpeg decoding to raw
>>                 video piped to mpeg2enc for encoding has been the
>>                 usual way as described in the Cin-CV manual
>>                 http://cinelerra-cv.wikidot.com/cincv-manual-en:rendering-files#11
>>
>>                 and is also included in Ruh's dvd guid sec. 3.4
>>                 https://www.qsl.net/n1gg/linux/video/linuxdvdguide.html#3
>>
>>                 mpeg2enc is said to give some higher quality at high
>>                 bitrate that ffmpeg.
>>                 The drawback is it is slow and audio and to be added
>>                 and multiplexed
>>
>>
>>>                 For ffmpeg as I said cingg does NOT  use command
>>>                 line ffmpeg, so you need to modify profile
>>>                 parameters in dvd.dvd file.
>>>
>>>
>>>                     And preferably also a corresponding ffmpeg
>>>                     command line.
>>>
>>>                     I had already created a .mpg video file,
>>>                     interlaced and bff, and it was
>>>                     no better, so I think deinterlaced (progressive)
>>>                     will be best.
>>>
>>>
>>>                 your call!
>>>
>>>                 Happy coding!
>>>
>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20230606/e2240e86/attachment-0001.htm>


More information about the Cin mailing list