[Cin] Possibly better conversion quality at 2x speed/ bitrate and 25fps/ 50 fps

Terje J. Hanssen terjejhanssen at gmail.com
Mon Feb 19 22:47:15 CET 2024



Den 19.02.2024 19:25, skrev Andrew Randrianasulu:
>
>
> пн, 19 февр. 2024 г., 20:59 Terje J. Hanssen via Cin 
> <cin at lists.cinelerra-gg.org>:
>
>     Thirty years ago I tape recordered some hundreds of old genealogy
>     photos, which I now plan to convert from SD-DV files to burn on
>     DVD video discs.
>     The camcordings were made with fade in/out, zoom closeups and pan
>     effects,  which fit well at 2x playback speed and with additional
>     pause/play navigation on DVD videos.
>
>     Signal/noise at 2x speed with same fps and bitrate (halph of the
>     fps are dropped), should result in output with 1/2 playback
>     duration and equivalent quality as normal speed.
>
>     Yet I wonder if it possible in some way to achieve better quality
>     if also 2x bitrate and fps are possible to utilize temporarily as
>     a better quality base (downsampling), even if DVD video limits the
>     fps and bitrate?
>
>
>
> They are progressive (not interlaced) dv files, right? I only can 
> think about fields-> frames conversion, that changes both frame size 
> and fps. There might be some movement interpolation algorithms, or 
> even neural nets nowadays, but I can't see any use of it directly in 
> ffmpeg (for one command conversion) as long as output remain at 25 
> fps. But there might be some sideefects that makes viewing better/worse?
>
> Bitrate for consumer dv is fixed at 25Mbits, dv50 obviously goes above 
> that *2, but not sure if you  gain anything by transcoding into dv? 
> (it was important when other hardware worked with those files, or they 
> were  transferred back to tape. But our current case is single Linux 
> workstation only..?). mpeg2 dvd video yeah, seems to have gard upper 
> cap on how big bitrate-wise it can go - you can try other stuff like 
> custom matrixes and see if they improve quality ...

Yeah, I've tried additional "-target pal-dv50" which allowed bitrate 
57Mbps, but only 25fps, which resulted in full 9 minutes duration. I 
read somewhere DVCPRO50 should allow 50 fps.
By the way not so important because the conversions to .dv were merely 
tests to see if 2x speed and 25fps/50fps worked.

All DV files are interlaced, while conversion "-f dvd -target pal-dvd" 
creates progressive MPG(-PS) dvd video files.

What is remarkable when comparing the 4) and 5) MPG files are:
They practical have the same file size 218M, the same bitrate 6115 
(6118) kb/s, the same duration 00:04:58
but different 25 fps vs 50 fps according to ffprobe.

Mediainfo reports correspondingly, and additional differences:

  * Format settings, GOP : Variable vs N=15
  * Bits/(Pixel*Frame) :   0.578 vs 0.289

It's not possible to see any visible difference at playback, and I will 
continue with 4) due to 25 fps dvd video compliance.


>
> I think there was yuvfps tool in mjpegtools, but I never used it ...
>
>
>
>     Here are my test samples so far:
>
>     du -sh dv95*
>     1) 2,0G    dv95.dv (input source)
>
>     2) 1,1G  dv95_2x_25fps.dv
>     3) 2,0G  dv95_2x_50fps.dv
>
>     4) 218M  dv95_2x_25fps.mpg
>     5) 218M  dv95_2x_50fps.mpg
>
>
>     1)
>     ffprobe -hide_banner dv95.dv (source DV, Duration: 00:09:56.48)
>
>         [dv @ 0x55d65d6ca080] Estimating duration from bitrate, this
>         may be inaccurate
>         Input #0, dv, from 'dv95.dv':
>         Metadata:
>         timecode        : 00:00:00:00
>         Duration: 00:09:56.48, start: 0.000000, bitrate: 28800 kb/s
>           Stream #0:0: Video: dvvideo, yuv420p, 720x576 [SAR 16:15 DAR
>         4:3], 28800 kb/s, 60k fps, 25 tbr, 60k tbn
>           Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
>
>
>
>     ffmpeg conversions using the FFmpeg setpts filter
>     http://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video#setptsfilter
>
>
>     2)
>     ffmpeg -i dv95.dv -vf "setpts=0.5*PTS" -an dv95_2x_25fps.dv
>
>     ffprobe -hide_banner dv95_2x_25fps.dv
>
>         [dv @ 0x5582eb685080] Estimating duration from bitrate, this
>         may be inaccurate
>         Input #0, dv, from 'dv95_2x_25fps.dv':
>           Metadata:
>             timecode        : 00:00:00:00
>           Duration: 00:04:58.32, start: 0.000000, bitrate: 28800 kb/s
>           Stream #0:0: Video: dvvideo, yuv420p, 720x576 [SAR 16:15 DAR
>         4:3], 28800 kb/s, 60k fps, 25 tbr, 60k tbn
>
>
>     3) I wonder why the Duration is still 00:09:56.52 here ?
>
>     ffmpeg -hide_banner -i dv95.dv -r 50 -vf "setpts=0.5*PTS" -an
>     dv95_2x_50fps.dv
>
>     ffprobe -hide_banner dv95_2x_50fps.dv
>
>         [dv @ 0x55fe0b5bb080] Estimating duration from bitrate, this
>         may be inaccurate
>         Input #0, dv, from 'dv95_2x_50fps.dv':
>         Metadata:
>         timecode        : 00:00:00:00
>         Duration: 00:09:56.52, start: 0.000000, bitrate: 28800 kb/s
>           Stream #0:0: Video: dvvideo, yuv420p, 720x576 [SAR 16:15 DAR
>         4:3], 28800 kb/s, 60k fps, 25 tbr, 60k tbn
>
>
>     4)
>     ffmpeg -hide_banner -i dv95.dv -f dvd -target pal-dvd -aspect 4:3
>     -vf "setpts=0.5*PTS" -an dv95_2x_25fps.mpg
>
>     ffprobe -hide_banner dv95_2x_25fps.mpg
>
>         [mpeg @ 0x55a330208080] start time for stream 0 is not set in
>         estimate_timings_from_pts
>         Input #0, mpeg, from 'dv95_2x_25fps.mpg':
>         Duration: 00:04:58.32, start: 0.540000, bitrate: 6115 kb/s
>           Stream #0:0[0x1bf]: Data: dvd_nav_packet
>           Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv,
>         progressive), 720x576 [SAR 16:15 DAR 4:3], 25 fps, 25 tbr, 90k tbn
>             Side data:
>         cpb: bitrate max/min/avg: 9000000/0/0 buffer size: 1835008
>         vbv_delay: N/A
>         Unsupported codec with id 98312 for input stream 0
>
>
>     5)
>     ffmpeg -hide_banner -i dv95.dv -f dvd -target pal-dvd -r 50 -vf
>     "setpts=0.5*PTS" -an dv95_2x_50fps.mpg
>
>     ffprobe -hide_banner dv95_2x_50fps.mpg
>
>         [mpeg @ 0x555e13da2080] start time for stream 0 is not set in
>         estimate_timings_from_pts
>         Input #0, mpeg, from 'dv95_2x_50fps.mpg':
>         Duration: 00:04:58.26, start: 0.520000, bitrate: 6118 kb/s
>           Stream #0:0[0x1bf]: Data: dvd_nav_packet
>           Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv,
>         progressive), 720x576 [SAR 16:15 DAR 4:3], 50 fps, 50 tbr, 90k tbn
>             Side data:
>         cpb: bitrate max/min/avg: 9000000/0/0 buffer size: 1835008
>         vbv_delay: N/A
>         Unsupported codec with id 98312 for input stream 0
>
>
>
>
>
>
>
>
>
>
>     -- 
>     Cin mailing list
>     Cin at lists.cinelerra-gg.org
>     https://lists.cinelerra-gg.org/mailman/listinfo/cin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20240219/0e28e741/attachment.htm>


More information about the Cin mailing list