Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Viki] ffmpeg embed subtitles error #17421

Open
5 of 9 tasks
ghost opened this issue Sep 3, 2018 · 3 comments
Open
5 of 9 tasks

[Viki] ffmpeg embed subtitles error #17421

ghost opened this issue Sep 3, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented Sep 3, 2018

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.

  • I've verified and I assure that I'm running youtube-dl 2018.09.01

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


~/Downloads/youtube-dl --write-sub --sub-format srt --sub-lang en --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'--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=1535939464&h=1b543edad20d7f05d2eee1ff5cd5cfec'
[download] Destination: My Love From the Star - Episode 1-1026409v.mp4
[download] 100% of 348.84MiB in 00:01
[ffmpeg] Embedding subtitles in 'My Love From the Star - Episode 1-1026409v.mp4'
[debug] ffmpeg command line: ffmpeg -y -i 'file:My Love From the Star - Episode 1-1026409v.mp4' -i 'file:My Love From the Star - Episode 1-1026409v.en.srt' -map 0 -c copy -map '-0:s' '-c:s' mov_text -map '1:0' '-metadata:s:s:0' 'language=eng' 'file:My Love From the Star - Episode 1-1026409v.temp.mp4'
ERROR:     Last message repeated 1 times
Traceback (most recent call last):
  File "/home33/megamind/Downloads/youtube-dl/youtube_dl/YoutubeDL.py", line 2047, in post_process
    files_to_delete, info = pp.run(info)
  File "/home33/megamind/Downloads/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 393, in run
    self.run_ffmpeg_multiple_files(input_files, temp_filename, opts)
  File "/home33/megamind/Downloads/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 204, in run_ffmpeg_multiple_files
    raise FFmpegPostProcessorError(msg)
FFmpegPostProcessorError:     Last message repeated 1 times

...
<end of log>

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

@ghost ghost changed the title Viki.com embed subtitles error Viki.com ffmpeg embed subtitles error Sep 3, 2018
@ghost
Copy link
Author

ghost commented Sep 3, 2018

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)
---

@ghost ghost changed the title Viki.com ffmpeg embed subtitles error [Viki] ffmpeg embed subtitles error Sep 4, 2018
@Phr33d0m
Copy link

Phr33d0m commented Jan 9, 2019

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...

@Phr33d0m
Copy link

Phr33d0m commented Jan 9, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@Phr33d0m @dstftw and others