Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS (Read 1567 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Hi there, I'm trying to author some amateur video recordings for distribution on optical media and having some difficulty.

I don't have cash for tools. I'm running Linux on all of my computers because I don't even have cash for an operating system. I'm on fixed income and inflation is killing me.

I'm running the 22.04 LTS of Ubuntu, and for editing video I'm using KDENLive (Version 21.12.3, probably doesn't match the numbering scheme at KDENLive web site because Ubuntu verified repository renames everything per their qualification and integration procedure).

I've just recently become familiar enough with KDENLive to add key frames for motion effects and compensate video levels for low light capture of bar bands on cellphones and fixed lens Zoom Q2N. I'm really green at this stuff and making slow progress from lack of funds and mentoring.

I have an NVIDIA graphics card and I'm using that for the final render through its CUDA. I don't have integrated graphics in my AMD CPU.

The various encode options in KDENLive include what appears to be a single pass average bit rate and it uses a deprecated NVENC-H265  procedure call in the GUI profile. I don't see the parameters in this command line GUI matching what the ffmpeg command line help seems to want, and the KDENLive log file has a warning that NVENC-H265 has been deprecated. The new procedure call is H265-NVENC.

Also, since this NVENC-H265 appears to be the only profile that explicitly supports Blu-Ray encoding in this version of KDENLive, and the command line parameters in KDENLive GUI don't seem to match what ffmpeg wants, I'm thinking that these command line parameters in the GUI are possibly translated and elaborated internally by KDENLive before they are handed off to ffmpeg, but I'm not sure because I haven't attempted to intercept the command line. I could probably figure out how to do that with an alias or a temporary tweak in the KDENLive configuration eventually, if I cared, but honestly why make this harder than it needs to be?

I've considered adding a KDENLive profile for software encoding that uses H.265 and has Blu-Ray compatibility, but I'm unsure of whether these parameters pass through from the GUI unedited to ffmpeg command line, or if it is possible to launch a two-pass encode from the GUI. If anyone has a working ffmpeg command line for Blu-Ray, that would go a long way toward helping me out. I could potentially store a lossless encode from KDENLive and submit the job manually to ffmpeg if I have no other choice. The other sites I've checked are so out of date, I'm looking at questions about authoring Blu-Ray media that were answered a decade ago with, "Here, try this." "Nope, didn't work."

In any case, I'm not confident in how to manually submit jobs to ffmpeg, especially for Blu-Ray compatibility, even if I were to export a lossless edit. I have never authored optical media before. A known good workflow would be gold.

I am using tsMuxeR to generate an ISO with chapters but no menu and have barely completed a single authoring that hasn't been burned or tested yet, using the NVENC-H264 Constant Quantization (as far as I can tell from the GUI parameters) option.

tsMuxeR is another one that is deprecated and I can't figure out how to add the 32 bit libraries for the GUI support so I'm flying blind on that one too. I don't even know if the GUI supports menus in addition to chapters because I can't see the GUI and the documentation of the command line version is sparse.

I'd prefer to do a proper two-pass average bit rate encode for best quality and compatibility using the appropriate Blu-Ray options in ffmpeg, but boy, nobody does optical media on FOSS any more do they? It's slim pickings out there finding a work flow.

The ideal solution for me would be to create a profile in KDENLive that will handle it in the job queue. If there's no way to start a two-pass encode from the GUI so I have to export a lossless encode first and write a script, that's okay, provided I have good insight into what sensible parameters to use for good quality efficient encoding with Blu-Ray compatibility.

Failing that, I'll probably just burn and distribute what appears to be the working one-pass average bit rate hardware encode of H265 at the highest bit rate that fits on a single layer DVD, currently for a 2.5 hour gig that's about 22750bps, the second highest setting on the KDENLive slider. Even though KDENLive is using a deprecated NVENC-H265 function call, at least it still generates output that might work on a Blu-Ray player and maybe the bit rate is high enough to overcome limitations of a single-pass encode.

But until I burn a disc and try it, I won't know if I'm there yet. I'm running the encode again right now because the first time I ran an encode I used the H264 to test for file size using the Constant Quantization option out of ignorance. I didn't understand what these bit rate control modes meant until I stumbled across this site by a contributor to ffmpeg:

https://slhck.info/video/2017/03/01/rate-control.html

and the only way I found HydrogenAudio as a reference for help with Blu-Ray was from Doom9.

The Videohelp web site is where I found the information about tsMuxer.

I tried using devede first but although it supports menus it doesn't support chapters and it also transcodes everything to SD for a maximum file size of dual layer DVD media. That's not going to work with Blu-Ray.

I found info about DVDStyler, but their track record of installing browser toolbar hijack seems sketchy even if Wikipedia says they don't do that anymore. I don't feel like risking system damage just to try out a tool that isn't vetted well enough for the repository and may not do what I need anyway.

Then there's something I read somewhere (can't remember where) about the data stream encoded by gstreamer, mkisofs, or something where UDP? support has fallen behind and whatever version is available won't support Blu-Ray burning with the latest tools? I can't remember what I read and like everything else it's probably out of date and poorly documented.

Please, guys, this is really tough for a noob. I've already floundered for a week and I'm just barely comprehending what I'm reading. Can anyone point me to a workflow or tools that will make this a little easier?

Or am I condemned to spend thousands on Windows/Mac OS and possibly proprietary tools to burn a probably inferior disk using their canned settings, especially if it's freeware? I don't want to go down that path. I've never needed antivirus software for Ubuntu Linux desktop and never detected an infection for the past 15 years. I don't want to go back to the promiscuous computing scene. I like it quiet.

If MKV has any solutions for me, that's okay. I'm not married to any particular format. As long as I can pop the disc in a Blu-Ray player and it looks visually transparent with no stutters or artifacts, I'm good. Chapters would be nice so I can scan through the songs. Menus would be even better so I can distribute two gigs per disc on dual layer media. But honestly, a working flow is what I most need right now because on my budget I can't afford to burn a rack of Blu-Ray coasters at $1-$3 per pop just to come up empty handed and revert to DVD anyway.

Here's a copy of the existing constant quantization H.264 hardware encode that I uploaded to YouTube so you can see what I produced so far. It's mostly done in the edits but is not the final version that I have on my PC. I'm guessing that it only plays okay over streaming because YouTube transcoded it to a rate-limited version. Mediainfo doesn't seem to understand how to display peak bit rates that exceed a 1Gbps threshold. I think the peak rate on that file was 2Gbps, not 2000Kbps.

https://www.youtube.com/watch?v=xhKh0jfMOKQ&list=PLV7pnC28-tXHicBQQ2vmcKBZNMmJnbWu1

The second file in this list is another encode that I did originally before I had knowledge and tools to attempt a disc authoring for the client. I have no idea what I did. I was using an older Ubuntu and an older KDENLive when I did that one and it was one of my very first attempts at motion animation.

I'm hoping that I might eventually gain enough expertise to sell my services as a video documentarian to supplement my income. These bar band gigs I record are my raw material for the learning experience. I'm also doing some mixing on occasion. I mixed or assisted in mixing about half of the gigs I recorded, but the percentage of mixing went down with the pandemic. Just FYI that's the context of why I'm bothering to produce media of these latest gigs, that was part of the original deal long ago that I'm just now attempting to make good on because...you know...

Thank you all.
Cheryl

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #1
Thanks for posting this.  I don't have any solutions to offer, and I've never attempted Blu-ray, but I have Blu-ray burners and you're right – support for optical (of any form) seems to be dropping off because relevance is dropping off.  Any answers forthcoming will be of interest.
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #2
Blu-ray only supports H.264, not H.265. You need UHD Blu-ray for H.265 support. I've heard that some commercial movies are encoded with x264, so it's definitely possible to do. You have to respect Blu-ray's maximum bitrate, so you'd probably want to use 2-pass mode with VBV to ensure the bitrate never exceeds the cap (which is ~40 Mbps, IIRC?). You also need the --bluray-compat switch along with some other arbitrary limitations imposed by the Blu-ray spec, such as --bframes 2 and --b-pyramid strict.

I suspect you can find a list of all the required switches on some Doom9 or VideoHelp thread.

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #3
Video Codecs:

    MPEG-2: Enhanced for HD, also used for playback of DVDs and HDTV recordings.
    MPEG-4 AVC: Part of the MPEG-4 standard also known as H.264 (High Profile and Main Profile).
    SMPTE VC-1: A standard based on Microsoft® Windows Media® Video (WMV) technology.

Audio Codecs:

    Linear PCM (LPCM): Offers up to 8 channels of uncompressed audio.
    Dolby Digital® (DD): Format used for DVDs also known as AC3, offers 5.1-channel surround sound.
    Dolby Digital® Plus (DD+): Extension of DD, offers increased bitrates and 7.1-channel surround sound.
    Dolby® TrueHD: Extension of MLP Lossless, offers lossless encoding of up to 8 channels of audio.
    DTS Digital Surround®: Format used for DVDs, offers 5.1-channel surround sound.
    DTS-HD®: Extension of DTS, offers increased bitrates and up to 8 channels of audio.

https://www.sony.com/electronics/support/articles/00029663
https://www.sony.com/electronics/support/home-video-blu-ray-disc-players-recorders/ubp-x800/articles/00029663

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #4
https://forum.videohelp.com/threads/365667-FFmpeg-best-settings-to-encode-Blu-Ray
https://forum.doom9.org/showthread.php?t=170397


2. ENCODE BLU-RAY VIDEO USING x264

2.1 MANDATORY PARAMETERS

Every encode for Blu-Ray must contain this parameters, without it will not meet Blu-Ray specification.

Quote:
--bluray-compat
Enforce x264 to create BD compliant stream, that will reduce x264 settings to BD compatible: bframe<=3, ref<=4 for 1080, ref<=6 for 720/576/480, bpyramid<=strict, weightp<=1, aud=1, nalhrd=vbr

https://forum.doom9.org/showthread.php?t=154533

Doom-9 seems to be documenting parameters for x264.exe, presumably a Windows encoder, or some other that uses these shortcuts such as --bluray-compat.

These parameters don't exist in ffmpeg. From ffmpeg man page this is the closest information I found:


       -discard (input)
           Allows discarding specific streams or frames from streams.  Any input stream can be fully discarded, using value "all" whereas selective
           discarding of frames from a stream occurs at the demuxer and is not supported by all demuxers.

           none
               Discard no frame.

           default
               Default, which discards no frames.

           noref
               Discard all non-reference frames.

           bidir
               Discard all bidirectional frames.

           nokey
               Discard all frames excepts keyframes.

           all Discard all frames.


KDENLive environment uses melt-7. I guess maybe that's why the parameters don't match ffmpeg.

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #5
--bluray-compat
Enforce x264 to create BD compliant stream, that will reduce x264 settings to BD compatible: bframe<=3, ref<=4 for 1080, ref<=6 for 720/576/480, bpyramid<=strict, weightp<=1, aud=1, nalhrd=vbr

9.15.2 Options

The following options are supported by the libx264 wrapper.
  
bluray-compat (bluray-compat)

    Configure the encoder to be compatible with the bluray standard. It is a shorthand for setting "bluray-compat=1 force-cfr=1".

https://ffmpeg.org/ffmpeg-codecs.html#libx264_002c-libx264rgb

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #6
...
Doom-9 seems to be documenting parameters for x264.exe, presumably a Windows encoder, or some other that uses these shortcuts such as --bluray-compat.
...
The x264 binary is kind of like the reference x264 encoder, like ffmpeg it's a frontend for libx264 but unlike ffmpeg that's all it does (so actually using it with audio probably requires muxing with ffmpeg separately). The x264 binary is available in the Ubuntu repo's.

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #7
Thanks, just figured that out.

The ffmpeg documentation referenced x264 and when I tried the command line help I got a message to install it. I always use Synaptic for installation on the guess it's more comprehensive than apt command line.

I'll keep trying to figure out if I can write a profile for kdenlive until I get stuck before I try running command line stand-alone. Really don't want to have to script all of this if I can avoid it. Shell scripting isn't my strong suit.

The issue I'm seeing with ffmpeg is that it relies on x264 wrapper for these encoder options and I'm not sure if the Ubuntu repository is compiled with the wrapper. If not I may have to do the encoding and muxing separately. Not up to recompiling a build of ffmpeg any maybe bricking my system.

I guess my backup plan is to use the NVENC H264 hardware-accelerated ABR single-pass KDENLive profile and maybe see if I can add those blu-ray compatible switches. Failing that, I'm also trying to edit that H264 ABR profile to use the software encoder if the hardware-accelerated profile won't take the BluRay compatibility parameters.

It all depends on what the melt-7 package is doing I guess. There's some profile directory listed in the KDENLive environment settings. I'll check that and do some reading on melt-7.

I saw some mention of people testing their files for Blu-Ray compatibility with Adobe.

I think I also saw someone listing the keyframe output, I guess that was ffshow? I'd like to test as much as possible before burning coasters.

https://stackoverflow.com/questions/15855535/setting-b-frames-in-a-video-with-ffmpeg

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #8
I created an edited version of the KDENLive hardware H264 profile, changed the encoder to software, and successfully passed bluray-compat through it but maybe did not successfully pass force-cfr:

f=mp4 vcodec=libx264 vb=%bitrate+'k' bluray-compat=1 force-cfr=1 acodec=aac ab=%audiobitrate+'k'

The file looks to be CFR anyway. The bitrate looks okay and it's accepting the parameter so I can adjust the size of the file to fit the disc and I've already confirmed that the file fits on a single layer with this setting:

media1@media1-AX370-Gaming-5:/raw/media/music/amateur/Hummers, The/2019-11-08 at The Pioneer Saloon/kdenlive$ mediainfo -full The\ Hummers\ at\ The\ Pioneer\ Saloon\ 2019-11-08\ v2\ test.mp4 |grep rate
Overall bit rate                         : 22782398
Overall bit rate                         : 22.8 Mb/s
Frame rate                               : 29.970
Frame rate                               : 29.970 FPS
Bit rate                                 : 22750000
Bit rate                                 : 22.8 Mb/s
Frame rate mode                          : CFR
Frame rate mode                          : Constant
Frame rate                               : 29.970
Frame rate                               : 29.970 (30000/1001) FPS
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=1 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=250 / keyint_min=1 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=22750 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00

The quality is acceptable as-is given the limitations of the source media. I may have a possibly working flow.

I'm looking into the audio codec now. As long as I can configure a compatible codec and pass parameters to it, I'm maybe good to go.

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #9
Videohelp gives a hint on finding out which codecs are installed:

FWIW, ffmpeg -codecs returns the following:

https://forum.videohelp.com/threads/366899-can-I-tell-to-ffmpeg-use-LPCM-as-audio-codec

media1@media1-AX370-Gaming-5:/raw/media/music/amateur/Hummers, The/2019-11-08 at The Pioneer Saloon/kdenlive$ ffmpeg -codecs | grep bluray
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  WARNING: library configuration mismatch
  avcodec     configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libaribb24 --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc --enable-libsmbclient
  avformat    configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libaribb24 --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc --enable-libsmbclient
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
 D.AI.S pcm_bluray           PCM signed 16|20|24-bit big-endian for Blu-ray media

So it looks like there's one available. I'll try it in KDENLive GUI parameter list and see what happens.

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #10
Do you really need Blu-ray or DVD disc?
Optical media is pretty much dead.
Every professional photographer here in Croatia will simply give you USB flash drive with MP4 video file and JPG images.
gold plated toslink fan

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #11
Do you really need Blu-ray or DVD disc?
Optical media is pretty much dead.
Every professional photographer here in Croatia will simply give you USB flash drive with MP4 video file and JPG images.

That can be a bit expensive for some people to just give out flash drives.  Especially considering the cost per disc vs cost per flash drive.

https://www.amazon.com/blank-blu-ray-discs-Electronics/s?k=blank+blu-ray+discs&rh=n%3A172282
https://www.amazon.com/USB-Flash-Drives-Storage-Add-Ons/b?node=3151491

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #12
It's also worth noting that most Blu-ray players will play MKV/MP4 with H.264 that does not conform to the BDMV spec, so it's probably preferable to just do a normal CRF encode and burn that to the disc. If you really need BDMV, you're better off using x264 directly, so you don't have to deal with ffmpeg's quirks.

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #13
Well, that didn't work because ffmpeg pcm is only a decoder. However, there is a blu-ray supported encoder: dts.

media1@media1-AX370-Gaming-5:/raw/media/music/amateur/Hummers, The/2019-11-08 at The Pioneer Saloon/kdenlive$ ffmpeg -codecs |grep dts

 DEAILS dts                  DCA (DTS Coherent Acoustics) (decoders: dca ) (encoders: dca )

There's also ac3, ac3_fixed, and eac3:

media1@media1-AX370-Gaming-5:/raw/media/music/amateur/Hummers, The/2019-11-08 at The Pioneer Saloon/kdenlive$ ffmpeg -codecs |grep ac3
 DEAIL. ac3                  ATSC A/52A (AC-3) (decoders: ac3 ac3_fixed ) (encoders: ac3 ac3_fixed )
 DEAIL. eac3                 ATSC A/52B (AC-3, E-AC-3)

I guess I'll try all four options and see if any of them work.

Here's the KDENLive profile, created off the H264 hardware ABR profile and edited for blu-ray (eac3 shown) and I'm guessing for a stereo bitstream only bitrate is required paramater since it seems to be rendering okay:

f=mp4 vcodec=libx264 vb=%bitrate+'k' bluray-compat=1 force-cfr=1 acodec=eac3 ab=%audiobitrate+'k'

The encoded file plays back with sound. Since my LG OLED doesn't support DTS, I'm thinking I should stick with eac3 audio for best compatibility with modern equipment.

I guess I'm ready to try a full encode and burn it now.

Here's the mediainfo output:

media1@media1-AX370-Gaming-5:/raw/media/music/amateur/Hummers, The/2019-11-08 at The Pioneer Saloon/kdenlive$ cat mediaout
General
Count                                    : 331
Count of stream of this kind             : 1
Kind of stream                           : General
Kind of stream                           : General
Stream identifier                        : 0
Count of video streams                   : 1
Count of audio streams                   : 1
Video_Format_List                        : AVC
Video_Format_WithHint_List               : AVC
Codecs Video                             : AVC
Audio_Format_List                        : E-AC-3
Audio_Format_WithHint_List               : E-AC-3
Audio codecs                             : E-AC-3
Complete name                            : The Hummers at The Pioneer Saloon 2019-11-08 v2 test4.mp4
File name extension                      : The Hummers at The Pioneer Saloon 2019-11-08 v2 test4.mp4
File name                                : The Hummers at The Pioneer Saloon 2019-11-08 v2 test4
File extension                           : mp4
Format                                   : MPEG-4
Format                                   : MPEG-4
Format/Extensions usually used           : braw mov mp4 m4v m4a m4b m4p m4r 3ga 3gpa 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma ismt f4a f4b f4v
Commercial name                          : MPEG-4
Format profile                           : Base Media
Internet media type                      : video/mp4
Codec ID                                 : isom
Codec ID                                 : isom (isom/iso2/avc1/mp41)
Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
CodecID_Compatible                       : isom/iso2/avc1/mp41
File size                                : 240117367
File size                                : 229 MiB
File size                                : 229 MiB
File size                                : 229 MiB
File size                                : 229 MiB
File size                                : 229.0 MiB
Duration                                 : 84091
Duration                                 : 1 min 24 s
Duration                                 : 1 min 24 s 91 ms
Duration                                 : 1 min 24 s
Duration                                 : 00:01:24.091
Duration                                 : 00:01:24;02
Duration                                 : 00:01:24.091 (00:01:24;02)
Overall bit rate                         : 22843573
Overall bit rate                         : 22.8 Mb/s
Frame rate                               : 29.970
Frame rate                               : 29.970 FPS
Frame count                              : 2520
Stream size                              : 53880
Stream size                              : 52.6 KiB (0%)
Stream size                              : 53 KiB
Stream size                              : 53 KiB
Stream size                              : 52.6 KiB
Stream size                              : 52.62 KiB
Stream size                              : 52.6 KiB (0%)
Proportion of this stream                : 0.00022
HeaderSize                               : 40
DataSize                                 : 240063495
FooterSize                               : 53832
IsStreamable                             : No
File last modification date              : UTC 2023-02-05 20:35:02
File last modification date (local)      : 2023-02-05 12:35:02
Writing application                      : Lavf58.76.100
Writing application                      : Lavf58.76.100

Video
Count                                    : 380
Count of stream of this kind             : 1
Kind of stream                           : Video
Kind of stream                           : Video
Stream identifier                        : 0
StreamOrder                              : 0
ID                                       : 1
ID                                       : 1
Format                                   : AVC
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format/Url                               : http://developers.videolan.org/x264.html
Commercial name                          : AVC
Format profile                           : High@L4.1
Format settings                          : CABAC / 3 Ref Frames
Format settings, CABAC                   : Yes
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 3
Format settings, Reference frames        : 3 frames
Internet media type                      : video/H264
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 84084
Duration                                 : 1 min 24 s
Duration                                 : 1 min 24 s 84 ms
Duration                                 : 1 min 24 s
Duration                                 : 00:01:24.084
Duration                                 : 00:01:24;02
Duration                                 : 00:01:24.084 (00:01:24;02)
Bit rate                                 : 22750000
Bit rate                                 : 22.8 Mb/s
Width                                    : 1920
Width                                    : 1 920 pixels
Height                                   : 1080
Height                                   : 1 080 pixels
Stored_Height                            : 1088
Sampled_Width                            : 1920
Sampled_Height                           : 1080
Pixel aspect ratio                       : 1.000
Display aspect ratio                     : 1.778
Display aspect ratio                     : 16:9
Rotation                                 : 0.000
Frame rate mode                          : CFR
Frame rate mode                          : Constant
Frame rate                               : 29.970
Frame rate                               : 29.970 (30000/1001) FPS
FrameRate_Num                            : 30000
FrameRate_Den                            : 1001
Frame count                              : 2520
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Chroma subsampling                       : 4:2:0
Bit depth                                : 8
Bit depth                                : 8 bits
Scan type                                : Progressive
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.366
Stream size                              : 237372415
Stream size                              : 226 MiB (99%)
Stream size                              : 226 MiB
Stream size                              : 226 MiB
Stream size                              : 226 MiB
Stream size                              : 226.4 MiB
Stream size                              : 226 MiB (99%)
Proportion of this stream                : 0.98857
Writing library                          : x264 - core 163 r3060 5db6aa6
Writing library                          : x264 core 163 r3060 5db6aa6
Encoded_Library_Name                     : x264
Encoded_Library_Version                  : core 163 r3060 5db6aa6
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=1 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=250 / keyint_min=1 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=22750 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
colour_description_present               : Yes
colour_description_present_Source        : Container / Stream
Color range                              : Limited
colour_range_Source                      : Container / Stream
Color primaries                          : BT.709
colour_primaries_Source                  : Container / Stream
Transfer characteristics                 : BT.709
transfer_characteristics_Source          : Container / Stream
Matrix coefficients                      : BT.709
matrix_coefficients_Source               : Container / Stream
Codec configuration box                  : avcC

Audio
Count                                    : 294
Count of stream of this kind             : 1
Kind of stream                           : Audio
Kind of stream                           : Audio
Stream identifier                        : 0
StreamOrder                              : 1
ID                                       : 2
ID                                       : 2
Format                                   : E-AC-3
Format                                   : E-AC-3
Format/Info                              : Enhanced AC-3
Format/Url                               : https://en.wikipedia.org/wiki/Dolby_Digital_Plus
Commercial name                          : Dolby Digital Plus
Commercial name                          : Dolby Digital Plus
Format settings, Endianness              : Big
Internet media type                      : audio/eac3
Codec ID                                 : ec-3
Duration                                 : 84091
Duration                                 : 1 min 24 s
Duration                                 : 1 min 24 s 91 ms
Duration                                 : 1 min 24 s
Duration                                 : 00:01:24.091
Duration                                 : 00:01:24:24
Duration                                 : 00:01:24.091 (00:01:24:24)
Source duration                          : 84096
Source duration                          : 1 min 24 s
Source duration                          : 1 min 24 s 96 ms
Source duration                          : 1 min 24 s
Source duration                          : 00:01:24.096
Bit rate mode                            : CBR
Bit rate mode                            : Constant
Bit rate                                 : 256000
Bit rate                                 : 256 kb/s
Channel(s)                               : 2
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Channel positions                        : 2/0/0
Channel layout                           : L R
Samples per frame                        : 1536
Sampling rate                            : 48000
Sampling rate                            : 48.0 kHz
Samples count                            : 4036368
Frame rate                               : 31.250
Frame rate                               : 31.250 FPS (1536 SPF)
Frame count                              : 2628
Source frame count                       : 2628
Compression mode                         : Lossy
Compression mode                         : Lossy
Stream size                              : 2691072
Stream size                              : 2.57 MiB (1%)
Stream size                              : 3 MiB
Stream size                              : 2.6 MiB
Stream size                              : 2.57 MiB
Stream size                              : 2.566 MiB
Stream size                              : 2.57 MiB (1%)
Proportion of this stream                : 0.01121
Source stream size                       : 2691072
Source stream size                       : 2.57 MiB (1%)
Source stream size                       : 3 MiB
Source stream size                       : 2.6 MiB
Source stream size                       : 2.57 MiB
Source stream size                       : 2.566 MiB
Source stream size                       : 2.57 MiB (1%)
Source_StreamSize_Proportion             : 0.01121
Service kind                             : CM
Service kind                             : Complete Main
Default                                  : Yes
Default                                  : Yes
Alternate group                          : 1
Alternate group                          : 1
mdhd_Duration                            : 84091
bsid                                     : 16
Dialog Normalization                     : -31
Dialog Normalization                     : -31 dB
dsurmod                                  : 0
acmod                                    : 2
lfeon                                    : 0
dialnorm_Average                         : -31
dialnorm_Average                         : -31 dB
dialnorm_Minimum                         : -31
dialnorm_Minimum                         : -31 dB
dialnorm_Maximum                         : -31
dialnorm_Maximum                         : -31 dB
dialnorm_Count                           : 32

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #14
Setting up that work flow was considerably less painful than I thought it would be. I guess I'll know tomorrow if this flow works. The only FOSS muxer I could find is tsMuxeR and the GUI is deprecated because of GTK 32 bit not supported. It supports chapters so I can scan through the setlist but there's no menus AFAIK. Menu won't matter if I'm doing one pass render and filling the whole disk with high bit rate noisy video anyway, but a better muxer with some nice menus etc would go a long way toward reassuring customers.

For quality media I'll probably have to export lossless and use two pass encoding, but for this particular gear (Zoom Q2N and iPhone) I don't think the native quality of the video justifies the hassle. It's definitely superior to DVD resolution and my iPhone will do 4K if I am feeling masochistic.

Okay now I'll try rendering, muxing, and burning a full HD disc and let you know if I've got a coaster or a video.

So to summarize, one-pass ABR render, EAC3 audio seems to be the trick. Hopefully it plays okay.

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #15
That can be a bit expensive for some people to just give out flash drives.  Especially considering the cost per disc vs cost per flash drive.

Yes, the disc itself is cheaper, but you can't just give away the disc, it needs to be inside the case.
If you include cheap jewel case in the price the cost is around the same.

Also, you can only burn one disc at a time. With USB flash drive, you can use USB hub to transfer to multiple drives at the same time.
Set and forget, no interactions necessary.
gold plated toslink fan

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #16
ac3, ac3_fixed, and eac3 all played back.

dts didn't add a bitstream.

ffmpeg documentation doesn't mention eac3.

Which ac3 should I use for blu-ray? Are any of them compatible? I'm trying to make sure this disc works on any blu-ray if possible. Compatibility is more important than quality for a first cut.

Thanks.

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #17
That can be a bit expensive for some people to just give out flash drives.  Especially considering the cost per disc vs cost per flash drive.

Yes, the disc itself is cheaper, but you can't just give away the disc, it needs to be inside the case.
If you include cheap jewel case in the price the cost is around the same.

Also, you can only burn one disc at a time. With USB flash drive, you can use USB hub to transfer to multiple drives at the same time.
Set and forget, no interactions necessary.

Nowhere near automation at this point. I'm just learning to walk. Thanks for the pointers.

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #18
If you include cheap jewel case in the price the cost is around the same.
https://www.amazon.com/Maxtek-Standard-Single-Clear-Assembled/dp/B00TL1CXCM/ref=sr_1_5?keywords=cd+cases&sr=8-5
https://www.amazon.com/Maxtek-Ultra-5-2mm-Clear-Jewel/dp/B01G4A8OYI/ref=sr_1_9?keywords=cd+cases&sr=8-9

Also, you can only burn one disc at a time. With USB flash drive, you can use USB hub to transfer to multiple drives at the same time.
How many discs do you need to give a single client?  If one has multiple burners and a decent computer it's possible to do more than one disc at a time.

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #19
AC3 is a mandatory codec, whereas EAC3 is optional, so it's possible some old players won't support EAC3.

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #20
AC3 is a mandatory codec, whereas EAC3 is optional, so it's possible some old players won't support EAC3.

Thanks for that tip. I guess I'll let the second render complete before I try burning. At this speed it's going to be a full day.

I just noticed that the DTS profile I created was wrong. The encoder is dca, not dts. I'm trying it again on a small render to see if it works.

What is the difference between ac3 and ac3_fixed? Should I prefer one or the other for blu-ray?

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #21
Blu-ray has some really weird restrictions on the encoded bitstream; just putting the video into an MP4 file can cause incompatibility even if you do everything else correctly. If you want to be sure your disc will play correctly on the greatest number of Blu-ray players, you have to use x264 by itself to produce a raw H.264 bitstream separately from the audio and then combine them with your muxer.

There used to be a website that included complete x264 command lines for Blu-ray encoding; you can still read an archived copy.

FFmpeg can output PCM, you just need to select the bit layout when you specify the codec. For example, "pcm_s16le" will give you 16-bit PCM suitable for WAV files (which you can then feed to your muxer). When working with PCM, you'll probably want to use WAV files instead of raw PCM.

The difference between "ac3" and "ac3_fixed" is that "ac3" uses your CPU's floating-point math capabilities and "ac3_fixed" does not. Either one will work equally well for you (though I'm not sure how good FFmpeg's AC3 encoder is).

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #22
It's OK if you use 320 kbps for stereo. If you use 192 kbps like you would find on a DVD, it's not great IIRC, and LAME MP3 outperforms it. It's still better than ffmpeg's AAC encoders, which are hot garbage (unless you compile ffmpeg yourself with FDK AAC).

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #23
The 'bluray compatible' iso I generated yesterday is 300M too large and it won't play on mplayer. VLC plays it but doesn't find an audio stream. Mediainfo doesn't find an audio stream either.

I downloaded a newer version of tsMuxeR. It won't generate an ISO. The newer version of tsMuxer generated an ISO and it plays on VLC but not mplayer and ffprobe says the ISO is broken:

media1@media1-AX370-Gaming-5:/raw/media/music/amateur/Hummers, The/2019-11-08 at The Pioneer Saloon/tsmuxer$ ffprobe The\ Hummers\ at\ The\ Pioneer\ Saloon\ 2019-11-08\ v2\ ac3.iso
ffprobe version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2007-2021 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
...
[mpeg @ 0x56038486cd40] Format mpeg detected only with low score of 25, misdetection possible!
[NULL @ 0x56038486ea40] SEI type 112 size 920 truncated at 256
[h264 @ 0x56038486ea40] SEI type 112 size 920 truncated at 240
[h264 @ 0x56038486ea40] error while decoding MB 44 6, bytestream -40
[h264 @ 0x56038486ea40] concealing 7445 DC, 7445 AC, 7445 MV errors in I frame
[mpeg @ 0x56038486cd40] pes_ext D6 is invalid
[mp2 @ 0x560384994980] Header missing
    Last message repeated 13 times
[mpeg @ 0x56038486cd40] pes_ext DB is invalid
[mp2 @ 0x560384b34740] Header missing
    Last message repeated 2 times
[mpeg @ 0x56038486cd40] pes_ext DB is invalid
[mp2 @ 0x560384b34740] Header missing
    Last message repeated 2 times
[mpeg @ 0x56038486cd40] decoding for stream 1 failed
[mpeg @ 0x56038486cd40] decoding for stream 2 failed
[mpeg @ 0x56038486cd40] start time for stream 1 is not set in estimate_timings_from_pts
[mpeg @ 0x56038486cd40] start time for stream 2 is not set in estimate_timings_from_pts
[mpeg @ 0x56038486cd40] stream 1 : no TS found at start of file, duration not set
[mpeg @ 0x56038486cd40] stream 2 : no TS found at start of file, duration not set
[mpeg @ 0x56038486cd40] Could not find codec parameters for stream 1 (Audio: mp2, 0 channels, s16p): unspecified frame size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[mpeg @ 0x56038486cd40] Could not find codec parameters for stream 2 (Audio: mp2, 0 channels, s16p): unspecified frame size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mpeg, from 'The Hummers at The Pioneer Saloon 2019-11-08 v2 ac3.iso':
  Duration: 02:18:53.22, start: 600.000000, bitrate: 24304 kb/s
  Stream #0:0[0x1e0]: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
  Stream #0:1[0x1da]: Audio: mp2, 0 channels, s16p
  Stream #0:2[0x1df]: Audio: mp2, 0 channels, s16p

This flow isn't working.

Re: Blu-Ray and DVD Authoring on Ubuntu Linux using only FOSS

Reply #24
You can't play an ISO, you have to mount it (as you would if you put a physical disc in a drive) and then play its contents.