[Cin] lpcm for bluray hacks!

Andrew Randrianasulu randrianasulu at gmail.com
Wed Dec 8 20:28:52 CET 2021

On Wednesday, December 8, 2021, Terje J. Hanssen via Cin <
cin at lists.cinelerra-gg.org> wrote:

> Andrew,
> While I struggle to get my usual Thunderbird imap client going due to a
> Google login issue, I have to use web mail instead.....
> .
> I want to help and tried to understand you ffmpeg command, but I am yet
> quite unfamiliar and incapable with what to do here, regarding possibly
> patching Cin-GG/ffmpeg, compiling and testing. So I need all detailed
> command procedure steps, at least this first time ;)

in theory build instructions should be workable... but of course
documentation bugs exist!


try instructions from this page. You can try to build without context help
first, or download and unpack it as showed in earlier, upper-level page



You need at least 6 GB of disk storage to operate a build + you need to
have “git” installed.

Recommend you build and run as root, just to avoid permission issues

The git step has to download many files (approx 130 MB) so allow time.
Run the following commands (this takes awhile):

# This is where you need the 6GB of disk space
cd /<build_path>/
git clone --depth 1 "git://git.cinelerra-gg.org/goodguy/cinelerra.git"

if you can wait a bit longer  and have  enough space you can omit '-depth
1' parameter and download whole history of git changes.

# Toplevel directory:
cd cinelerra5/cinelerra-5.1

NOTE: if your system has never had CINELERRA-GG Infinity installed, you
will have to make sure all the compilers and libraries necessary are
installed. So on the very first build you should run as root:

./blds/bld_prepare.sh <os>
./configure --with-single-user
make 2>&1 | tee log
make install

Where <os> represents the Operating System supported by CINELERRA-GG, such
as centos, fedora, suse, ubuntu, mint, debian. The “with-single-user”
parameter makes it so. Check for errors before proceeding.


> Also because I have just Cin-GG Appimage installation, my understanding
> from a previous post I read is that custom ffmpeg is not included in
> Appimage as it was in previous in the rpm package. If you have compiled a
> new ffmpeg with i.e pcm_bluray, I need to know from where to download it
> and suggestion how and where to install it and test it on my Leap system.

well, I used online documentation for rpbmuild on Rosa Linux, but I never
tried to add patches to it personally.

I suggest to download three patches from previous mail (hoppefully they
will have correct type  from downloading via web interface!) to somefolder,
and then from cinelerra5 directory (where hidden .git  directory located)
just run

git am <path/to/patches/*.patch> or call this command few times over
individual numbered patches starting usually from smaller number:

git am 0001-something.patch
git am 0002-more-stuff.patch
git am 0003-fix-up.patch

git am stand for git apply mailbox - apply patches created with git
format-patch (like I lately do)

sometimes I just provide patches you should apply with old patch tool,
usualy from root of cinelerra5 source tree or thirdparty/ directory inside
it. But for now hopefully simpler git am should do trick.

After you build at least up to thirdparty/ffmpeg-4.4 (there should be few
0-sized files in thirdparty/build directory, indicating phases of build for
individual pieces of software, so for ffmpeg look for
thirdparty/build/ffmpeg*) you can cd there:

cd thirdparty/ffmpeg-4.4
and run resulted ffmpeg

./ffmpeg -encoders | grep blu

so you can test all sort of things with this ffmpeg copy.

for me after build steps look like this:

$ cd cingg/cinelerra/cinelerra-5.1/
$ cd thirdparty/ffmpeg-4.4/
$ ./ffmpeg -encoders | grep blu
 A..... pcm_bluray PCM signed 16|24-bit big-endian for bluray media

next command takes input file just after '-i' switch, copies video from
original and tries to encode audio in pcm_bluray, mpegts_m2ts_mode 1 tells
ffmpeg we need bluray-compatible mode from ts (mpeg transport stream)
muxer, last argument is output filename.

$ ./ffmpeg -i ~/vid_20210828.mp4 -c:v copy -c:a pcm_bluray
-mpegts_m2ts_mode 1 1.m2ts
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
    major_brand : isom
    minor_version : 512
    compatible_brands: isomiso2avc1mp41
    encoder : Lavf58.76.100
  Duration: 00:00:16.75, start: 0.000000, bitrate: 685 kb/s
  Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
unknown/bt470bg/unknown), 640x480 [SAR 27:64 DAR 9:16], 547 kb/s, 29.61
fps, 29.61 tbr, 18k tbn, 59.21 tbc (default)
      handler_name : VideoHandle
      vendor_id : [0][0][0][0]
  Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo,
fltp, 129 kb/s (default)
      handler_name : SoundHandle
      vendor_id : [0][0][0][0]
File '1.m2ts' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (aac (native) -> pcm_bluray (native))
Press [q] to stop, [?] for help
Output #0, mpegts, to '1.m2ts':
    major_brand : isom
    minor_version : 512
    compatible_brands: isomiso2avc1mp41
    encoder : Lavf58.76.100
  Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
unknown/bt470bg/unknown), 640x480 [SAR 27:64 DAR 9:16], q=2-31, 547 kb/s,
29.61 fps, 29.61 tbr, 90k tbn, 18k tbc (default)
      handler_name : VideoHandle
      vendor_id : [0][0][0][0]
  Stream #0:1(eng): Audio: pcm_bluray, 48000 Hz, stereo, s32, 2304 kb/s
      handler_name : SoundHandle
      vendor_id : [0][0][0][0]
      encoder : Lavc58.134.100 pcm_bluray
frame= 3 fps=0.0 q=-1.0 size= 21kB time=00:00:00.01 bitrate=124frame= 496
fps=0.0 q=-1.0 Lsize= 6192kB time=00:00:16.72 bitrate=3033.6kbits/s
video:1120kB audio:4713kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 6.154016%

$ mpv 1.m2ts
     Video --vid=1 (h264 640x480 29.583fps)
 (+) Audio --aid=1 --alang=eng (pcm_bluray 2ch 48000Hz)
[ao/opensles] Device latency is 0.170000
AO: [opensles] 48000Hz stereo 2ch s32
A: 00:00:16 / 00:00:16 (96%)

Exiting... (End of file)

but hopefully Cinelerra-gg herself will be built ok too, so you should be
able to load media and try render (probably not via Create bd at first,
just usual render into m2ts file)

Let us know about your progress or problems.

> What I have installed and have used myself the later time, is the
> multimedia enabled ffmpeg-4x for Leap 15.3 and for Tumbleweed (TW) from
> Packman, where especially the latter TW version includes several new PCM
> features, which I have not tested so far: http://packman.links2linux.
> org/package/ffmpeg-4/1002522
> Terje J. H
> ons. 8. des. 2021 kl. 15:06 skrev Andrew Randrianasulu via Cin <
> cin at lists.cinelerra-gg.org>:
>> So, this time I tried to integrate encoder I was talking about earlier
>> into Cingg.
>> files for git am
>> it... initiializes, and then famous for me android/termux audio crash
>> comes...
>> Terje, Andrea - you can try it even with stereo (but high bit depth/high
>> freq) audio tracks...
>> after hopefully successfull rebuild (encoder added to our ffmpeg copy, so
>> rebuild)
>> select ffmpeg > m2ts, and for audio m2ts_pcm.m2ts
>> try render, and listen to resulting m2ts file with mpv or vlc. or even
>> try to burn it into real bd disk..
>> --
>> 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/20211208/65a33313/attachment.htm>

More information about the Cin mailing list