<div dir="ltr">Copy paste from our video_frame.erl:<div><br></div><div><br></div><div>send_frame(Stream, #video_frame{content = Content, codec = Codec, flavor = Flavor, dts = DTS} = Frame, SourceTag) when is_pid(Stream) -><br> Frame1 = case SourceTag of<br>  undefined -> Frame;<br>  _ -> Frame#video_frame{source = SourceTag}<br> end,<br> try gen_server:call(Stream, Frame1)<br> catch<br>  exit:{normal, _} -><br>   {error, stopped};<br>  exit:{noproc, _} -><br>   {error, stopped};<br>  exit:{shutdown, _} -><br>   {error, stopped};<br>  exit:{timeout, _}:Stack -><br>   Dict = case process_info(Stream, dictionary) of<br>    {dictionary, Dict_} -> Dict_;<br>    undefined -> []<br>   end,<br>   RemoteStack = process_info(Stream, current_stacktrace),<br>   Name = case proplists:get_value(name, Dict, <<"dead stream">>) of<br>    N when is_binary(N) -> N;<br>    N when is_atom(N) -> N;<br>    N -> iolist_to_binary(io_lib:format("~p", [N]))<br>   end,<br>   Status = proplists:get_value(status, Dict),<br>   case Status of<br>    S when S == starting_transcoder -> ok;<br>    _ -> events:error("failed to send frame ~p,~p,~p,~p, source_tag=~p to ~s (~p) in status ~p\n~p\nremote stack:\n~p", [<br>             Content, Codec, Flavor, round(DTS), Frame1#video_frame.source,<br>             Name, Stream, Status, Stack, RemoteStack])<br>   end,<br>   % [io:format("~10.. s: ~p~n", [K,V]) || {K,V} <- process_info(Stream)]<br>   {error, timeout}<br> end.<br><br></div><div><br></div><div><br></div><div>this code is helping us for years. You should remove video specific stuff.</div></div>