Open ghost opened 6 years ago
Tired using --recode-video mkv post processing option and now its able to embed the subs i dont get it MP4 files on viu can be embedded with subs without re-encoding to mkv then why not viki Thanks
Update:- tried few files re-encoding to mkv it does work while embedding subs. but even ignoring the cpu usage and time it takes there seems to be a noticeable quality difference (sometimes) also mkv encoded file has much lower bitrate (maybe i'm feeling the placebo effect due to media info)
~/Downloads/youtube-dl --write-sub --sub-format srt --sub-lang en --recode-video mkv --embed-subs 'https://www.viki.com/videos/1026409v-my-love-from-the-star-episode-1' -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--write-sub', u'--sub-format', u'srt', u'--sub-lang', u'en', u'--recode-video', u'mkv', u'--embed-subs', u'https://www.viki.com/videos/1026409v-my-love-from-the-star-episode-1', u'-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.09.01
[debug] Python version 2.7.13 (CPython) - Linux-4.9.0-3-amd64-x86_64-with-debian-9.1
[debug] exe versions: ffmpeg 3.2.7-1, ffprobe 3.2.7-1
[debug] Proxy map: {}
[viki] 1026409v: Downloading video JSON
[viki] 1026409v: Downloading video streams JSON
[debug] Default format spec: bestvideo+bestaudio/best
[info] Writing video subtitles to: My Love From the Star - Episode 1-1026409v.en.srt
[debug] Invoking downloader on u'https://v4.viki.io/1026409v/1026409v_high_480p_1708160136.mp4?e=1535943113&h=b5a50c9b392386623abc0006df6afd58'
[download] Destination: My Love From the Star - Episode 1-1026409v.mp4
[download] 100% of 348.84MiB in 00:01
[ffmpeg] Converting video from mp4 to mkv, Destination: My Love From the Star - Episode 1-1026409v.mkv
[debug] ffmpeg command line: ffmpeg -y -i 'file:My Love From the Star - Episode 1-1026409v.mp4' 'file:My Love From the Star - Episode 1-1026409v.mkv'
Deleting original file My Love From the Star - Episode 1-1026409v.mp4 (pass -k to keep)
[ffmpeg] Embedding subtitles in 'My Love From the Star - Episode 1-1026409v.mkv'
[debug] ffmpeg command line: ffmpeg -y -i 'file:My Love From the Star - Episode 1-1026409v.mkv' -i 'file:My Love From the Star - Episode 1-1026409v.en.srt' -map 0 -c copy -map '-0:s' -map '1:0' '-metadata:s:s:0' 'language=eng' 'file:My Love From the Star - Episode 1-1026409v.temp.mkv'
Deleting original file My Love From the Star - Episode 1-1026409v.en.srt (pass -k to keep)
---
I think I've found the error causing this. When we download the .mp4 file it embeds two 'RTP' (Data) streams and ffmpeg's -map 0 -c copy
doesn't know how to handle those streams so it fails in merging the files.
I tried passing this to --exec
:
ffmpeg -i "{}" -map 0:0 -map 0:1 -c copy "tmp-{}" && rm "{}" && mv "tmp-{}" "{}"
Which basically just leaves the audio and video streams inside the .mp4 (in which case the merging works as expected), but --exec
does not execute after download (as opposed to the --help
description of: Execute a command on the file after downloading) but rather it waits for the merging to run the command, so it does nothing...
I've found a dirty workaround for this. Changing the options that we pass to ffmpeg to be -map 0:0 -map 0:1
instead of just -map 0
does the trick.
Make sure you are using the latest version: run
youtube-dl --version
and ensure your version is 2018.09.01. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue
I'm trying to download Video from Viki it works perfectly but when i say it to embed subs it throws me the above error tried multiple files same issue persists (issue with both vtt and srt file types) I also use embed subs with Viu but it works great there only having issues with VIU