extract audio from streaming
Hi everybody !
I would just know which is the easiest way to record part of audio from a streaming's film that is free in the channel site (Rai italy) thanks in advance |
the easiest way is to simply download the stream and post-process it to extract audio only.
have you tried if you can do this with youtube-dl? |
no I didn't but audacity look works well capturing the audio trace, there is no such a tool from command line ?
|
youtube-dl is a cli tool.
it would help to give an example of what you are trying to capture. a link. and why not stick with audacity if it works for you. |
i have used Streamripper to rip audio streams (IIRC i were using vlc to listen music and ripped it with Streamripper)
Quote:
EDIT2: i missed that you were looking for commandline program, steamripper is _NOT_ commandline. |
Quote:
Ok "This video has been licensed to ShareTV for distribution purposes" Example: https://sharetv.com/shows/days_of_our_lives Days of our Lives Season 54, Episode #99 - S54 E99 Tuesday, February 12, 2019 https://sharetv.com/watch/1465778 Get the video, part that you desire. Code:
#user agent Code:
ffprobe ~/DaysLives.ts Code:
ffmpeg -i DaysLives.ts -c:a copy -c:v copy DaysLives.mp4 Code:
ffmpeg -i DaysLives.ts -vn -c:a copy DaysLives.m4a |
^ with youtube-dl it's just one command:
Code:
youtube-dl -x https://sharetv.com/watch/1465778 |
You are absolutely right @ondoho. I forget about youtube-dl away from youtube.
That works just fine after the video urls are dug out. And the formats available are found. I've got so use to finding the .m3u8 for html5 videos and using curl to concatenate segments to file. Thanks. Code:
list=( Stop and click on a few ads on those pages so the website owner will get some ad revenue. If you appreciate what they are doing and want them to stay in business. The more ads you click on the better. Sorry, I have a hard time feeling sorry for google if all the ads don't get viewed for a youtube video. They have ads from one end of the internet to the other. So does amazon. |
Quote:
what you did up there, you don't need a script for:
|
You are right again. I hadn't been using youtube-dl for anything other
that an occasional utube vid. And had not read man youtube-dl for a good while. Code:
-a, --batch-file FILE Thanks again. This gave me the segment playlist so that one could select which segments to get if you want a partial video. Code:
curl $(youtube-dl -g <url>) -a switch. I think that you could also use regex. The OP said "streaming's film" and "record part of audio" Another way to get that audio would be to dump what's coming through your sound card to file. Make a audio loopback device. Look at modprobe snd-aloop, modifying your ~/.asoundrc then dump the audio to file when you want. Example: Code:
ffmpeg -f alsa -i hw:1,1 -c:a aac -b:a 32k -vn capture.m4a |
thank you for recognizing the awesomeness of youtube-dl.
just one more comment from me: they are running the neverending race against media website maintainers always changing their sites to push us hackers out. updates come in almost daily on their github repo. it is one of the few applications i recommend to use a git version of, over anything that's in your repos. Quote:
to me alsa is like a book with seven seals. |
Quote:
I turned on an older machine that I have, and it has one of those sound devices that is hardware broken on purpose so that you can't capture the stream through it. I think that a lot of sound devices are like that. This is an arch linux box with a nvidia chip for everything. Code:
lspci | grep 'Audio' First make a config file for alsa. ~/.loop_asoundrc Code:
pcm.!default { place and modprobe snd-loop module. Code:
mv ~/.loop_asoundrc ~/.asoundrc && sudo modprobe snd-aloop Code:
ffmpeg -f alsa -i hw:1,1 -c:a libmp3lame -b:a 32k -vn capture.mp3 Code:
mv ~/.asoundrc ~/.loop_asoundrc && sudo modprobe -r snd-aloop capture. And yes, I just checked all of that, it still works fine. It's not the best way to get audio, to reencode something that has already been encoded. If you want you can Code:
ffmpeg -f alsa -i hw:1,1 -c:a pcm_s16le capture.wav Code:
mplayer capture.wav your sound device. |
Thanks a lot for this understandable explanation!
I'll make sure to bookmark it for future reference. But while it is like that, you cannot listen to the sound, correct? |
Yes, you can listen while you are recording. You have to start ffmpeg capturing
before starting the sound stream though, or you get a blank file. To the OP: Web browsers cache video in their cache directory. You can look for it there and then dump the audio from it. For a segmented video it looks like Palemoon dumps the segments in it's cache, look somewhere like: Code:
~/.cache/moonchild productions/pale moon/123456.default/cache/entries/ out of it's cache. Any browser or python script using PyQt4-5, WebEngine, WebKit cache them too. Code:
ffprobe ~/.cache/insp/Cache/f_0000c6 Quote:
And then there is python with it's acres of modules for it. mplayer and mpv will both dump streams to file with -dumpstream and --stream-dump=. ffmpeg will dump a stream to file with -c:copy youtube-dl dumps to file. curl supports regex in a url so that you can continue to dump segments to file with the same connection. With wget you will have to loop on the segments to get them all. mplayer supports playlists with -playlist, you can combine that with -dumpstream -dumpfile. Web browsers have plugins to get the video out of it's cache. Or if you don't like any of that, dump the stream coming through the sound card to file. Happy dumping. |
All times are GMT -5. The time now is 01:58 PM. |