lisamelton / video_transcoding

Tools to transcode, inspect and convert videos.
MIT License
2.39k stars 160 forks source link

Subtitles - All of track burnt, not only forced #237

Closed craig85311 closed 5 years ago

craig85311 commented 5 years ago

In Red Sparrow, there's Russian spoken at 1:35:54. The main track on subtitle track 1 is English, on the forced is the brief Russian dialog. The English is in gray lettering, while the Russian is in a white. I cannot seem to separate the forced part of the track to burn. Either all or nothing.

khaosx commented 5 years ago

@craig85311

Howdy - at first glance, this sounds like an issue with the source media. Can you tell me a little more about how you created the source? Or, even better, a mediainfo dump of the source.

I'm looking at my encode of Red Sparrow right now, and there are two distinct tracks - one forced and one full. I used makemkv to create my source and it extracted both subtitle tracks correctly, and added the correct mkvflags, so it's likely that the problem is in the process (that's good news, as it's easier to troubleshoot!)

khaosx commented 5 years ago

And for comparison, here's the output for my encode:

mediainfo /Volumes/Media/Movies/Red\ Sparrow\ (2018)/Red\ Sparrow\ (2018)\ Bluray-1080p.mkv General Unique ID : 60998238059237996592508449735269669392 (0x2DE3D554AD3FE45CBF159C2B63A3DA10) Complete name : /Volumes/Media/Movies/Red Sparrow (2018)/Red Sparrow (2018) Bluray-1080p.mkv Format : Matroska Format version : Version 4 File size : 10.3 GiB Duration : 2 h 20 min Overall bit rate mode : Variable Overall bit rate : 10.5 Mb/s Movie name : Red Sparrow (2018) Encoded date : UTC 2018-11-17T23:04:23Z Writing application : HandBrake 1.1.2 2018090800 Writing library : Lavf57.7.2

Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4 Format settings : CABAC / 4 Ref Frames Format settings, CABAC : Yes Format settings, ReFrames : 4 frames Codec ID : V_MPEG4/ISO/AVC Duration : 2 h 20 min Width : 1 920 pixels Height : 800 pixels Display aspect ratio : 2.40:1 Frame rate mode : Constant Frame rate : 23.976 (24000/1001) FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Writing library : x264 core 155 r2901 7d0ff22 Encoding settings : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x3:0 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=18 / lookahead_threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=crf / mbtree=1 / crf=1.0 / qcomp=0.60 / qpmin=0 / qpmax=34 / qpstep=4 / vbv_maxrate=6000 / vbv_bufsize=12000 / crf_max=25.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00 Default : Yes Forced : No Color range : Limited Color primaries : BT.709 Transfer characteristics : BT.709 Matrix coefficients : BT.709

Audio 1 ID : 2 Format : DTS ES XLL Format/Info : Digital Theater Systems Commercial name : DTS-HD Master Audio Codec ID : A_DTS Duration : 2 h 20 min Bit rate mode : Variable Channel(s) : 6 channels Channel(s)_Original : 8 channels Channel layout : C L R Ls Rs LFE Lb Rb Sampling rate : 48.0 kHz Frame rate : 93.750 FPS (512 SPF) Bit depth : 24 bits Compression mode : Lossless Title : Surround Language : English Default : Yes Forced : No

Audio 2 ID : 3 Format : AAC LC Format/Info : Advanced Audio Codec Low Complexity Codec ID : A_AAC-2 Duration : 2 h 20 min Channel(s) : 2 channels Channel layout : L R Sampling rate : 48.0 kHz Frame rate : 46.875 FPS (1024 SPF) Compression mode : Lossy Title : Stereo Language : English Default : No Forced : No

Text 1 ID : 4 Format : PGS Codec ID : S_HDMV/PGS Codec ID/Info : Picture based subtitle format used on BDs/HD-DVDs Language : English Default : Yes Forced : Yes

Text 2 ID : 5 Format : PGS Codec ID : S_HDMV/PGS Codec ID/Info : Picture based subtitle format used on BDs/HD-DVDs Language : English Default : No Forced : No

lisamelton commented 5 years ago

@craig85311 Thanks for filing this after our Twitter conversation!

And thanks, @khaosx, for your help as well! Especially since I don't have a copy of "Red Sparrow."

OK, @craig85311, can you include the MediaInfo information about your original source movie and the .log file from your transcoding of it? You can attach those as separate files if they're too large to paste in here.

Thanks!

craig85311 commented 5 years ago

I used MakeMKV 1.14.2 to rip BD to .mp4 file, have 7.1 & 5.1 Dolby tracks, and 4 English subtitle tracks. I unfortunately deleted the .log file. I'll re-transcode. What option should I use for subtitle? I had been using –burn-subtitle 1 (track is 1) for the previous transcode.

lisamelton commented 5 years ago

@craig85311 Isn't the first track the wrong one? I would try --burn-subtitle 2 this time.

khaosx commented 5 years ago

Steps to make sure subtitles burn correctly, every time:

  1. Look up the title on this spreadsheet)

  2. Select the corresponding tracks in MakeMKV. According to the spreadsheet, you're looking for separate, non-forced sub track 3. Select it, and then set the mkv flags for that track to DF in MakeMKV.

  3. Rip

  4. Add this to your command line for transcode-video: --add-subtitle all --no-auto-burn --force-subtitle scan". If you want it burned, then change it to: --burn-subtitle scan.

This will work, so long as you make sure that MakeMKV sets the f (forced) flag on the track that should forced.

craig85311 commented 5 years ago

Ugh I went back to re-play the video with subtitle tracks and it appears to be my fault. I had seen it on what I thought was subtitle track 1 when it was actually playing on subtitle track 3. I'm sorry to waste everyone's time. The script is working as it should, now if I could only do the same! Thanks for your help guys, Happy Holidays :)

lisamelton commented 5 years ago

@craig85311 No problem! I'm just glad the problem was solved. Don't be shy about filing other issues in the future when you get stuck. That's why we're here.

And thanks to @khaosx for jumping in with all the help! I really appreciate all the folks who contribute to our project.

I'll close this now but feel free to keep commenting.