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

[ffmpeg] Fixing audio file ruins video file #4193

Closed
arisboch opened this issue Nov 14, 2014 · 10 comments
Closed

[ffmpeg] Fixing audio file ruins video file #4193

arisboch opened this issue Nov 14, 2014 · 10 comments

Comments

@arisboch
Copy link

@arisboch arisboch commented Nov 14, 2014

Strangely, some video need to by "fixed" by ffmpeg, when using the parameters I use, but the resulting video files aren't playable ;(
Here's the stdout log:
ProxyChains-3.1 (http://proxychains.sf.net)
[youtube] Confirming age
[youtube] wV1FrqwZyKw: Downloading webpage
[youtube] wV1FrqwZyKw: Downloading video info webpage
[youtube] wV1FrqwZyKw: Extracting video information
[youtube] wV1FrqwZyKw: Encrypted signatures detected.
[youtube] {22} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {43} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {18} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {5} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {36} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {17} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {137} signature length 43.42, html5 player en_US-vfln6g5Eq
[youtube] {248} signature length 43.42, html5 player en_US-vfln6g5Eq
[youtube] {136} signature length 43.42, html5 player en_US-vfln6g5Eq
[youtube] {247} signature length 43.42, html5 player en_US-vfln6g5Eq
[youtube] {135} signature length 43.42, html5 player en_US-vfln6g5Eq
[youtube] {244} signature length 43.42, html5 player en_US-vfln6g5Eq
[youtube] {134} signature length 43.42, html5 player en_US-vfln6g5Eq
[youtube] {243} signature length 43.42, html5 player en_US-vfln6g5Eq
[youtube] {133} signature length 43.42, html5 player en_US-vfln6g5Eq
[youtube] {242} signature length 43.42, html5 player en_US-vfln6g5Eq
[youtube] {160} signature length 43.42, html5 player en_US-vfln6g5Eq
[youtube] {140} signature length 43.42, html5 player en_US-vfln6g5Eq
[youtube] {171} signature length 43.42, html5 player en_US-vfln6g5Eq
[youtube] {137} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {248} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {136} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {247} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {135} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {244} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {134} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {243} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {133} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {242} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {160} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {140} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] {171} signature length 45.43, html5 player en_US-vfln6g5Eq
[youtube] wV1FrqwZyKw: Downloading DASH manifest
[info] Writing video description to: Lady Gaga - Born This Way-wV1FrqwZyKw.mp4.description
[debug] Invoking downloader on u'https://r7---sn-q4f7dnzz.googlevideo.com/videoplayback?fexp=907259%2C927622%2C932404%2C943909%2C947209%2C947215%2C948124%2C952302%2C952605%2C952901%2C953757%2C953912%2C957103%2C957105%2C957201&upn=61lAj8SZ_nU&ip=204.45.29.30&expire=1415932852&gcr=us&ratebypass=yes&requiressl=yes&mm=31&ipbits=0&sver=3&sparams=gcr%2Cid%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&key=yt5&itag=22&mt=1415911163&id=o-APQC4AWjKv6A5_pj6CeawXw1D9akGBFri23gCnoF3aOS&mv=u&source=youtube&ms=au&mime=video%2Fmp4&signature=558686351C34A240A2FDFB9B45D81C55B4525E7F.96AA65273AA9089E46873A4114D694FD01BF07CD'
[download] Destination: Lady Gaga - Born This Way-wV1FrqwZyKw.mp4

[download] 0.0% of 92.70MiB at 243.78KiB/s ETA 06:30
_download notices removed from log or else it'd be needlessly long_
[download] 100.0% of 92.70MiB at 493.97KiB/s ETA 00:00
[download] 100% of 92.70MiB in 03:12
[ffmpeg] Fixing audio file "Lady Gaga - Born This Way-wV1FrqwZyKw.mp4"
[debug] ffmpeg command line: avconv -y -i 'Lady Gaga - Born This Way-wV1FrqwZyKw.mp4' -vn -acodec copy 'Lady Gaga - Born This Way-wV1FrqwZyKw.temp.mp4'
[atomicparsley] Adding thumbnail to "Lady Gaga - Born This Way-wV1FrqwZyKw.mp4"
[debug] AtomicParsley command line: AtomicParsley 'Lady Gaga - Born This Way-wV1FrqwZyKw.mp4' --artwork 'Lady Gaga - Born This Way-wV1FrqwZyKw.thumb.mp4' -o 'Lady Gaga - Born This Way-wV1FrqwZyKw.temp.mp4'

Here's the stderr log:
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['https://www.youtube.com/watch?v=wV1FrqwZyKw', '-i', '--write-description', '-t', '--audio-format', 'best', '--abort-on-error', '--all-subs', '--embed-thumbnail', '-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out None, pref UTF-8
[debug] youtube-dl version 2014.11.13.3
[debug] Python version 2.7.6 - Linux-3.13.0-24-generic-x86_64-with-LinuxMint-17-qiana
[debug] exe versions: avconv 1.2.6-7, avprobe 1.2.6-7, ffmpeg 1.2.6-7, ffprobe 1.2.6-7
[debug] Proxy map: {}
|D-chain|-<>-204.45.29.30:18108-<><>-173.194.44.78:443-<><>-OK
|D-chain|-<>-204.45.29.30:18108-<><>-173.194.44.78:443-<><>-OK
|D-chain|-<>-204.45.29.30:18108-<><>-173.194.44.78:443-<><>-OK
|D-chain|-<>-204.45.29.30:18108-<><>-173.194.44.78:443-<><>-OK
|D-chain|-<>-204.45.29.30:18108-<><>-173.194.44.78:443-<><>-OK
|D-chain|-<>-204.45.29.30:18108-<><>-173.194.44.70:443-<><>-OK
WARNING: video doesn't have subtitles
|D-chain|-<>-204.45.29.30:18108-<><>-173.194.44.64:443-<><>-OK
|D-chain|-<>-204.45.29.30:18108-<><>-74.125.1.204:443-<><>-OK
|D-chain|-<>-204.45.29.30:18108-<><>-173.194.44.78:443-<><>-OK

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 14, 2014

I can play it with VLC and mpv, what player are you using?
Also, you are using an old version of avconv, you could try using a newer version (your package manager may provide a version too old), with avconv 11 it seems to work fine.

@arisboch
Copy link
Author

@arisboch arisboch commented Nov 15, 2014

I tried to play it with vlc and mpv, but the file still won't play. I also installed more recent versions of ffmpeg and libav ([debug] exe versions: avconv 2.4.3, avprobe 2.4.3, ffmpeg 2.4.3, ffprobe 2.4.3), but it still won't work ;( ;(

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 15, 2014

Try using the --prefer-ffmpeg.
Could you post the output of ffprobe "Lady Gaga - Born This Way-wV1FrqwZyKw.mp4"?
Also which version of AtomicParsley do you have?

@arisboch
Copy link
Author

@arisboch arisboch commented Nov 16, 2014

I tried --prefer-ffmpeg, to no avail. The version of AtomicParsley is 0.9.2~svn110-4 (-version tells me "AtomicParsley from svn built on Oct 28 2010 (utf8)").

ffprobe output:
ffprobe Lady\ Gaga\ -\ Born\ This\ Way-wV1FrqwZyKw.mp4
ffprobe version 2.4.3 Copyright (c) 2007-2014 the FFmpeg developers
built on Nov 9 2014 17:21:35 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-x11grab --enable-libpulse --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 1.100 / 5. 1.100
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x29ca020] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Lady Gaga - Born This Way-wV1FrqwZyKw.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf56.4.101
Duration: 00:07:19.74, start: 0.000000, bitrate: 194 kb/s
Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 191 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:1: Video: mjpeg, yuvj420p(pc, bt470bg), 1280x720 [SAR 1:1 DAR 16:9], 90k tbr, 90k tbn, 90k tbc

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 16, 2014

The last AtomicParsley version was released last March, it could be that.

@arisboch
Copy link
Author

@arisboch arisboch commented Nov 16, 2014

Where'd I get a more recent version of atomicparsley, the one on the homepage (http://sourceforge.net/projects/atomicparsley/files/) is more than 8 years old. ;(

@arisboch
Copy link
Author

@arisboch arisboch commented Nov 16, 2014

I downloaded and compiled AtomicParsley, but it didn't help ;( ;( ;(

@clampak
Copy link

@clampak clampak commented Nov 17, 2014

With your options 'https://www.youtube.com/watch?v=wV1FrqwZyKw', '-i', '--write-description', '-t', '--audio-format', 'best', '--abort-on-error', '--all-subs', '--embed-thumbnail', '-v', I get a playable audio file, but there's no video, is that what you're getting?

If so, here's what I think is happening. You have conflicting, outdated, and other odd parameters on your command line. The major one here is that you want a video, but you're telling it to --embed-thumbnail which is only for audio, thereby telling youtube-dl to pass it on to ffmpeg to extract and make it audio only, since you don't have an alternative video format. Why ffprobe still reports there's video, I don't know.

The other conflicts and oddities are that you're telling it to ignore errors (-i), but --abort-on-error as well. Also, --audio-format is only for specifying a format type (mp3, etc.), not quality level, when you're extracting the audio in conjunction with -x, therefore it's unneeded here since (I think) you want the video, not the audio only. Youtube-dl picks the best video+audio by default, so specifying best is never needed as far as I can tell. And -t is deprecated, the title is by default the name of the output file.

There are no subtitles in this video, so --all-subs is unnecessary as well, although it doesn't conflict with anything.

A much simplified command which will give you the video is this:
youtube-dl --verbose --write-description https://www.youtube.com/watch?v=wV1FrqwZyKw

I don't know if it's possible to embed a thumbnail in a video.

Does that fix it?

@arisboch
Copy link
Author

@arisboch arisboch commented Nov 17, 2014

@clampak
Thx, that was the problem :)

@jaimeMF jaimeMF closed this Nov 18, 2014
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.