#
Creating Blu-ray Without Re-encoding

If you have video that is already in Blu-ray format AND you do not want to use CINELERRA-GG to do any editing, you can create blu-ray video media using Cinelerra's bdwrite program. This could be the case if you are working with media from a modern Digital Camcorder. Camcorders usually record in a legacy tape-based format or the current file-based format. The most common digital camcorder formats and whether or not they need to be re-encoded are:

- DV (1995) to SD-blu-ray video - process in CINELERRA-GG using the File pulldown of BD Render as previously described or use programs documented in their manuals to re-encode video to mpeg2 and then re-encode DV LPCM audio to Blu-ray LPCM.
- HDV (2004) to blu-ray video - process in CINELERRA-GG using the File pulldown of BD Render as previously described or use programs documented in their manuals to copy mpeg2 video and then re-encode MP2 audio to Blu-ray LPCM or AC3.
- AVCHD (2006-current) to blu-ray video; these are the types of videos that do not have to be re-encoded if you do not want to edit anything.

For an explanation of the differences between HDV vs AVCHD see: `http://www.differencebetween.net/technology/difference-between-hdv-and-avchd`

Besides digital camcorder file-based format of AVCHD, there are video files in MTS format that are also candidates for burning to blu-ray video media without re-encoding. An MTS file is a video file saved in the high-definition (HD) MPEG Transport Stream video format/H264, commonly called AVCHD. It contains HD video compatible with Blu-ray video disc format and is based on the MPEG-2 transport stream. MTS files are often used by Sony, Panasonic, Canon and other HD camcorders. Legal input for Video – MPEG1VIDEO, MPEG2VIDEO, H264; Audio – MP1, MP2, AC3, AC3PLUS, DTS, TRUHD.

For creating a blu-ray video disc, if you have these HD MPEG-2 media types that are in blu-ray video format, you can save the original quality of your work, rather than rendering it to another format. Note that for older media or media which used MP1 or MP2 audio codecs which will not work on blu-ray video discs, it may be necessary to first transcode the audio while leaving video intact. An example of the transcode line to use if using ffmpeg version 5.1 or higher is shown next. If using a lower ffmpeg version substitute ac3 for pcm_bluray:

    ffmpeg -i hdv -c:v copy -c:a pcm_bluray -mpegts_m2ts_mode 1 new_hdv.mts

Follow the next 2 sets of steps to create the blu-ray video disc.

    du -sb /yourHDVfile.MTS         # Determine the size of your file in bytes.
    blocks=((size-in-bytes/2048 + 4096))    # Convert bytes into blocks + a little more.
    mkudffs -b 2048 /tmp/newfilename.udfs blocks    # Create a file with that \# of blocks + some extra.
    mount -o loop /tmp/newfilename.udfs /mntX          # Use a mount point like mntX that is not in use.

In order to create the udfs file, you will need access to Cinelerra's bdwrite program. If you do not do your own build and compile, but use the AppImage instead, you will have to first extract bdwrite from the AppImage as described in the NOTE at B.10.1.

    /<cinelerra_installed_path>/bin/bdwrite /mntX /tmp/yourHDVfile.MTS   # Substitute \CGG{} path.
    umount /mntX                            # You must unmount the udfs filesystem
    growisofs -Z /dev/bd=/tmp/newfilename.udfs   # Replace /dev/bd with your bluray hardware device.
    OR  dd if=/tmp/newfilename.udfs of=/dev/bd bs=2048000   # if using rewritable blu-ray; replace bd.