Video Stretching in Ant Media Community Edition

Viewed 599

If I am streaming from android webrtc SDK (provided by antmedia) to community edition of Ant Media, the final video which is being saved, appears stretched (shot in portrait mode of mobile). Check the screenshot of the video. But if I am using the enterprise edition, the problem resolves itself.

Kindly help, how can I prevent the video stretching (while saving) in community edition?

2 Answers

I think this problem happens because Ant Media Server Community Edition resizes the incoming video to 640x480. The origin video's resolution is likely 16:9 so that you see a stretching in the video.

I think you can set the resolution to something 4:3 in Android SDK because community edition uses 640x480 for converting WebRTC stream. Try the followings before you initialize webRTCClient = new WebRTCClient( this,this); in onCreate method

  this.getIntent().putExtra(EXTRA_VIDEO_WIDTH, 640);
  this.getIntent().putExtra(EXTRA_VIDEO_HEIGHT, 480);

Update:

There is an aspect ratio problem in community edition while publishing from Mobile App. The issue is created for that. https://github.com/ant-media/Ant-Media-Server/issues/2492

Fortunately, commits are also pushed to resolve this problem. It'll be available as SNAPSHOT soon and will be available in next release. SNAPSHOTs are here -> https://oss.sonatype.org/#nexus-search;gav~io.antmedia~ant-media-server~~~~kw,versionexpand

Try this in video player activity

<com.google.android.exoplayer2.ui.SimpleExoPlayerView
            android:id="@+id/player_view"
            android:layout_width="match_parent"
            android:layout_gravity="center"
            android:adjustViewBounds="true"
            android:layout_height="match_parent"
            app:resize_mode="fill"
            app:use_controller="false" />
Related