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

Corrupted Mp3 Files #7870

Closed
barisyesilcimen opened this issue Dec 15, 2015 · 7 comments
Closed

Corrupted Mp3 Files #7870

barisyesilcimen opened this issue Dec 15, 2015 · 7 comments

Comments

@barisyesilcimen
Copy link

@barisyesilcimen barisyesilcimen commented Dec 15, 2015

$gelen='https://www.youtube.com/watch?v=X19SZARSOas';

$mp3isim=md5(date('d.m.Y H:i:s').$title);

$string=('youtube-dl -4 --ffmpeg-location /usr/local/bin/ '.$gelen.' --extract-audio --audio-format mp3 -o /home/mp3indiren/public_html/test/tmp/'.$mp3isim.'.mp3 ');

$descriptorspec = array(
0 => array("pipe", "r"), // stdin
1 => array("pipe", "w"), // stdout
2 => array("pipe", "w"), // stderr
);
$process = proc_open($string, $descriptorspec, $pipes);
$stdout = stream_get_contents($pipes[1]);
fclose($pipes[1]);
$stderr = stream_get_contents($pipes[2]);
fclose($pipes[2]);
$ret = proc_close($process);
$x=json_encode(array('output' => $stdout));

echo '

'.$x.'

';

{"output":"[youtube] X19SZARSOas: Downloading webpage\n[youtube] X19SZARSOas: Downloading video info webpage\n[youtube] X19SZARSOas: Extracting video information\n[youtube] X19SZARSOas: Downloading DASH manifest\n[download] Destination: /home/mp3indiren/public_html/test/tmp/7d91cab11a2010f56c96508595b4982c.mp3\n\r[download] 0.0% of 4.52MiB at 40.18KiB/s ETA 01:55\r[download] 0.1% of 4.52MiB at 119.80KiB/s ETA 00:38\r[download] 0.2% of 4.52MiB at 278.32KiB/s ETA 00:16\r[download] 0.3% of 4.52MiB at 594.25KiB/s ETA 00:07\r[download] 0.7% of 4.52MiB at 1.10MiB/s ETA 00:04\r[download] 1.4% of 4.52MiB at 1.09MiB/s ETA 00:04\r[download] 2.7% of 4.52MiB at 1.51MiB/s ETA 00:02\r[download] 5.5% of 4.52MiB at 2.21MiB/s ETA 00:01\r[download] 11.0% of 4.52MiB at 3.12MiB/s ETA 00:01\r[download] 22.1% of 4.52MiB at 4.77MiB/s ETA 00:00\r[download] 44.2% of 4.52MiB at 7.78MiB/s ETA 00:00\r[download] 88.4% of 4.52MiB at 13.48MiB/s ETA 00:00\r[download] 100.0% of 4.52MiB at 14.39MiB/s ETA 00:00\r[download] 100% of 4.52MiB in 00:00\n[ffmpeg] Post-process file /home/mp3indiren/public_html/test/tmp/7d91cab11a2010f56c96508595b4982c.mp3 exists, skipping\n"}

Everything is ok but downloaded mp3 file is corrupted. I can not play it with Mediaplayer/Quicktime eg.

@barisyesilcimen
Copy link
Author

@barisyesilcimen barisyesilcimen commented Dec 15, 2015

New report:

{"status":0,"errors":"","url_orginal":null,"output":"[youtube] X19SZARSOas: Downloading webpage\n[youtube] X19SZARSOas: Downloading video info webpage\n[youtube] X19SZARSOas: Extracting video information\n[youtube] X19SZARSOas: Downloading DASH manifest\n[download] Destination: 3f9c1ac07ec279f0016962ae08bf1438.mp3\n\r[download] 0.0% of 4.52MiB at 64.01KiB/s ETA 01:12\r[download] 0.1% of 4.52MiB at 189.84KiB/s ETA 00:24\r[download] 0.2% of 4.52MiB at 439.21KiB/s ETA 00:10\r[download] 0.3% of 4.52MiB at 933.95KiB/s ETA 00:04\r[download] 0.7% of 4.52MiB at 1.50MiB/s ETA 00:02\r[download] 1.4% of 4.52MiB at 1.68MiB/s ETA 00:02\r[download] 2.7% of 4.52MiB at 2.28MiB/s ETA 00:01\r[download] 5.5% of 4.52MiB at 3.43MiB/s ETA 00:01\r[download] 11.0% of 4.52MiB at 5.17MiB/s ETA 00:00\r[download] 22.1% of 4.52MiB at 7.98MiB/s ETA 00:00\r[download] 44.2% of 4.52MiB at 12.66MiB/s ETA 00:00\r[download] 88.4% of 4.52MiB at 17.26MiB/s ETA 00:00\r[download] 100.0% of 4.52MiB at 19.27MiB/s ETA 00:00\r[download] 100% of 4.52MiB in 00:00\n[ffmpeg] Post-process file 3f9c1ac07ec279f0016962ae08bf1438.mp3 exists, skipping\n","command":"youtube-dl -4 --ffmpeg-location /usr/local/bin/ https://www.youtube.com/watch?v=X19SZARSOas --extract-audio --audio-format mp3 -o 3f9c1ac07ec279f0016962ae08bf1438.mp3"}array(11) { [0]=> string(84) "ffprobe version git-2015-12-13-906c0b7 Copyright (c) 2007-2015 the FFmpeg developers" [1]=> string(54) "built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)" [2]=> string(356) "configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/usr/local/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265" [3]=> string(38) "libavutil 55. 10.100 / 55. 10.100" [4]=> string(38) "libavcodec 57. 17.100 / 57. 17.100" [5]=> string(38) "libavformat 57. 20.100 / 57. 20.100" [6]=> string(38) "libavdevice 57. 0.100 / 57. 0.100" [7]=> string(38) "libavfilter 6. 21.100 / 6. 21.100" [8]=> string(38) "libswscale 4. 0.100 / 4. 0.100" [9]=> string(38) "libswresample 2. 0.101 / 2. 0.101" [10]=> string(38) "libpostproc 54. 0.100 / 54. 0.100"

@barisyesilcimen
Copy link
Author

@barisyesilcimen barisyesilcimen commented Dec 15, 2015

same, corrputed mp3 with user ssh and root ssh.

@barisyesilcimen
Copy link
Author

@barisyesilcimen barisyesilcimen commented Dec 15, 2015

found a new error: ERROR: WARNING: unable to obtain file audio codec with ffprobe

how can i fix it?

@barisyesilcimen
Copy link
Author

@barisyesilcimen barisyesilcimen commented Dec 15, 2015

ffprobe
ffprobe: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Dec 15, 2015

Your original command:

youtube-dl -v -4 "https://www.youtube.com/watch?v=X19SZARSOas" --extract-audio --audio-format mp3 -o "xxx.mp3"

Does not work as expected. It stores the downloaded file (a WebM audio in this case) as xxx.mp3. It confuses youtube-dl as it depends on the file extension to determine whether a conversion is necessary or not. What you need is:

youtube-dl -v -4 "https://www.youtube.com/watch?v=X19SZARSOas" --extract-audio --audio-format mp3 -o "xxx.%(ext)s"

For the second question, what you need is setting the environment variable LD_LIBRARY_PATH to where libasound.so.2 locates. Usually it's in /usr/local/lib/ or /usr/lib/.

@barisyesilcimen
Copy link
Author

@barisyesilcimen barisyesilcimen commented Dec 15, 2015

You are the man! Thank you very much. i installed ffmpeg again and i used your command. No problem now. How can i send donate for youtube-dl?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Dec 15, 2015

Thanks for helping this project! Here are some information: http://rg3.github.io/youtube-dl/donations.html and #1344.

@yan12125 yan12125 closed this Dec 15, 2015
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
2 participants
You can’t perform that action at this time.