[FFmpeg-user] Convert DV to DVD HQ Video with PCM_DVD Audio

Terje J. Hanssen terjejhanssen at gmail.com
Tue Mar 21 09:03:46 EET 2023


I want to get a PAL DVD High quality output file that can be loaded 
directly into DeVeDe for authoring the DVD Video structure and creating 
the DVD Video ISO for burning on a 4.7 GB disc.

Comments and suggestions to better and troubleshoot the ffmpeg command 
lines below are welcome ;)

The 2.0Gb PAL DV interlaced test file (input):

    ffprobe -hide_banner dv01.dv
    [dv @ 0x5642dfbc6f00] Estimating duration from bitrate, this may be
    inaccurate
    [dv @ 0x5642dfbc6f00] Could not find codec parameters for stream 0
    (Video: dvvideo, none, 25000 kb/s): unspecified size
    Consider increasing the value for the 'analyzeduration' (0) and
    'probesize' (5000000) options
    Input #0, dv, from 'dv01.dv':
       Metadata:
         timecode        : 00:00:00:00
       Duration: 00:09:56.48, start: 0.000000, bitrate: 28800 kb/s
       Stream #0:0: Video: dvvideo, none, 25000 kb/s, SAR 16:15 DAR 0:0,
    25 fps, 25 tbr, 25 tbn
       Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Unsupported codec with id 24 for input stream 0


As a learning test procedure I have started with the preset fromWinFF's 
command line for PAL DVD HQ Fullscreen:

    -f dvd -target pal-dvd -aspect 4:3 -vb 8000k -mbd rd -trellis 1
    -flags +mv0 -cmp 0 -subcmp 2



Converting DV to DVD HQ Video using ffmpeg version 5.1.2 on openSUSE 
Tumbleweed:

1) First try with WinFF's PAL DVD HQ Fullscreen preset:

    ffmpeg -hide_banner -i dv01.dv -f dvd -target pal-dvd -aspect 4:3
    -vb 8000k -mbd rd -trellis 1 -flags +mv0 -cmp 0 -subcmp 2
    paldvdhqFS-dv01.mpg
    [dv @ 0x55a5b427afc0] Estimating duration from bitrate, this may be
    inaccurate
    Input #0, dv, from 'dv01.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], 25000 kb/s, 25 fps, 25 tbr, 25 tbn
       Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Stream mapping:
       Stream #0:0 -> #0:0 (dvvideo (native) -> mpeg2video (native))
       Stream #0:1 -> #0:1 (pcm_s16le (native) -> ac3 (native))
    Press [q] to stop, [?] for help
    [ac3 @ 0x55a5b42b2f40] [Eval @ 0x7fff8c7f54f0] Undefined constant or
    missing '(' in 'mv0'
    [ac3 @ 0x55a5b42b2f40] Unable to parse option value "mv0"
    [ac3 @ 0x55a5b42b2f40] [Eval @ 0x7fff8c7f51a0] Undefined constant or
    missing '(' in 'mv0'
    [ac3 @ 0x55a5b42b2f40] Unable to parse option value "mv0"
    [ac3 @ 0x55a5b42b2f40] Error setting option flags to value +mv0.
    Error initializing output stream 0:1 -- Error while opening encoder
    for output stream #0:1 - maybe incorrect parameters such as
    bit_rate, rate, width or height
    Conversion failed!

Can someone explain what the purpose of the option "-flags +mv0" is and 
how the correct syntax should be here?


2) Second try with WinFF's PAL DVD HQ Fullscreen preset - but without 
"-flags +mv0"

    ffmpeg -hide_banner -i dv01.dv -f dvd -target pal-dvd -aspect 4:3
    -vb 8000k -mbd rd -trellis 1 -cmp 0 -subcmp 2 paldvdhqFS-dv01.mpg
    [dv @ 0x55e332c97fc0] Estimating duration from bitrate, this may be
    inaccurate
    Input #0, dv, from 'dv01.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], 25000 kb/s, 25 fps, 25 tbr, 25 tbn
       Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Stream mapping:
       Stream #0:0 -> #0:0 (dvvideo (native) -> mpeg2video (native))
       Stream #0:1 -> #0:1 (pcm_s16le (native) -> ac3 (native))
    Press [q] to stop, [?] for help
    Output #0, dvd, to 'paldvdhqFS-dv01.mpg':
       Metadata:
         timecode        : 00:00:00:00
         encoder         : Lavf59.27.100
       Stream #0:0: Video: mpeg2video (Main), yuv420p(bottom coded first
    (swapped)), 720x576 [SAR 16:15 DAR 4:3], q=2-31, 6000 kb/s, 25 fps,
    90k tbn
         Metadata:
           encoder         : Lavc59.37.100 mpeg2video
         Side data:
           cpb: bitrate max/min/avg: 9000000/0/6000000 buffer size:
    1835008 vbv_delay: N/A
       Stream #0:1: Audio: ac3, 48000 Hz, stereo, fltp, 448 kb/s
         Metadata:
           encoder         : Lavc59.37.100 ac3
    frame=14912 fps=165 q=4.6 Lsize=  478412kB time=00:09:56.47
    bitrate=6570.5kbits/s speed=6.62x
    video:436890kB audio:32620kB subtitle:0kB other streams:0kB global
    headers:0kB muxing overhead: 1.896073%


468M    paldvdhqFS-dv01.mpg (output)

    ffprobe -hide_banner paldvdhqFS-dv01.mpg
    [mpeg @ 0x5604a1dbaec0] start time for stream 0 is not set in
    estimate_timings_from_pts
    Input #0, mpeg, from 'paldvdhqFS-dv01.mpg':
       Duration: 00:09:56.49, start: 0.534667, bitrate: 6570 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
       Stream #0:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 448 kb/s
    Unsupported codec with id 98312 for input stream 0

Can someone explain what option in the preset used that set the Audio 
codec to ac3 ?


3) Third try with WinFF's PAL DVD HQ Fullscreen preset + PCM Audio

If I understand the essence correctly of https://trac.ffmpeg.org/ticket/6782
pcm_dvd Audio codec was added 5 years ago (?).

    ffmpeg -hide_banner -codecs | egrep pcm_dvd
      DEAI.S pcm_dvd              PCM signed 20|24-bit big-endian


If I add "-c:a pcm_dvd" in front of the preset above, ffmpeg does output 
the message:

    Multiple -c, -codec, -acodec, -vcodec, -scodec or -dcodec options
    specified for stream 1, only the last option '-c:a ac3' will be used.

Apparantly it works by adding "-c:a pcm_dvd" at the end of the preset as 
follows - but with buffer underflow:

    ffmpeg -hide_banner -i dv01.dv -f dvd -target pal-dvd -aspect 4:3
    -b:v 8M -mbd rd -trellis 1 -cmp 0 -subcmp 2 -c:a pcm_dvd
    paldvdhqFS+pcm_dvd_dv01.mpg
    .........  a lot of
    [dvd @ 0x55e15377c200] buffer underflow st=1 bufi=760 size=2008
    [dvd @ 0x55e15377c200] buffer underflow st=1 bufi=764 size=2008
    [dvd @ 0x55e15377c200] buffer underflow st=1 bufi=768 size=2008
    [dvd @ 0x55e15377c200] buffer underflow st=1 bufi=772 size=1896
    frame=14912 fps=145 q=3.3 Lsize=  703070kB time=00:09:56.48
    bitrate=9655.9kbits/s speed=5.81x
    video:579217kB audio:112007kB subtitle:0kB other streams:0kB global
    headers:0kB muxing overhead: 1.713745%


687M    paldvdhqFS+pcm_dvd_dv01.mpg (output)

    ffprobe -hide_banner paldvdhqFS+pcm_dvd_dv01.mpg
    [mpeg @ 0x55b9fbdecec0] start time for stream 0 is not set in
    estimate_timings_from_pts
    [mpeg @ 0x55b9fbdecec0] stream 1 : no PTS found at end of file,
    duration not set
    Input #0, mpeg, from 'paldvdhqFS+pcm_dvd_dv01.mpg':
       Duration: 00:09:56.48, start: 0.540000, bitrate: 9655 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
       Stream #0:2[0xa0]: Audio: pcm_dvd, 48000 Hz, stereo, s16, 1536 kb/s
    Unsupported codec with id 98312 for input stream 0

4) Loading paldvdhqFS+pcm_dvd_dv01.mpg into DeVeDe, selecting 
<Properties ¦ Misc> first option "This file is already a 
DVD/xCD-suiteable MPEG-PS file" and <Forward>
creates the DVD tree structure and the DVD ISO file. (The second option 
"Packaging Audio and Video without reencoding (useful for VOB files)" 
doesn't contain Audio)

687M    VTS_02_1.VOB (from DeVeDe's tree structure)

    ffprobe -hide_banner VTS_02_1.VOB
    [mpeg @ 0x562b54489f00] stream 1 : no PTS found at end of file,
    duration not set
    Input #0, mpeg, from 'VTS_02_1.VOB':
      Duration: 00:09:56.48, start: 0.540000, bitrate: 9655 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
      Stream #0:2[0xa0]: Audio: pcm_dvd, 48000 Hz, stereo, s16, 1536 kb/s

    mediainfo VTS_02_1.VOB
    General
    Complete name                            : VTS_02_1.VOB
    Format                                   : MPEG-PS
    File size                                : 687 MiB
    Duration                                 : 9 min 56 s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 9 656 kb/s

    Video
    ID                                       : 224 (0xE0)
    Format                                   : MPEG Video
    Format version                           : Version 2
    Format profile                           : Main at Main
    Format settings, BVOP                    : No
    Format settings, Matrix                  : Default
    Format settings, GOP                     : N=15
    Duration                                 : 9 min 56 s
    Bit rate mode                            : Variable
    Bit rate                                 : 7 928 kb/s
    Maximum bit rate                         : 9 000 kb/s
    Width                                    : 720 pixels
    Height                                   : 576 pixels
    Display aspect ratio                     : 4:3
    Frame rate                               : 25.000 FPS
    Standard                                 : PAL
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Compression mode                         : Lossy
    Bits/(Pixel*Frame)                       : 0.765
    Time code of first frame                 : 00:00:00:00
    Time code source                         : Group of pictures header
    GOP, Open/Closed                         : Open
    GOP, Open/Closed of first frame          : Closed
    Stream size                              : 564 MiB (82%)

    Audio
    ID                                       : 189 (0xBD)-160 (0xA0)
    Format                                   : PCM
    Format settings                          : Big / Signed
    Muxing mode                              : DVD-Video
    Duration                                 : 9 min 56 s
    Bit rate mode                            : Constant
    Bit rate                                 : 1 536 kb/s
    Channel(s)                               : 2 channels
    Sampling rate                            : 48.0 kHz
    Bit depth                                : 16 bits
    Stream size                              : 109 MiB (16%)

    Menu
    Format                                   : DVD-Video


The question here is if pcm_dvd audio has been changed or "transcoded" 
from "PCM signed 20|24-bit big-endian" to 16 bits?



















More information about the ffmpeg-user mailing list