Skip to main content

Posts

Showing posts with the label Tutorial

FFmpeg stack two videos and merge audios

FFmpeg -i rtmp://192.168.137.1:1935/live/xyz -i rtmp://192.168.137.1:1935/live/abc -filter_complex "[0:v][1:v]vstack=inputs=2[v];[0:a][1:a]amerge=inputs=2[a]" -map "[v]" -map "[a]" -an -f flv rtmp://192.168.137.1:1935/live/qwe The above command stacks video from two streams and merges audios into one. I tried following commands before I came up with above.  ffmpeg -i rtmp://192.168.137.1:1935/live/xyz -i rtmp://192.168.137.1:1935/live/abc -filter_complex "[0:a][1:a]amix[a]" -map 0:v -map "[a]" -c:v copy -f flv rtmp://192.168.137.1:1935/live/qwe ffmpeg -i rtmp://192.168.137.1:1935/live/xyz -i rtmp://192.168.137.1:1935/live/abc -filter_complex "[0v][1v]xstack=inputs=2:layout=0_0|1920_0[stacked]" -map "[stacked]" -preset ultrafast -vcodec libx264 -tune zerolatency -an -f flv rtmp://192.168.137.1:1935/live/qwe ffmpeg -i rtmp://192.168.137.1:1935/live/xyz -i rtmp://192.168.137.1:1935/live/abc -filter_complex "[0v][1v...

How to drag and drop item in Unity3D

  For dragging and dropping to work we will need to first grab the Game Object and ensure while the Game Object remains grabbed it's position reciprocates the mouse position. This will work fine for not only PC bug mobile devices as well. First define GameObject which we will be dragging. public GameObject selectedPiece; Now inside Update method we will give reference to touched/clicked object and while there is a reference available to an game object(selectedPiece;) we will move that object to mouse position. When the reference is remove, object won't move therefore dropped. void Update(){ RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero); if (Input.GetMouseButtonDown(0)){ if(hit.transform != null)             {                 if (hit.transform.CompareTag("PIECE"))                 {     ...