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

Embedding subtitles fails with invalid argument, appears to be missing --format switch #20943

Closed
pdxbrit opened this issue May 3, 2019 · 1 comment
Labels

Comments

@pdxbrit
Copy link

@pdxbrit pdxbrit commented May 3, 2019

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2019.04.30
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

youtube-dl --verbose -f mp4/best -o Maigret-s01-e01 --write-sub --embed-subs https://www.itv.com/hub/maigret/2a4244a0001
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--verbose', u'-f', u'mp4/best', u'-o', u'Maigret-s01-e01', u'--write-sub', u'--embed-subs', u'https://www.itv.com/hub/maigret/2a4244a0001']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.04.30
[debug] Python version 2.7.13 (CPython) - Linux-4.14.30-v7+-armv7l-with-debian-9.4
[debug] exe versions: ffmpeg 3.2.10-1, ffprobe 3.2.10-1, rtmpdump 2.4
[debug] Proxy map: {}
[debug] Using fake IP 25.217.171.63 (GB) as X-Forwarded-For.
[ITV] 2a4244a0001: Downloading webpage
[ITV] 2a4244a0001: Downloading XML
WARNING: Unable to download XML: HTTP Error 504: Gateway Time-out
[ITV] 2a4244a0001: Downloading JSON metadata
[ITV] 2a4244a0001: Downloading m3u8 information
[info] Writing video subtitles to: Maigret-s01-e01.en.vtt
[debug] Invoking downloader on u'https://itvpnpdotcom-a.akamaihd.net/2-4244-0001-001/18/2/VAR012/2-4244-0001-001_18_2_VAR012.ism/2-4244-0001-001_18_2_VAR012-audio=128000-video=1378238.m3u8'
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 435
[download] Destination: Maigret-s01-e01
[download] 100% of 955.74MiB in 07:09
[debug] ffmpeg command line: ffprobe -show_streams 'file:Maigret-s01-e01'
[ffmpeg] Fixing malformed AAC bitstream in "Maigret-s01-e01"
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:Maigret-s01-e01' -c copy -f mp4 '-bsf:a' aac_adtstoasc 'file:Maigret-s01-e01.temp'
[ffmpeg] Embedding subtitles in 'Maigret-s01-e01'
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:Maigret-s01-e01' -i 'file:Maigret-s01-e01.en.vtt' -map 0 -c copy -map '-0:s' -map '-0:d' '-c:s' mov_text -map '1:0' '-metadata:s:s:0' 'language=eng' 'file:Maigret-s01-e01.temp'
ERROR: file:Maigret-s01-e01.temp: Invalid argument
Traceback (most recent call last):
  File "/home/mprice/.local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 2054, in post_process
    files_to_delete, info = pp.run(info)
  File "/home/mprice/.local/lib/python2.7/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 426, in run
    self.run_ffmpeg_multiple_files(input_files, temp_filename, opts)
  File "/home/mprice/.local/lib/python2.7/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 235, in run_ffmpeg_multiple_files
    raise FFmpegPostProcessorError(msg)
FFmpegPostProcessorError: file:Maigret-s01-e01.temp: Invalid argument

Description

When trying to embed subtitles, the script fails with an Error: Invalid argument error on the output file. Taking the the ffmpeg command line arguments from the verbose output, and running it again independently generates a more verbose error of: [NULL @ 0x1a46040] Unable to find a suitable output format for 'file:Maigret-s01-e01.temp'
file:Maigret-s01-e01.temp: Invalid argument

ffmpeg -y -loglevel repeat+info -i file:Maigret-s01-e01.mp4 -i file:Maigret-s01-e01.en.vtt -map 0 -c copy -map -0:s -map -0:d -c:s mov_text -map 1:0 -metadata:s:s:0 language=eng file:Maigret-s01-e01.temp
ffmpeg version 3.2.10-1~deb9u1+rpt1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1) 20170516
  configuration: --prefix=/usr --extra-version='1~deb9u1+rpt1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:Maigret-s01-e01.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.56.101
  Duration: 01:26:54.08, start: 0.000000, bitrate: 1482 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 896x504 [SAR 1:1 DAR 16:9], 1378 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #1, webvtt, from 'file:Maigret-s01-e01.en.vtt':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Subtitle: webvtt
[NULL @ 0x1a46040] Unable to find a suitable output format for 'file:Maigret-s01-e01.temp'
file:Maigret-s01-e01.temp: Invalid argument

Adding a -f mp4 switch prior to the output filename appears to resolve the issue for me.

Is this a bug, or am I missing a switch on my original youtub-dl command line? youtube-dl --verbose -f mp4/best -o Maigret-s01-e01 --write-sub --embed-subs https://www.itv.com/hub/maigret/2a4244a0001

@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 3, 2019

Don't touch -o if you have no idea what you are doing.

@dstftw dstftw closed this May 3, 2019
@dstftw dstftw added the invalid label May 3, 2019
@ytdl-org ytdl-org locked and limited conversation to collaborators May 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.