[FFmpeg-user] DV to SD Blu-ray

Terje J. Hanssen terje at nordland-teknikk.no
Mon Jan 23 04:14:24 EET 2017


Thanks to all of you who has replied and, excuse my late follow up in 
common as follows:

Den 20. jan. 2017 17:02, skrev Moritz Barsnick:
 > Especially that ffmpeg doesn't play the resulting
 > file wonders me (even tough ffmpeg does have its issues with encoding
 > MPEG-TS, so those may also exist for .m2ts.)

This was a little bit misinterpreted. FFplay and VLC did both playback 
the resulting video in .m2ts, but there was no PCM audio encoded.

 > I haven't gotten around to testing, though I do have a writer BD-RW
 > disks. What tool do you use to master the video onto the BD?

For BD-RE and DVD+RW direct burning I've used current K3b/Cdrecord and 
e.o.l NeroLinux (2010), beside 'dd' and 'growisofs', and also plan to 
use Cinelerra-GG 5.1/bdwrite for edited mastering.

Den 20. jan. 2017 18:55, skrev Carl Eugen Hoyos:
 > FFmpeg has no pcm-bluray encoder and you cannot
 > mux pcm into mpegts (the audio gets unreadable).

Yes, I have realized 'pcm_bluray' (as also 'pcm_dvd') are just ffmpeg 
decoders, and that PCM audion cannot just be copied from DV and muxed 
into .m2ts.
Yet, I'm surprised, because PCM has been a standard for raw audio so 
many years and video generation media, i.e Hi8 since 1989, DV and DVD 
since 1995/1996 and Blu-ray since 2006.

Den 20. jan. 2017 19:34, skrev Andy Furniss:
 > Working with interlaced content can be tricky, keep your masters even
 > if you think the blu-rays are OK at first sight.

Yes, I will also keep my Hi8 and HDV source tapes (the oldest is 25 
years), and have converted and imported to .dv, .m2t and also some .mov 
(prores hq) files.
In addition I wanted to make playback-able intermediate formats on 
Blu-ray discs if possible.

 >> 1) with x264 (video only)
 >> http://www.x264bluray.com/home/576i-pal
 > Which does do an interlaced encode - but tff.
 > It's possible DV is bff so you would need to check what your content is.

Yes, DV use bottom-field first interlaced, while HDV 1080i use Top-field 

 >> 2) with ffmpeg

 > Not suitable for interlaced content.

 >> I want suggestions how to possibly "merge" relevant parameters from 1)
 >> x264 into 2) ffmpeg syntax ?
 > ffmpeg can use -x264-params tp pass things to libx264 just an example
 > pasted from old notes which doesn't mean it's correct and of course it's
 > for 709HD content with abnormally low bitrate.
 > -vcodec libx264 -b:v 10000k -preset veryslow -tune film -level 4.1 

Have to study this code more what can possibly be applied in my case.


So far I have therefore given up to get pcm audio muxed into .m2ts for a 
working Blu-ray video.
Lately, I have tried a couple of other approaches, as my Samsung Ultra 
HD Blu-ray player among the specs supports .avi and .mkv

I used ffmpeg to copy and mux both the dvvideo and pcm audio, and this 
.avi played ok in VLC and ffplay. Burned the AVI to ISO and UDF discs.
The BR player told 'dvvideo' was not a compatible video format....!

DV audio to pcm.wav
Extracted (copied) pcm audio from DV and it was accepted and worked well 
in the BR player.


Just to test a .mkv container I used the corresponding code as for the 
initial .m2ts in my first post, that is re-encoded the video via x264 
and copied passthrough the pcm audio. This format was accepted by the 
BR-player and played well, both audio and video.

However, the ffmpeg code needs to optimized for the 576i SD format.
Feedback and suggestions to go further here will be welcome ;)


ffmpeg -i dv01.dv -c:v libx264 -profile:v high -level 41 -pix_fmt 
yuv420p -preset slow  -crf 20 -g 24 -vf setsar=sar=12/11 -threads 8 
-x264opts bluray-compat=1:vbv-bufsize=15000:vbv-maxrate=30000 -acodec 
copy -strict experimental -ar 48000 -ab 256k -y SD-BD2_x264.mkv

Input #0, dv, from 'dv01.dv':
     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, 25 tbc
     Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[libx264 @ 0x894c60] using SAR=12/11
[libx264 @ 0x894c60] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 
[libx264 @ 0x894c60] profile High, level 4.1
[libx264 @ 0x894c60] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 
2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 
deblock=1:0:0 analyse=0x3:0x113 me=hex subme=8 psy=1 psy_rd=1.00:0.00 
mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 
deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=8 
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=3 weightb=1 open_gop=0 weightp=1 keyint=24 keyint_min=1 
scenecut=40 intra_refresh=0 rc_lookahead=24 rc=crf mbtree=1 crf=20.0 
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=30000 vbv_bufsize=15000 
crf_max=0.0 nal_hrd=vbr filler=0 ip_ratio=1.40 aq=1:1.00

Output #0, matroska, to 'SD-BD2_x264.mkv':
     timecode        : 00:00:00:00
     encoder         : Lavf57.56.100
     Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 
720x576 [SAR 12:11 DAR 15:11], q=-1--1, 25 fps, 1k tbn, 25 tbc
       encoder         : Lavc57.64.100 libx264
     Side data:
       cpb: bitrate max/min/avg: 30000000/0/0 buffer size: 15000000 
vbv_delay: -1
     Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 
stereo, 1536 kb/s
Stream mapping:
   Stream #0:0 -> #0:0 (dvvideo (native) -> h264 (libx264))
   Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=14912 fps= 53 q=-1.0 Lsize=  683951kB time=00:09:56.44 
bitrate=9393.9kbits/s speed=2.13x
video:571829kB audio:111840kB subtitle:0kB other streams:0kB global 
headers:0kB muxing overhead: 0.04118

ffprobe SD-BD2_x264.mkv

Input #0, matroska,webm, from 'SD-BD2_x264.mkv':
     TIMECODE        : 00:00:00:00
     ENCODER         : Lavf57.56.100
   Duration: 00:09:56.48, start: 0.000000, bitrate: 9393 kb/s
     Stream #0:0: Video: h264 (High), yuv420p(bottom coded first 
(swapped)), 720x576 [SAR 12:11 DAR 15:11], SAR 157:144 DAR 785:576, 25 
fps, 25 tbr, 1k tbn, 50 tbc (default)
       ENCODER         : Lavc57.64.100 libx264
       DURATION        : 00:09:56.480000000
     Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s 
       DURATION        : 00:09:56.480000000

du -sh SD*
668M    SD-BD2_x264.mkv
738M    SD-BD_x264.m2ts


Terje H.

More information about the ffmpeg-user mailing list