I think finally I have an acceptable solution, which works with kdenlive and openshot. I tested the preview of a very short clip only and I could see an image and hear the sound.
The advantage of using Hanbrake before the video editor is to use --decomb to deinterlace the video, if necessary, without checking if it is interlaced or not and to get square pixels, so there is no need to think about if anything in the queue, normally the TV or media player is distorting the picture, because of a wrong interpretation of PAR.
Code: Select all
HandBrakeCLI -i dvtest_001_20100216214015.000-720x576i-169-25fps-dv1-32khz-4s40ms.avi -e x264 -w 1024 -l 576 -q 12 -a 1 -E ffflac -C 8 -R 44.1 -D 0.0,0.0 -f mkv --decomb -m -x threads=1:b-adapt=2:rc-lookahead=50 -o movie.mkv
Original file size of the camcorder file: 14M
Handbrake-File:5.5M
Interesting is, the filesize is the same without -C 8, that is -C 5, the default compression, maybe because the clip is very short.
Depending on the importance of the sound, lame could be used. With -B 320 the file gets 5.3M, so I think for important personal movies the difference between best lame options and flac doesn't count, on the other hand camcorder sound from the built-in microphone is normally very bad.
Code: Select all
HandBrakeCLI -i dvtest_001_20100216214015.000-720x576i-169-25fps-dv1-32khz-4s40ms.avi -e x264 -w 1024 -l 576 -q 12 -a 1 -E ffflac -C 8 -R 44.1 -D 0.0,0.0 -f mkv --decomb -m -x threads=1:b-adapt=2:rc-lookahead=50 -o movie.mkv
[16:47:45] hb_init: starting libhb thread
HandBrake svn4394 (2011123101) - Linux x86_64 - http://handbrake.fr
2 CPUs detected
Opening dvtest_001_20100216214015.000-720x576i-169-25fps-dv1-32khz-4s40ms.avi...
[16:47:45] hb_scan: path=dvtest_001_20100216214015.000-720x576i-169-25fps-dv1-32khz-4s40ms.avi, title_index=1
libbluray/bdnav/index_parse.c:157: indx_parse(): error opening dvtest_001_20100216214015.000-720x576i-169-25fps-dv1-32khz-4s40ms.avi/BDMV/index.bdmv
libbluray/bluray.c:1471: nav_get_title_list(dvtest_001_20100216214015.000-720x576i-169-25fps-dv1-32khz-4s40ms.avi) failed (0x2d01b30)
[16:47:45] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Using libdvdcss version 1.2.10 for DVD access
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[16:47:45] dvd: not a dvd - trying as a stream/file instead
Input #0, avi, from 'dvtest_001_20100216214015.000-720x576i-169-25fps-dv1-32khz-4s40ms.avi':
Duration: 00:00:04.04, start: 0.000000, bitrate: 30848 kb/s
Stream #0.0: Video: dvvideo, yuv420p, 720x576, 28800 kb/s, PAR 64:45 DAR 16:9, 25 tbr, 25 tbn, 25 tbc
Stream #0.1: Audio: pcm_s16le, 32000 Hz, 2 channels, s16, 1024 kb/s
Stream #0.2: Audio: pcm_s16le, 32000 Hz, 2 channels, s16, 1024 kb/s
[16:47:45] No channel layout reported by Libav; guessing one from channel count.
[16:47:45] No channel layout reported by Libav; guessing one from channel count.
[16:47:45] scan: decoding previews for title 1
[16:47:45] scan: 10 previews, 720x576, 25.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 64:45
[16:47:45] scan: title (0) job->width:720, job->height:400
[16:47:45] libhb: scan thread found 1 valid title(s)
+ title 1:
+ stream: dvtest_001_20100216214015.000-720x576i-169-25fps-dv1-32khz-4s40ms.avi
+ duration: 00:00:04
+ size: 720x576, pixel aspect: 64/45, display aspect: 1.78, 25.000 fps
+ autocrop: 0/0/0/0
+ chapters:
+ 1: cells 0->0, 0 blocks, duration 00:00:04
+ audio tracks:
+ 1, Unknown (pcm_s16le) (2.0 ch) (iso639-2: und)
+ 2, Unknown (pcm_s16le) (2.0 ch) (iso639-2: und)
+ subtitle tracks:
[16:47:45] 1 job(s) to process
[16:47:45] starting job
[16:47:45] work: mixdown not specified, track 1 setting mixdown Stereo
[16:47:45] sync: expecting 126 video frames
[16:47:45] work: only 1 chapter, disabling chapter markers
[16:47:45] job configuration:
[16:47:45] * source
[16:47:45] + dvtest_001_20100216214015.000-720x576i-169-25fps-dv1-32khz-4s40ms.avi
[16:47:45] + title 1, chapter(s) 1 to 1
[16:47:45] + container: avi
[16:47:45] + data rate: 30848 kbps
[16:47:45] * destination
[16:47:45] + movie.mkv
[16:47:45] + container: Matroska (.mkv)
[16:47:45] * video track
[16:47:45] + decoder: dvvideo
[16:47:45] + bitrate 28800 kbps
[16:47:45] + frame rate: same as source (around 25.000 fps)
[16:47:45] + dimensions: 720 * 576 -> 1024 * 576, crop 0/0/0/0, mod 0
[16:47:45] + filter
[16:47:45] + Decomb (default settings)
[16:47:45] + encoder: H.264 (x264)
[16:47:45] + options: threads=1:b-adapt=2:rc-lookahead=50
[16:47:45] + quality: 12.00 (RF)
[16:47:45] * audio track 1
[16:47:45] + decoder: Unknown (pcm_s16le) (2.0 ch) (track 1, id 0x1)
[16:47:45] + mixdown: Stereo
[16:47:45] + encoder: FLAC (ffmpeg)
[16:47:45] + samplerate: 44100 Hz
[16:47:45] + compression level: 8.00
[16:47:45] reader: first SCR 0 id 0x0 DTS 0
[16:47:45] decomb thread started for segment 1
[16:47:45] encx264: Encoding at constant RF 12.000000
x264 [warning]: --psnr used with psy on: results will be invalid!
x264 [warning]: --tune psnr should be used if attempting to benchmark psnr!
x264 [info]: using cpu capabilities: MMX2 SSE2Fast FastShuffle SSEMisalign LZCNT
[16:47:45] decomb thread started for segment 0
[16:47:45] yadif thread started for segment 1
[16:47:45] yadif thread started for segment 0
x264 [info]: profile High, level 3.1
Encoding: task 1 of 1, 42.86 %[16:47:46] reader: done. 1 scr changes
Encoding: task 1 of 1, 79.37 % (14.99 fps, avg 21.95 fps, ETA 00h00m01s)[16:48:05] work: average encoding speed for job is 21.946354 fps
[16:48:05] sync: got 101 frames, 126 expected
[16:48:06] dvvideo-decoder done: 101 frames, 0 decoder errors, 0 drops
[16:48:06] render: lost time: 0 (0 frames)
[16:48:06] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: frame I:1 Avg QP:11.90 size: 79792 PSNR Mean Y:51.34 U:52.63 V:52.46 Avg:51.71 Global:51.71
x264 [info]: frame P:26 Avg QP:12.02 size: 75621 PSNR Mean Y:50.67 U:52.12 V:52.05 Avg:51.09 Global:51.06
x264 [info]: frame B:73 Avg QP:13.26 size: 44780 PSNR Mean Y:48.87 U:50.55 V:50.45 Avg:49.35 Global:49.32
x264 [info]: consecutive B-frames: 1.0% 0.0% 15.0% 84.0%
x264 [info]: mb I I16..4: 1.9% 93.5% 4.6%
x264 [info]: mb P I16..4: 1.0% 66.2% 1.8% P16..4: 7.2% 14.4% 9.5% 0.0% 0.0% skip: 0.0%
x264 [info]: mb B I16..4: 0.2% 23.5% 0.2% B16..8: 21.7% 13.4% 5.8% direct:28.5% skip: 6.8% L0:28.2% L1:24.4% BI:47.3%
x264 [info]: 8x8 transform intra:97.1% inter:57.1%
x264 [info]: coded y,uvDC,uvAC intra: 99.6% 100.0% 99.8% inter: 78.1% 87.3% 57.7%
x264 [info]: i16 v,h,dc,p: 1% 4% 5% 91%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 9% 19% 42% 4% 5% 4% 6% 4% 8%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 16% 21% 8% 12% 8% 10% 7% 9%
x264 [info]: i8c dc,h,v,p: 48% 29% 14% 9%
x264 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x264 [info]: ref P L0: 38.7% 10.6% 35.4% 15.2%
x264 [info]: ref B L0: 83.4% 12.7% 3.9%
x264 [info]: ref B L1: 96.4% 3.6%
x264 [info]: SSIM Mean Y:0.9900823 (20.036db)
x264 [info]: PSNR Mean Y:49.363 U:50.980 V:50.884 Avg:49.824 Global:49.731 kb/s:10629.79
Encoding: task 1 of 1, 79.37 % (14.99 fps, avg 21.95 fps, ETA 00h00m01s)[16:48:06] pcm_s16le-decoder done: 0 frames, 0 decoder errors, 0 drops
[16:48:06] mux: track 0, 100 frames, 5314853 bytes, 10629.71 kbps, fifo 128
[16:48:06] mux: track 1, 38 frames, 354794 bytes, 709.59 kbps, fifo 64
[16:48:06] decomb: deinterlaced 20 | blended 32 | unfiltered 48 | total 100
[16:48:06] libhb: work result = 0
Encode done!
Code: Select all
mediainfo movie.mkv
General
Unique ID : 301184453423444444376238638857566672355 (0xE29604090ECD9BCF4321511C9B3DD5E3)
Complete name : movie.mkv
Format : Matroska
Format version : Version 2
File size : 5.41 MiB
Duration : 4s 0ms
Overall bit rate mode : Variable
Overall bit rate : 11.4 Mbps
Writing application : HandBrake 4394svn
Writing library : libmkv 0.6.5
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 4s 0ms
Width : 1 024 pixels
Height : 576 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Writing library : x264 core 119
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=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=12.0 / qcomp=0.60 / qpmin=3 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language : English
Color primaries : BT.601-6 525, BT.1358 525, BT.1700 NTSC, SMPTE 170M
Transfer characteristics : BT.709-5, BT.1361
Matrix coefficients : BT.601-6 525, BT.1358 525, BT.1700 NTSC, SMPTE 170M
Audio
ID : 2
Format : FLAC
Format/Info : Free Lossless Audio Codec
Codec ID : A_FLAC
Duration : 4s 0ms
Bit rate mode : Variable
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Bit depth : 16 bits
Code: Select all
exiftool -G -H -a movie.mkv
[ExifTool] - ExifTool Version Number : 8.60
[File] - File Name : movie.mkv
[File] - Directory : .
[File] - File Size : 5.4 MB
[File] - File Modification Date/Time : 2012:01:14 16:48:06+01:00
[File] - File Permissions : rw-rw-r--
[File] - File Type : MKV
[File] - MIME Type : video/x-matroska
[Matroska] 0x0286 EBML Version : 1
[Matroska] 0x02f7 EBML Read Version : 1
[Matroska] 0x0282 Doc Type : matroska
[Matroska] 0x0287 Doc Type Version : 2
[Matroska] 0x0285 Doc Type Read Version : 2
[Matroska] 0x0d80 Muxing App : libmkv 0.6.5
[Matroska] 0x1741 Writing App : HandBrake 4394svn
[Matroska] 0xad7b1 Timecode Scale : 1 ms
[Matroska] 0x0489 Duration : 4.00 s
[Matroska] 0x0057 Track Number : 1
[Matroska] 0x0003 Track Type : Video
[Matroska] 0x0006 Video Codec ID : V_MPEG4/ISO/AVC
[Matroska] 0x3e383 Video Frame Rate : 25
[Matroska] 0x0008 Track Default : Yes
[Matroska] 0x0030 Image Width : 1024
[Matroska] 0x003a Image Height : 576
[Matroska] 0x14b0 Display Width : 1024
[Matroska] 0x14ba Display Height : 576
[Matroska] 0x0057 Track Number : 2
[Matroska] 0x0003 Track Type : Audio
[Matroska] 0x0006 Audio Codec ID : A_FLAC
[Matroska] 0x2b59c Track Language : und
[Matroska] 0x0008 Track Default : Yes
[Matroska] 0x0035 Audio Sample Rate : 44100
[Matroska] 0x001f Audio Channels : 2
[Composite] - Image Size : 1024x576