jariz / scdl

The intelligent SoundCloud downloader. Downloads any url, tags automatically.
26 stars 1 forks source link

ffmpeg error - Stream mapping #4

Closed sparcut closed 7 years ago

sparcut commented 7 years ago

Have installed ffmpeg, though getting error that seems to be related to it. See below.

The scdl.log has some strange charcters after pasting into github, not shown locally in editor (atom).

Console: conemu64_2017-06-01_18-48-09

scdl.log:

    2017-06-01T08:43:07.552Z - debug: undefined 
    { status: '302 - Found',
      location: 'https://api.soundcloud.com/tracks/283096044.json?client_id=23aca29c4185d222f2e536f440e96b91' }
    2017-06-01T08:43:07.559Z - debug: Getting /tracks/283096044.json
    2017-06-01T08:43:07.899Z - debug:  
    { kind: 'track',
      id: 283096044,
      created_at: '2016/09/15 21:43:55 +0000',
      user_id: 253605952,
      duration: 194812,
      commentable: true,
      state: 'finished',
      original_content_size: 7789783,
      last_modified: '2016/09/18 22:20:59 +0000',
      sharing: 'public',
      tag_list: '',
      permalink: 'one-is-the-loneliest-number-bownz-rmx',
      streamable: true,
      embeddable_by: 'all',
      purchase_url: 'https://www.facebook.com/BOWNZ-641042579388387/app/208195102528120',
      purchase_title: null,
      label_id: null,
      genre: 'Electronic',
      title: 'One Is The Loneliest Number - BOWNZ Rmx',
      description: 'One Is The Loneliest Number - BOWNZ RMX\nclick on buy for free download',
      label_name: null,
      release: null,
      track_type: null,
      key_signature: null,
      isrc: null,
      video_url: null,
      bpm: null,
      release_year: null,
      release_month: null,
      release_day: null,
      original_format: 'mp3',
      license: 'all-rights-reserved',
      uri: 'https://api.soundcloud.com/tracks/283096044',
      user: 
       { id: 253605952,
         kind: 'user',
         permalink: 'user-681637660',
         username: 'BOWNZ',
         last_modified: '2016/09/10 23:14:52 +0000',
         uri: 'https://api.soundcloud.com/users/253605952',
         permalink_url: 'http://soundcloud.com/user-681637660',
         avatar_url: 'https://i1.sndcdn.com/avatars-000259508642-qvqqxk-large.jpg' },
      permalink_url: 'https://soundcloud.com/user-681637660/one-is-the-loneliest-number-bownz-rmx',
      artwork_url: 'https://i1.sndcdn.com/artworks-000182790311-i7fvwd-large.jpg',
      stream_url: 'https://api.soundcloud.com/tracks/283096044/stream',
      download_url: 'https://api.soundcloud.com/tracks/283096044/download',
      playback_count: 13872,
      download_count: 0,
      favoritings_count: 285,
      reposts_count: 31,
      comment_count: 5,
      downloadable: false,
      waveform_url: 'https://w1.sndcdn.com/U9VKdDlsBNkD_m.png',
      attachments_uri: 'https://api.soundcloud.com/tracks/283096044/attachments' }
    2017-06-01T08:43:08.284Z - debug: downloading https://cf-media.sndcdn.com/U9VKdDlsBNkD.128.mp3?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiKjovL2NmLW1lZGlhLnNuZGNkbi5jb20vVTlWS2REbHNCTmtELjEyOC5tcDMiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE0OTYzMDY5MDN9fX1dfQ__&Signature=s8l648WWZFvIGy51GXIFyHKk7StVJG0xHk-iWwjLkzSYMOEuuqlNamw4BSIRG-r-EeBhfhrvm4ZlYBmQ2ciXqzIn9D57QklgQD8sFDAdkyg4n4VvqDY65CWX86iIWuy8LBN4Qp7ye2QxiR~G5JQ0akzzF6WZKAX7PjjWyh0MJiPLauZAtkvjnAjsG3v44F9Sc5sVxF6ylu2Myww7FqCx9fUp1qsV05ebTmKvDzA3Smh6wf82CzIEHqK-Sw5KtJyLr~fSVo16YTjaCRprPXnYaCBa-gPib11OIPXUhU3z1fvN00gO6gXAX1i2COI31BVBFsELpHPNRhU58u87movAVw__&Key-Pair-Id=APKAJAGZ7VMH2PFPW6UQ C:\Users\Harrison\Desktop\One Is The Loneliest Number - BOWNZ Rmx.mp3
    2017-06-01T08:43:08.658Z - debug: downloading https://i1.sndcdn.com/artworks-000182790311-i7fvwd-t500x500.jpg.jpg C:\Users\Harrison\Desktop\One Is The Loneliest Number - BOWNZ Rmx.jpg
    2017-06-01T08:43:08.729Z - info: All files and meta data downloaded. Commencing tagging...
    2017-06-01T08:43:08.730Z - debug: writing to One Is The Loneliest Number - BOWNZ Rmx.mp3 
    { comment: 'Tagged with SCDL http://git.io/vZp18',
      artist: 'One Is The Loneliest Number',
      title: 'BOWNZ Rmx',
      genre: 'Electronic',
      album: undefined,
      year: 2016 }
    2017-06-01T08:43:08.809Z - warn:  Error: ffmpeg version 3.3.1 Copyright (c) 2000-2017 the FFmpeg developers
      built with gcc 6.3.0 (GCC)
      configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
      libavutil      55. 58.100 / 55. 58.100
      libavcodec     57. 89.100 / 57. 89.100
      libavformat    57. 71.100 / 57. 71.100
      libavdevice    57.  6.100 / 57.  6.100
      libavfilter     6. 82.100 /  6. 82.100
      libswscale      4.  6.100 /  4.  6.100
      libswresample   2.  7.100 /  2.  7.100
      libpostproc    54.  5.100 / 54.  5.100
    Input #0, mp3, from 'One Is The Loneliest Number - BOWNZ Rmx.mp3':
      Duration: 00:03:14.77, start: 0.025057, bitrate: 128 kb/s
        Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
        Metadata:
          encoder         : LAME3.99r
        Side data:
          replaygain: track gain - -8.800000, track peak - unknown, album gain - unknown, album peak - unknown, 
    [mjpeg @ 00000000025a3880] No JPEG data found in image
    [image2 @ 00000000025bc7c0] decoding for stream 0 failed
    [image2 @ 00000000025bc7c0] Could not find codec parameters for stream 0 (Video: mjpeg, none(bt470bg/unknown/unknown)): unspecified size
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #1, image2, from 'One Is The Loneliest Number - BOWNZ Rmx.jpg':
      Duration: 00:00:00.04, start: 0.000000, bitrate: 2 kb/s
        Stream #1:0: Video: mjpeg, none(bt470bg/unknown/unknown), 25 tbr, 25 tbn, 25 tbc
    [mp3 @ 00000000025ca940] dimensions not set
    Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
    Stream mapping:
      Stream #0:0 -> #0:0 (copy)
      Stream #1:0 -> #0:1 (copy)
        Last message repeated 1 times

        at ChildProcess.<anonymous> (C:\Users\Harrison\AppData\Roaming\npm\node_modules\scdl\node_modules\ffmetadata\index.js:85:16)
        at emitTwo (events.js:125:13)
        at ChildProcess.emit (events.js:213:7)
        at maybeClose (internal/child_process.js:887:16)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
sparcut commented 7 years ago

Looks like scdl.log like that because of colouring.

scdl.coffee#L23

jariz commented 7 years ago

Looks like it wrote a image with corrupt data.
It's attempting to download https://i1.sndcdn.com/artworks-000182790311-i7fvwd-t500x500.jpg.jpg but that doesn't exist.
I can reproduce it. Maybe soundcloud changed something.
Anyway, should be fairly easy to fix. I'll look into it soon.

sparcut commented 7 years ago

Aight, cool. Had a look at scdl.coffee, should be simple enough to use ffmpeg cli for the time being.

Cheers.

sparcut commented 7 years ago

Was interested in trying ffmetadata package. Getting same error by following its api, might be an ffmetadata issue...

jariz commented 7 years ago

The problem isn't with ffmpeg or ffmetadata, the problem is with scdl downloading a corrupt image.

sparcut commented 7 years ago

It works fine with ffmpeg cli, and doesn't with ffmetadata write api. 🤔

jariz commented 7 years ago

if you run npm i -g scdl now it should be fixed