Stream conversion on the FLY

Steam recording with RTMPDump or FFmpeg.
Post Reply
ironhide707
Posts: 6
Joined: Tue May 06, 2014 2:40 pm

Stream conversion on the FLY

Post by ironhide707 » Tue May 06, 2014 2:46 pm

Hey all,
As the title suggests, i need to know that how can i convert a stream to a required format. My application structure is like this:

1- I have a parser which parses a youtube video download response which in turn provides me with different stream URLS.
2 - After that i want to grab that input stream and put it inside a container which could flv or 3GP.

I read somewhere that FFMPEG has the option of using HTTP protocol for getting streams so i did something like this:

ffmpeg -i http:http:http://r5---sn-vgqs7nes.googlevideo.com/video
playback?ip=64.40.157.23&id=o-AG_1GIFb3VGWNFpeKSvl96ISO8L14Oeu404V4ffP9Sbt&sourc
e=youtube&ratebypass=yes&expire=1399401500&signature=EE6D7AA895CF205985B4509EAF5
4D1C0EFEB0B31.0F5876AAED4AFFB2A3D1ED26610828EF1A91A86C&key=yt5&ipbits=0&mt=13993
78492&ms=au&mws=yes&sver=3&upn=DZLDM0c1WLU&fexp=937426%2C911508%2C945025%2C92172
6%2C916625%2C937417%2C913434%2C936923%2C945044&sparams=id%2Cip%2Cipbits%2Citag%2
Cratebypass%2Csource%2Cupn%2Cexpire&mv=m&itag=22&signature=EE6D7AA895CF205985B45
09EAF54D1C0EFEB0B31.0F5876AAED4AFFB2A3D1ED26610828EF1A91A86C%26key%3Dyt5%26ipbit
s%3D0%26mt%3D1399378492%26ms%3Dau%26mws%3Dyes%26sver%3D3%26upn%3DDZLDM0c1WLU%26f
exp%3D937426%252C911508%252C945025%252C921726%252C916625%252C937417%252C913434%2
52C936923%252C945044%26sparams%3Did%252Cip%252Cipbits%252Citag%252Cratebypass%25
2Csource%252Cupn%252Cexpire%26mv%3Dm%26itag%3D22


But it gives me this error:
[tcp @ 0200bc60] Port missing in uri
http:http:http://r5---sn-vgqs7nes.googlevideo.com ... .40.157.23:
Input/output error


Please it would be very helpful for me if someone can help me on this.

Thanks.

svnpenn
Posts: 263
Joined: Tue Nov 01, 2011 12:19 am

Re: Stream conversion on the FLY

Post by svnpenn » Tue May 06, 2014 10:18 pm

This seems to do it

Code: Select all

youtube-dl -g wsVNgB_DS_g | xargs -i ffmpeg -i {} outfile.flv

ironhide707
Posts: 6
Joined: Tue May 06, 2014 2:40 pm

Re: Stream conversion on the FLY

Post by ironhide707 » Thu May 08, 2014 11:28 am

Yup, got it to work :) thanks svnpenn. I have another question though, i am actually doing all this using PHP scripts, i just wanted to know one thing, is it possible to send the converted stream to a client using php scripts OR more better using FFMPEG? if anyone has any sort of info on this lemme know.

heklind
Posts: 4
Joined: Mon Jun 09, 2014 10:48 am

Re: Stream conversion on the FLY

Post by heklind » Mon Jun 09, 2014 10:59 am

I'm not sure what do you mean. ffmpeg download, then save transcoded video file to the destination you provided. Now you can play it whathever you like (you can use scripts and whatever you want, to play file from the destination you provided in ffmpeg command line).

Post Reply