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

--add-metadata causing errors in post processing #4776

Closed
vutang50 opened this issue Jan 24, 2015 · 6 comments
Closed

--add-metadata causing errors in post processing #4776

vutang50 opened this issue Jan 24, 2015 · 6 comments

Comments

@vutang50
Copy link

@vutang50 vutang50 commented Jan 24, 2015

Hi,
When running the program from a vevo source with --add-metadata parameter, in post processing phase, the following error is encountered:
[ffmpeg] Adding metadata to 'test.mp4'
ERROR: av_interleaved_write_frame(): Operation not permitted

This is true even with avconv installed. I tried to manually run ffmpeg and avconv
ffmpeg -i test.mp4 -codec copy -metadata title="Test Title" test1.mp4
eventually runs into this error:
[mp4 @ 0x2547260] malformated aac bitstream, use -absf aac_adtstoasc
av_interleaved_write_frame(): Operation not permitted

If i then execute ffmpeg -i test.mp4 -codec copy -metadata title="Test Title" -bsf aac_adtstoasc test1.mp4
That succeeds and
$ du -h *.mp4
149M test1.mp4
163M test.mp4

$ ffprobe -loglevel quiet -show_format test1.mp4 | grep title
TAG:title=Test Title

I did not research what would be the reason for the malformed bit stream, but it happens consistently from the same source. Don't know if a good solution is to somehow activate that flag or allowing us to add more parameters in the post processor. Other wise I suppose I could use -exec or a script is to interpret the --write-json-file out and then run the ffmpeg command externally to embed the meta data. I essentially would also like to embed thumbnail but have not tried that.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jan 24, 2015

Please post the full output of youtube-dl --verbose URL OTHER_OPTIONS, otherwise we can't debug the problem.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jan 24, 2015

I can reproduce it with the test video http://www.vevo.com/watch/hurts/somebody-to-die-for/GB1101300280.

Using the ffmpeg downloader instead of the native hls downloader works. Maybe we could use it instead.

@vutang50
Copy link
Author

@vutang50 vutang50 commented Jan 24, 2015

I am not sure if you still need the verbose output, but I have added it below. Is there a parameter to use the ffmpeg downloader or does that need to be added to the command line?

youtube-dl --add-metadata --verbose --write-info-json --write-thumbnail -o test.mp4 http://cache.vevo.com/m/html/embed.html?video=USCJY1431509
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--add-metadata', '--verbose', '--write-info-json', '--write-thumbnail', '-o', 'test.mp4', 'http://cache.vevo.com/m/html/embed.html?video=USCJY1431509']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.10.25
[debug] Python version 2.7.6 - Linux-3.13.0-43-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] Proxy map: {}
[Vevo] Retrieving oauth token
[Vevo] USCJY1431509: Downloading JSON metadata
[Vevo] USCJY1431509: Downloading HLS formats
[Vevo] USCJY1431509: Downloading webpage
[info] Writing video description metadata as JSON to: test.info.json
[Vevo] USCJY1431509: Downloading thumbnail ...
[Vevo] USCJY1431509: Writing thumbnail to: test.jpg
[debug] Invoking downloader on u'http://hls-aws.vevo.com/v3/hls/2014/11/USCJY1431509/a50b702a-4eb4-4f08-b6d0-a0070c4627e6/5200/uscjy1431509_5200k_1920x1080_h264_5200_aac_128.m3u8'
[download] Destination: test.mp4
[hlsnative] USCJY1431509: Downloading m3u8 manifest
[hlsnative] USCJY1431509: Downloading segment 1 / 28
[hlsnative] USCJY1431509: Downloading segment 2 / 28
[hlsnative] USCJY1431509: Downloading segment 3 / 28
[hlsnative] USCJY1431509: Downloading segment 4 / 28
[hlsnative] USCJY1431509: Downloading segment 5 / 28
[hlsnative] USCJY1431509: Downloading segment 6 / 28
[hlsnative] USCJY1431509: Downloading segment 7 / 28
[hlsnative] USCJY1431509: Downloading segment 8 / 28
[hlsnative] USCJY1431509: Downloading segment 9 / 28
[hlsnative] USCJY1431509: Downloading segment 10 / 28
[hlsnative] USCJY1431509: Downloading segment 11 / 28
[hlsnative] USCJY1431509: Downloading segment 12 / 28
[hlsnative] USCJY1431509: Downloading segment 13 / 28
[hlsnative] USCJY1431509: Downloading segment 14 / 28
[hlsnative] USCJY1431509: Downloading segment 15 / 28
[hlsnative] USCJY1431509: Downloading segment 16 / 28
[hlsnative] USCJY1431509: Downloading segment 17 / 28
[hlsnative] USCJY1431509: Downloading segment 18 / 28
[hlsnative] USCJY1431509: Downloading segment 19 / 28
[hlsnative] USCJY1431509: Downloading segment 20 / 28
[hlsnative] USCJY1431509: Downloading segment 21 / 28
[hlsnative] USCJY1431509: Downloading segment 22 / 28
[hlsnative] USCJY1431509: Downloading segment 23 / 28
[hlsnative] USCJY1431509: Downloading segment 24 / 28
[hlsnative] USCJY1431509: Downloading segment 25 / 28
[hlsnative] USCJY1431509: Downloading segment 26 / 28
[hlsnative] USCJY1431509: Downloading segment 27 / 28
[hlsnative] USCJY1431509: Downloading segment 28 / 28
[ffmpeg] Adding metadata to 'test.mp4'
[debug] ffmpeg command line: avconv -y -i test.mp4 -c copy -metadata date=20141110 -metadata 'artist=Taylor Swift' -metadata 'title=Blank Space' test.temp.mp4
ERROR: av_interleaved_write_frame(): Operation not permitted
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1114, in post_process
keep_video_wish, new_info = pp.run(info)
File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 481, in run
self.run_ffmpeg(filename, temp_filename, options)
File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 69, in run_ffmpeg
self.run_ffmpeg_multiple_files([path], out_path, opts)
File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 63, in run_ffmpeg_multiple_files
raise FFmpegPostProcessorError(msg)
FFmpegPostProcessorError

@pricejn2
Copy link

@pricejn2 pricejn2 commented Jan 27, 2015

@vutang50 There is a --prefer-ffmpeg parameter to force the use of ffmpeg instead of the default avconv.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jan 27, 2015

@pricejn2 I got the same error using latest ffmpeg.
Using the native downloader is harcoded in the extractor, we would need to change it.

@pricejn2
Copy link

@pricejn2 pricejn2 commented Jan 27, 2015

Ah, I see. Thanks for clarifying.

@remitamine remitamine closed this in f17f865 Mar 5, 2016
remitamine added a commit that referenced this issue Mar 5, 2016
Add fixup for media files produced by HlsNative downloader(fixes #4776)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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