Hello,

I'm using dvdvideo demuxer to encode some of my old DVDs. I'm using Solus Linux distro. The ffmpeg command below works, I mean I get a working and readable h264 file in the end, there only is a strange error at the end of the process that I am curious what it is about. Solving it would definitively makes me happy and stop using HandBrake (which doesn't ship vaapi) ;)

Here is ffmpeg version and settings:

ffmpeg version 7.1.1 Copyright (c) 2000-2025 the FFmpeg developers
  built with clang version 19.1.6 (Solus 19.1.6-130)
configuration: --enable-gcrypt --enable-gnutls --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libcdio --enable-libdav1d --enable-libdvdnav --enable-libdvdread --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libjxl --enable-liblc3 --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librubberband --enable-libshaderc --enable-libsmbclient --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg --enable-lto --enable-nvdec --enable-nvenc --enable-openal --enable-opengl --enable-sdl2 --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan --disable-debug --disable-static --disable-stripping --libdir=/usr/lib64 --prefix=/usr --cc=clang --cxx=clang++

The command I'm using is below. I'm using vaapi hardware encoding (AMD RX 6700).

The $SOURCE is a folder that contains the DVD data (it is a mounted iso).

ffmpeg -f dvdvideo -title 4 -i "$SOURCE" \
    -map 0:v:0 \
    -map 0:a:m:language:jpn \
    -disposition +0 \
    -c:v h264_vaapi \
    -vaapi_device /dev/dri/renderD128 \
    -vf 'format=nv12,hwupload' \
    -b:v 3500k \
    -ac 2 \
    -metadata title="$DISC_NAME" \
    "$OUTPUT_FILE" \
    -y

It works well, until the end of the stream is reached. Below log extract (the libdvdcss is expected I suppose ?)

[dvdvideo @ 0x56113a52c940] libdvdread: Could not open /dev/loop0 with libdvdcss. [dvdvideo @ 0x56113a52c940] libdvdread: Can't open /dev/loop0 for reading [dvdvideo @ 0x56113a52c940] libdvdread: Device /dev/loop0 inaccessible, CSS authentication not available. [dvdvideo @ 0x56113a52c940] libdvdnav: Could not open /dev/loop0 with libdvdcss.
[dvdvideo @ 0x56113a52c940] libdvdnav: Can't open /dev/loop0 for reading
[dvdvideo @ 0x56113a52c940] libdvdnav: Device /dev/loop0 inaccessible, CSS authentication not available. [dvdvideo @ 0x56113a52c940] libdvdnav: Can't read name block. Probably not a DVD-ROM device.
[dvdvideo @ 0x56113a52c940] libdvdnav: vm: dvd_read_name failed
Input #0, dvdvideo, from $SOURCE:
  Duration: 00:01:34.48, start: 0.000000, bitrate: N/A
  Chapters:
    Chapter #0:0: start 0.000000, end 94.000000
    Chapter #0:1: start 94.000000, end 94.480000
Stream #0:0[0x1e0]: Video: mpeg2video, yuv420p(tv, top first), 720x576, SAR 64:45 DAR 16:9, 25 fps, 25 tbr, 90k tbn
      Side data:
cpb: bitrate max/min/avg: 9300000/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1[0x80](jpn): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (h264_vaapi))
  Stream #0:1 -> #0:1 (ac3 (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, mp4, to './converted_dvds/abc.mp4':
  Metadata:
    title           : (the source title)
    encoder         : Lavf61.7.100
  Chapters:
    Chapter #0:0: start 0.000000, end 94.000000
    Chapter #0:1: start 94.000000, end 94.480000
Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), vaapi(tv, top coded first (swapped)), 720x576 [SAR 64:45 DAR 16:9], q=2-31, 3500 kb/s, 25 fps, 12800 tbn
      Metadata:
        encoder         : Lavc61.19.101 h264_vaapi
Stream #0:1(jpn): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
      Metadata:
        encoder         : Lavc61.19.101 aac
[vf#0:0 @ 0x56113a7cb400] Reconfiguring filter graph because video parameters changed to yuv420p(tv, fcc), 720x576
^^^^^^^^^^^^^^^^^^THIS^^^^^^^^^^^^^^
Impossible to convert between the formats supported by the filter 'Parsed_hwupload_1' and the filter 'auto_scale_1'
^^^^^^^^^^^^^^^^^^THIS^^^^^^^^^^^^^
[vf#0:0 @ 0x56113a7cb400] Error reinitializing filters!
[vf#0:0 @ 0x56113a7cb400] Task finished with error code: -38 (Function not implemented) [vf#0:0 @ 0x56113a7cb400] Terminating thread with return code -38 (Function not implemented) [out#0/mp4 @ 0x56113a77bfc0] video:37429KiB audio:1435KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.166576% frame= 2348 fps=624 q=-0.0 Lsize= 38928KiB time=00:01:31.96 bitrate=3467.5kbits/s speed=24.4x
[aac @ 0x56113a792ac0] Qavg: 1585.304
Conversion failed!

I suspect the change happens whenever it reach the end and therefore try to seek to a DVD menu or something like that. Below the output of ffplay on the same title:

near ~98% I get:

[dvdvideo @ 0x7f3a8c000c80] new block: i=5 nav_event=7 nav_len=2048 cur_title=4 cur_ptt=2 cur_angle=1 cur_celln=2 cur_pgcn=1 cur_pgn=2 play_in_vts=1 play_in_pgc=1 play_in_ps=1 [dvdvideo @ 0x7f3a8c000c80] NAV packet: s_ptm=8492400 e_ptm=8535600 scr=8469796 lbn=46230 vobu_duration=43200 nav_pts=8460000 [dvdvideo @ 0x7f3a8c000c80] libdvdnav: Language 'en' not found, using 'fr' instead
[dvdvideo @ 0x7f3a8c000c80] libdvdnav: Menu Languages available: fr

(repeated)

[mpeg2video @ 0x7f3a8c03ff80] Format yuv420p chosen by get_format().
[ffplay_buffer @ 0x7f3a74abaf40] Changing video frame properties on the fly is not supported by all filters. [ffplay_buffer @ 0x7f3a74abaf40] filter context - w: 720 h: 576 fmt: 0 csp: unknown range: tv, incoming frame - w: 720 h: 576 fmt: 0 csp: fcc range: tv pts_time: 98.135122 [swscaler @ 0x7f3a7473a6c0] [swscaler @ 0x7f3a74a01b80] YUV color matrix differs for YUV->YUV, using intermediate RGB to convert

(repeated)

[swscaler @ 0x7f3a7473a6c0] [swscaler @ 0x7f3a746abc80] YUV color matrix differs for YUV->YUV, using intermediate RGB to convert [swscaler @ 0x7f3a7473a6c0] [swscaler @ 0x7f3a746b8c40] YUV color matrix differs for YUV->YUV, using intermediate RGB to convert [auto_scale_0 @ 0x7f3a74abb300] w:720 h:576 fmt:yuv420p csp:unknown range:tv sar:0/1 -> w:720 h:576 fmt:yuv420p csp:bt709 range:tv sar:0/1 flags:0x00000004 [auto_scale_0 @ 0x7f3a74abb300] [framesync @ 0x7f3a7455bbe8] Sync level 1 [swscaler @ 0x7f3a7473a6c0] [swscaler @ 0x7f3a74a01b80] YUV color matrix differs for YUV->YUV, using intermediate RGB to convert [swscaler @ 0x7f3a7473a6c0] [swscaler @ 0x7f3a74498e00] YUV color matrix differs for YUV->YUV, using intermediate RGB to convert

(repeated)

[auto_scale_0 @ 0x7f3a74abb300] w:720 h:576 fmt:yuv420p csp:unknown range:tv sar:0/1 -> w:720 h:576 fmt:yuv420p csp:bt709 range:tv sar:0/1 flags:0x00000004 [auto_scale_0 @ 0x7f3a74abb300] [framesync @ 0x7f3a7455bbe8] Sync level 1 [swscaler @ 0x7f3a7473a6c0] [swscaler @ 0x7f3a74a01b80] YUV color matrix differs for YUV->YUV, using intermediate RGB to convert

(repeated)

[auto_scale_0 @ 0x7f3a74abb300] w:720 h:576 fmt:yuv420p csp:fcc range:tv sar:0/1 -> w:720 h:576 fmt:yuv420p csp:bt709 range:tv sar:0/1 flags:0x00000004 [auto_scale_0 @ 0x7f3a74abb300] [framesync @ 0x7f3a7455bbe8] Sync level 1 [ffplay_buffer @ 0x7f3a74abaf40] Changing video frame properties on the fly is not supported by all filters. [ffplay_buffer @ 0x7f3a74abaf40] filter context - w: 720 h: 576 fmt: 0 csp: unknown range: tv, incoming frame - w: 720 h: 576 fmt: 0 csp: fcc range: tv pts_time: 98.175122

I don't know what else to try at this point but that would be wonderful to have a success return value from ffmpeg. Maybe something to prevent going through the format change and exit ?

Regards,

Martin
_______________________________________________
ffmpeg-user mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to