ffmpeg with rtmp and parameters with spaces
hey,
i've been trying to tackle the implementation of a justin/twitch.tv plugin from knowledge i acquired from writing a script that creates a command line to pipe output from rtmpdump to vlc. the latter works fine.
i'm having an issue with the syntax of the ffmpeg call though: ffmpeg takes information from rtmp streams with this syntax:
now, all of the parameters are known to me. the problem is the makeup of the jtv token: it's a JSON string that CANNOT be passed any differently than the way it is retrieved from the server. so no taking out spaces or anything. it looks similar to this:
it includes the following: spaces and double quotation marks. using single quotation marks ( ' ) for values is not valid JSON.
as you can see, i've already escaped the quotation marks as they'd interfer with the quotation mark of the command line. the problem is that i don't know how to encapsulate that string so that it reads jtv="<jtv-string>", but that all three sets of quotation mark levels are still retained. like this (aside from the fact that this would obviously be incorrect):
i need the additional level of quotation marks because there are spaces in that jtv token, which will cause ffmpeg to interpret them as additional parameters to the rtmp uri. i've tried single quotation marks ( ' ) to encapsulate the jtv string, but that gave me the same error.
any ideas?
i've been trying to tackle the implementation of a justin/twitch.tv plugin from knowledge i acquired from writing a script that creates a command line to pipe output from rtmpdump to vlc. the latter works fine.
i'm having an issue with the syntax of the ffmpeg call though: ffmpeg takes information from rtmp streams with this syntax:
now, all of the parameters are known to me. the problem is the makeup of the jtv token: it's a JSON string that CANNOT be passed any differently than the way it is retrieved from the server. so no taking out spaces or anything. it looks similar to this:
- Code:
52544314439a0c88d583f06f727bb1339965fbc2:{\"swfDomains\": [\"justin.tv\", \"jtvx.com\", \"xarth.com\", \"twitchtv.com\", \"twitch.tv\", \"newjtv.com\", \"jtvnw.net\", \"wdtinc.com\", \"imapweather.com\", \"facebook.com\", \"starcrafting.com\"], \"streamName\": \"jtv_cRCoqV_xjommpbt_\", \"expiration\": 1359813036.9245951, \"server\": \"video14-2.ams01\"}
it includes the following: spaces and double quotation marks. using single quotation marks ( ' ) for values is not valid JSON.
as you can see, i've already escaped the quotation marks as they'd interfer with the quotation mark of the command line. the problem is that i don't know how to encapsulate that string so that it reads jtv="<jtv-string>", but that all three sets of quotation mark levels are still retained. like this (aside from the fact that this would obviously be incorrect):
i need the additional level of quotation marks because there are spaces in that jtv token, which will cause ffmpeg to interpret them as additional parameters to the rtmp uri. i've tried single quotation marks ( ' ) to encapsulate the jtv string, but that gave me the same error.
any ideas?