zencoder-php icon indicating copy to clipboard operation
zencoder-php copied to clipboard

Unable to json_decode notification from zencoder-fetcher

Open phommata opened this issue 9 years ago • 2 comments
trafficstars

I am running zencoder-fetcher to test and develop locally. I have found that json_decode fails to handle the notification post. I receive the error message: Fail! I receive the notification post from zencoder-fetcher, trims, but fails once it is passed through json_decode. This is the notification data received from zencoder-fetcher that it is failing to json_decode:

{ "job":{ "id":000000000, "state":"finished", "created_at":"2016-04-14T06:48:17Z", "updated_at":"2016-04-14T06:48:49Z", "submitted_at":"2016-04-14T06:48:17Z", "pass_through":null, "test":false }, "input":{ "id":000000000, "format":"mpeg4", "frame_rate":29.97, "duration_in_ms":15022, "audio_sample_rate":44100, "audio_bitrate_in_kbps":64, "audio_codec":"aac", "height":640, "width":640, "file_size_in_bytes":1067153, "video_codec":"h264", "total_bitrate_in_kbps":564, "channels":"1", "video_bitrate_in_kbps":500, "state":"finished", "md5_checksum":null }, "output":{ "id":000000000, "url":"http://sc-media-assets.s3.amazonaws.com/file", "label":"webm-720", "state":"finished", "format":"webm", "type":"standard", "frame_rate":29.97, "duration_in_ms":15024, "audio_sample_rate":44100, "audio_bitrate_in_kbps":80, "audio_codec":"vorbis", "height":640, "width":640, "file_size_in_bytes":1319868, "video_codec":"vp8", "total_bitrate_in_kbps":666, "channels":"1", "video_bitrate_in_kbps":586, "fragment_duration_in_ms":null, "rfc_6381_video_codec":null, "rfc_6381_audio_codec":null, "md5_checksum":null } }{ "job":{ "id":000000000, "state":"processing", "created_at":"2016-04-14T06:48:17Z", "updated_at":"2016-04-14T06:48:18Z", "submitted_at":"2016-04-14T06:48:17Z", "pass_through":null, "test":false }, "input":{ "id":000000000, "format":"mpeg4", "frame_rate":29.97, "duration_in_ms":15022, "audio_sample_rate":44100, "audio_bitrate_in_kbps":64, "audio_codec":"aac", "height":640, "width":640, "file_size_in_bytes":1067153, "video_codec":"h264", "total_bitrate_in_kbps":564, "channels":"1", "video_bitrate_in_kbps":500, "state":"finished", "md5_checksum":null }, "output":{ "id":000000000, "url":"http://sc-media-assets.s3.amazonaws.com/file", "label":"webm-360", "state":"finished", "format":"webm", "type":"standard", "frame_rate":29.97, "duration_in_ms":15024, "audio_sample_rate":44100, "audio_bitrate_in_kbps":80, "audio_codec":"vorbis", "height":360, "width":360, "file_size_in_bytes":829439, "video_codec":"vp8", "total_bitrate_in_kbps":415, "channels":"1", "video_bitrate_in_kbps":335, "fragment_duration_in_ms":null, "rfc_6381_video_codec":null, "rfc_6381_audio_codec":null, "md5_checksum":null } }

phommata avatar Apr 16 '16 19:04 phommata

Can you reproduce it? @phommata

passionInfinite avatar Sep 03 '17 12:09 passionInfinite

There are two different jobs in that JSON data. It looks like you're getting an array of jobs and mashing them into one string before trying to parse as JSON.

jgreer avatar Sep 28 '17 14:09 jgreer