How to enabling transcoding

Denis Vasiliev

New Member
Hello,

I made a new request as a fork from 14073 to see how we can enable transcoding on the fly.

Our problem is that the multi-record does not support the v8 video codec, and therefore your team recommended for us to use transcoding. The first tests show that transcoding is not performed at all on the server, could you confirm that it is possible to transcode a video stream with the vp8 codec to h.264 on the fly when using Android/IOS SDK?

Here is our config where we added disable_streaming_proxy=true, which should have led to the forced start of transcoding

Code:
#server ip
ip                     =************
ip_local               =10.20.31.137

#webrtc ports range
media_port_from        =31001
media_port_to          =32000

#codecs
codecs                   =opus,alaw,ulaw,g729,speex16,g722,mpeg4-generic,telephone-event,h264,flv,mpv
codecs_exclude_sip       =mpeg4-generic,flv,mpv
codecs_exclude_streaming =flv,telephone-event
codecs_exclude_sip_rtmp  =opus,g729,g722,mpeg4-generic,mpv

#websocket ports
ws.port                 =8080
wss.port                =8443

client_mode=false

rtc_ice_add_local_component=true

load_balancing_enabled=false

cdn_enabled=true
cdn_nodes_resolve_ip=false
cdn_point_of_entry=*************
cdn_ip=10.20.31.137
cdn_role=origin
cdn_nodes_timeout=180

wcs_agent_ssl = true
wcs_agent_session_timeout=5000
wcs_activity_timer_timeout=5000

rtmp_activity_timer_timeout=15000
rtp_activity_timeout=15
rtsp_activity_timer_timeout=15000
rtmp_transponder_stream_name_prefix=
rtmp_transponder_full_url=true
rtmp_flash_ver_subscriber=LNX 76.219.189.0
rtmp_transponder_send_metadata=true


mixer_auto_start=false
#mixer_layout_class=com.flashphoner.mixerlayout.BattleLayout
mixer_video_width=480
mixer_video_height=1280
mixer_text_display_room=false
mixer_text_autoscale=false
mixer_display_stream_name=false

record_streams=true
record_mixer_streams=true
record_flash_published_streams=true
stream_record_policy_template={streamName}-{startTimeMillis}-{endTimeMillis}-{duration}-{mediaSessionId}
exclude_record_name_characters=:.,/#
media_dir=/usr/local/FlashphonerWebCallServer/media
record_dir=/usr/local/FlashphonerWebCallServer/records

cdn_force_version=2.3

custom_stats_script=custom_stats.sh

rest_hook_send_hash=true
rest_hook_secret_key=***********

transcoding_disabled=false

decoder_priority=OPENH264,FF
encoder_priority=OPENH264,FF
periodic_fir_request=true
periodic_fir_request_interval=1000

#client_log_level=DEBUG

#enable_extended_logging=true
#client_dump_level=2

on_record_hook_script=/usr/local/FlashphonerWebCallServer/bin/record_hook.sh

mixer_voice_activity=false

#decoded_pcm_interceptor=com.flashphoner.sdk.media.DecodedPcmInterceptor
record=/usr/local/FlashphonerWebCallServer/records

record_audio_buffer_max_size=100
record_fdk_aac_bitrate_mode=0

disable_streaming_proxy=true
 

Max

Administrator
Staff member
When you set
disable_streaming_proxy=true
Transcoding will be started upon playback only.
The multi-recorder will not trigger transcoding automatically.

Try to launch transcoding manually using REST API as described in the docs.

Option1. REST API.

Make a bash script using REST API which launches transcoding for new publishing streams.

Code:
while (true) {

   sleep 3
   #parse streams here to filter new streams in "publishing" state
   /stream/find_all
    #launch transcoder for filtered streams
   /transcoder/startup

}

Option 2. REST Hook and REST API.

Do REST Hook

/StreamStatusEvent

WCS will send /StreamStatusEvent {"status":"PUBLISHING"} REST request to your backend (php, node.js, etc).
Your backend should launch transcoding using REST API

Code:
#launch transcoder for filtered streams
/transcoder/startup
 
Top