0

我正在尝试在 Sony GTV(Android 3.2)上的 VideoView 中播放视频,当 VideoView 加载时出现“播放失败”对话框。ffmpeg -i 在我的视频中的输出是:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'vz569287a41cd749cd8c0692a64d94453c.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 1970-01-01 00:00:00
    encoder         : Lavf53.4.0
  Duration: 00:00:21.96, start: 0.000000, bitrate: 1166 kb/s
    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 576x432 [SAR 1:1 DAR 4:3], 1070 kb/s, 23.99 fps, 23.95 tbr, 479 tbn, 47.90 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 91 kb/s
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : 

根据:https ://developers.google.com/tv/android/docs/gtv_media_formats应支持带有 aac 音频的 h264 基线,但 B 帧支持有限。有没有办法确定基线配置文件是问题所在?

该视频在运行 ICS 的平板电脑上播放良好(我没有可测试的 Honeycomb 平板电脑)。

该视频可在以下网址找到: https ://view.vzaar.com/933735/video

Logcat 输出(来自 Logitech Revue,Sony 设备不可用):

04-26 18:38:36.409: W/AVInfo(1669): av_open_input_file https://view.vzaar.com/933735/video failed -2
04-26 18:38:36.409: I/MediaPlayerService(1669): getPlayerTypeFromProbe: https://view.vzaar.com/933735/video choose player type 0

04-26 18:40:45.325: I/AudioService(193):  AudioFocus  requestAudioFocus() from android.media.AudioManager@67001460com.google.tv.player.PlayerActivity$7@66c75718
04-26 18:40:45.373: D/MediaPlayer(21235): Couldn't open file on client side, trying server side
04-26 18:40:45.373: I/HDMIPassthru(1669): Creating pure ISMD based HDMIPassthruPlayer for Sodaville platform
04-26 18:40:45.373: V/GoogleTVMediaApi(1669): ui_plane_match: 1, display_mode_size_match: 0, tgtW = 1280, tgtH = 720
04-26 18:40:45.373: V/GoogleTVMediaApi(1669): Update Video Params
04-26 18:40:45.373: V/GoogleTVMediaApi(1669): Ideal      : 1204x672 @ (38, 24)
04-26 18:40:45.373: V/GoogleTVMediaApi(1669): Ideal Crop : 0x0 @ (0, 0)
04-26 18:40:45.373: V/GoogleTVMediaApi(1669): Scale      : 1280x720
04-26 18:40:45.373: V/GoogleTVMediaApi(1669): Crop       : 1280x720 @ (0, 0)
04-26 18:40:45.373: V/GoogleTVMediaApi(1669): Src        : 1280x720 @ (0, 0)
04-26 18:40:45.373: V/GoogleTVMediaApi(1669): Dst        : 1280x720 @ (0, 0)
04-26 18:40:45.373: D/HDMIPassthru(1669): Create ISMD_HDMIPassthruPlayer
04-26 18:40:45.377: I/HDMIPassthru(1669): Got init display mode 1280x720p@59.939999   M
04-26 18:40:45.377: I/HDMIPassthru(1669): Set data source: hdmi://localhost?port=2
04-26 18:40:45.385: D/HDMIPassthru(1669): ISMD_HDMIPassthruPlayer prepareAsync (port=2 ignored, no input port control library detected)
04-26 18:40:45.405: D/MediaPlayer(21235): getMetadata
04-26 18:40:45.405: E/MediaPlayerService(1669): getMetadata failed -38
04-26 18:40:45.409: I/AudioService(193):  AudioFocus  requestAudioFocus() from android.media.AudioManager@67001460com.google.tv.player.PlayerActivity$7@66c75718
04-26 18:40:45.409: D/HDMIPassthru(1669): virtual android::status_t fishtank::ISMD_HDMIPassthruPlayer::setVolume(float, float) 1.000000 1.000000
04-26 18:40:45.409: D/HDMIPassthru(1669): android::status_t fishtank::ISMD_HDMIPassthruPlayer::applyVolume() 0
04-26 18:40:45.409: W/HDMIPassthru(1669): Failed to get dev handle for setOutputVolume.
04-26 18:40:45.409: D/HDMIPassthru(1669): ISMD_HDMIPassthruPlayer start
04-26 18:40:45.409: D/GtvResourceManager(137): Allocate resource holder for context 546063a61f 0x9485718 124
04-26 18:40:45.409: D/GtvResourceManager(137): Allocate resource holder for context 546063a61f 0x9487fc0 125
04-26 18:40:45.409: D/IsmdResourceManager(137): resource update 0 for 4 1 0x9485718
04-26 18:40:45.413: D/HDMIPassthru(1669): Action 0 for device type 4 index 1
04-26 18:40:45.417: D/IsmdResourceManager(137): resource update 0 for 1 0 0x9485718
04-26 18:40:45.417: D/HDMIPassthru(1669): Action 0 for device type 1 index 0
04-26 18:40:45.417: D/IsmdResourceManager(137): resource update 0 for 3 1 0x9485718
04-26 18:40:45.417: D/HDMIPassthru(1669): Action 0 for device type 3 index 1
04-26 18:40:45.417: D/IsmdResourceManager(137): resource update 0 for 0 4 0x9485718
04-26 18:40:45.417: D/HDMIPassthru(1669): Action 0 for device type 0 index 0
04-26 18:40:45.417: I/HDMIPassthru(1669): ISMD Passthru player was assigned plane 4
04-26 18:40:45.449: D/HDMIPassthru(1669): android::status_t fishtank::ISMD_HDMIPassthruPlayer::applyVolume() 0
04-26 18:40:45.449: D/HDMIPassthru(1669): virtual android::status_t fishtank::ISMD_HDMIPassthruPlayer::setVolume(float, float) 1.000000 1.000000
04-26 18:40:45.449: D/HDMIPassthru(1669): android::status_t fishtank::ISMD_HDMIPassthruPlayer::applyVolume() 0
04-26 18:40:45.449: I/AudioService(193):  AudioFocus  requestAudioFocus() from android.media.AudioManager@67001460com.google.tv.player.PlayerActivity$7@66c75718
04-26 18:40:45.449: D/HDMIPassthru(1669): virtual android::status_t fishtank::ISMD_HDMIPassthruPlayer::setVolume(float, float) 1.000000 1.000000
04-26 18:40:45.449: D/HDMIPassthru(1669): android::status_t fishtank::ISMD_HDMIPassthruPlayer::applyVolume() 0
04-26 18:40:45.489: I/HDMIPassthru(1669): IsVideoModeChangeNeeded, no change needed, staying in mode 1280x720p@59.94M
04-26 18:40:45.513: I/HDMIPassthru(1669): Audio Mode Change: 0 format 0 channel 0 Hz (0/0) 0 bits/sample.  Signal absent
04-26 18:40:45.513: I/HDMIPassthru(1669): Audio Input: Muted
04-26 18:40:45.513: W/HDMIPassthru(1669): Invalid audio mode received for dev 32. (ismd_res = 0) ss 0 fs 0
04-26 18:40:45.513: I/HDMIPassthru(1669): Audio Input: Un-Muted
04-26 18:40:45.513: I/HDMIPassthru(1669): HDCP status = disabled.
04-26 18:40:45.513: I/HDMIPassthru(1669): handleVideoMute: video not muted
04-26 18:40:45.513: E/HDMIPassthru(1669): HDMI Passthru: Video Renderer Error Event Received
04-26 18:40:45.525: D/MediaDevicesService(282): Media devices in use (acquisition - Logitech01@com.logitech.harmony)
04-26 18:40:45.525: D/MediaDevicesService(282):  - Logitech01@com.logitech.harmony
04-26 18:40:45.537: D/DeviceAcquisitionService(333): ON_BIND: (DeviceId) - Logitech01

我目前没有要测试的 Sony 设备,所以从 Logitech Revue 中取出了这个 logcat。奇怪的是,这里发生了一个更糟糕的问题,因为在设置视频 URI 时,Revue 只会显示黑屏,并且任何键盘输入都会导致 ANR。

我开始播放视频的代码如下所示:

public void onStart() {
    super.onStart();
    MediaController mc = new MediaController(getSlideActivity());
    mc.setAnchorView(mVideo);
    mVideo.setMediaController(mc);
    mVideo.setVideoURI(Uri.parse("https://view.vzaar.com/933735/video"));
    mVideo.start();
}

我将视频播放代码修改为在 AsyncTask 中,它不再在 Revue 上崩溃(尽管视频不播放):

new AsyncTask<Void, Void, Void>() {
        @Override
    protected Void doInBackground(Void... params) {
        Looper.prepare();   
        MediaController mc = new MediaController(getSlideActivity());
        mc.setAnchorView(mVideo);
        mVideo.setMediaController(mc);
        mVideo.setVideoURI(Uri.parse(mSlide.getMedia()));
        Looper.loop();
        return null;
    }

    @Override
    protected void onPostExecute(Void v) {
        mVideo.start();
    }
}.execute();

在向上面的 AsyncTask 添加一些日志记录语句后,我发现它永远不会超过调用“setVideoURI”的行。

4

1 回答 1

0

Google TV 上的 VideoView 与标准 Android 上的不同,因此根据 Les Vogel (Google TV DevRel),URI 需要直接指向文件。

于 2012-04-30T23:53:32.623 回答