Video plays ~2x as fast as audio on Android app ONLY

Server Version#: 4.43.1
Player Version#: 8.6.0.20351

I found some AVI files I ripped from DVD a long time ago and added them to my Plex server. Some of them (and only some) have a weird problem playing in the Android app: the video plays faster (2x?) than it was recorded. Audio plays fine. All files that exhibit the problem are encoded as MPEG4 in AVI containers. All files that exhibit the problem play properly in the web browser and on the Roku player.

Does anyone have any thoughts on what might be going on or how to resolve the problem?

Can you provide the XML from one of these files? If you have mediainfo, a full output from that could be helpful too.

I’m not sure what ā€œprovide the XMLā€ means, but I’ll paste mediainfo output at the bottom of this reply. Regardless, I think I may have solved the problem.

While experimenting with re-encoding the files into MKV containers with ffmpeg, I saw the following error messages:

  • [matroska @ 0x564cdaadcd00] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
  • [matroska @ 0x564cdaadcd00] Can’t write packet with unknown timestamp
    av_interleaved_write_frame(): Invalid argument
  • [mpeg4 @ 0x564a37a23440] Video uses a non-standard and wasteful way to store B-frames (ā€˜packed B-frames’). Consider using the mpeg4_unpack_bframes bitstream filter without encoding but stream copy to fix it.

The first two error messages are resolved by adding these parameters to the ffmpeg command: -fflags +genpts

The last error is resolved by copying the video stream instead of transcoding and adding this parameter: -bsf:v mpeg4_unpack_bframes

The the whole command to resolve the problem by remuxing the files is: ffmpeg -fflags +genpts -i FILE.avi -map 0 -c copy -bsf:v mpeg4_unpack_bframes FILE.mkv

As promised, here’s the mediainfo output from one of the problem files. If you see anything in there that would indicate I should have used other ffmpeg parameters while re-muxing, I’d appreciate hearing back. Thanks.

General
Complete name                            : JAG - S01E01-02 - A New Life.avi
Format                                   : AVI
Format/Info                              : Audio Video Interleave
File size                                : 700 MiB
Duration                                 : 1 h 32 min
Overall bit rate                         : 1 055 kb/s
Writing application                      : VirtualDubMod 1.5.10.2 (build 2540/release)
Writing library                          : VirtualDubMod build 2540/release

Video
ID                                       : 0
Format                                   : MPEG-4 Visual
Format profile                           : Advanced Simple@L5
Format settings                          : BVOP1
Format settings, BVOP                    : 1
Format settings, QPel                    : No
Format settings, GMC                     : No warppoints
Format settings, Matrix                  : Default (MPEG)
Muxing mode                              : Packed bitstream
Codec ID                                 : XVID
Codec ID/Hint                            : XviD
Duration                                 : 1 h 32 min
Bit rate                                 : 856 kb/s
Width                                    : 576 pixels
Height                                   : 432 pixels
Display aspect ratio                     : 4:3
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.143
Stream size                              : 568 MiB (81%)
Writing library                          : XviD 1.1.0 (UTC 2005-11-22)

Audio
ID                                       : 1
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Codec ID                                 : 2000
Duration                                 : 1 h 32 min
Bit rate mode                            : Constant
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 127 MiB (18%)
Alignment                                : Split accross interleaves
Interleave, duration                     : 83  ms (2.00 video frames)
Interleave, preload duration             : 500  ms
Service kind                             : Complete Main
1 Like

XVID … shiver.

This was a common issue back when XVID/DIVX were popular. The encoders weren’t that great and often took shortcuts leaving stuff out that they didn’t think were necessary. Now that they are no longer popular, making new players backwards compatible can sometimes be a pain.

Glad you found a fix with just a remux.

Edit - ā€œVirtualDubModā€. Wow haven’t seen that in a while. Wasn’t that from like 15 years ago. Personally, I would re-encode these to h264.

1 Like

Yeah, I found these on an old hard drive when I was getting ready to dispose of it. One family member loves that show, so I thought, ā€œwhy not?ā€ Turned out to be a lot more effort than expected, but she’s happy now.

I thought about re-encoding, but I’m not sure what I’d gain. I don’t want to lose quality. These old recordings are already fuzzy enough when played on a modern television. Are you thinking that a re-encode with libx264 would kind of future-proof the files? Or is there some other advantage?

Yes. And also to avoid issues from just using divx/xvid.

Thanks. I’ll empty my server’s bit bucket and set it to doing that. :slight_smile:

I guess I should look for other XVID/DIVX encoded files too. Thank god for bash scripts.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.