A simple trick to play AVI XviD/DivX videos on Samsung TV without re-encoding

pachura

Member
Hello,

I've recently bought Samsung QLED Q95T (2020 EU model, currently on firmware 1460) and I'm quite happy with it!

One of the first things I tried on my new TV was checking the playback of different video files. I was aware it does not support DTS audio (nor TrueHD), so this was expected; however, I was quite disappointed it does not play my AVI XviD/DivX files.

I'm aware this format is getting quite old now, but it is still somewhat popular, and I still have plenty of such files (kids' cartoons etc.). And what is especially strange, Samsung's built-in media player still supports such prehistoric codecs as MPEG-1 and MotionJPEG, and even proprietary ones as FLV (Flash Video) and Microsoft's WMV...

A commonly suggested solution on the web is to re-encode your XviD videos into MP4s containing AVC (H.264) video inside. While this surely works, it involves re-compressing already compressed video - so it further degrades its quality. Also, takes time - not only to re-encode, but to choose appropriate encoding parameters...

So, I started experimenting, and I found out that simply changing codec ID (also known as FourCC) in the AVI file from XVID (or, less common DIVX or DX50) into FMP4 fixes the problem!

(For videos encoded with the oldest DivX version, the FourCC is DIV3, and has to be changed to MP43).

If you only have a few AVI files to fix, you can use AVI FourCC Code Changer 1.00. For batch processing, you can use the following FFmpeg command line:

Code:
ffmpeg -i source.avi -c copy -vtag FMP4 source_fixed.avi

While applying this fix, you can at the same time correct another common problem with XviD videos known as Packed bitstream or Packed B-frames. In general, it is about increasing video file's compatibility by reorganizing it a bit. Here's the full commandline to apply both fixes:

Code:
ffmpeg -i source.avi -c copy -bsf:v mpeg4_unpack_bframes -vtag FMP4 source_fixed.avi
 

Pr0xiMUS

Novice Member
Thanks for great tip. It is really a shame that Samsung remove Xvid/DivX playback from new TV's, it just doesn't make any sense ...

Anyhow, here is a powershell script you can put in root of USB stick and it will fix all AVI files on whole USB.
 

Quijibo

Novice Member
Thanks, this is great, though I have a NAS with a few GB of files to update now. Will hopefully be able to use the PowerShell.

I've only tested with a few files using this code.
ffmpeg -i source.avi -c copy -bsf:v mpeg4_unpack_bframes -vtag FMP4 source_fixed.avi
(Using the code without fixing the B-Frames fix made the files a bit choppy/jumpy.)

I got this warning message - is it something to worry about in future or is there a way to fix it now?
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
 

halfbaked

Standard Member
Like me, if you have thousands of movies in avi format, it's not an option to convert all of them.
So I found a workaround. If you have an old laptop, connect your usb drive with movies on it to the laptop. with the latest version of vlc media player on the laptop, play the movie. go to the playback menu, renderer and cast it to your tv over home wifi. I have a chromecast device connected to my tv as well. problem solved.
and to make your life even easier by controlling your laptop from a smartphone, get an app called splashtop on your smartphone and the pc version of it on the laptop. login to both versions of splashtop and you can control your laptop from your phone = play any movie on your laptop and cast it to your tv. up yours samsung!
 

mysiakm

Novice Member
I registered to this forum just to say big THANK YOU to the OP @pachura. I've just purchased Samsung QE50Q65A and when I tried to play my favorite old TV shows, none of them was working. Took a while to realize that it's because Samsung models from 2021 don't play DivX/Xvid (what a ridiculous decision). I was ready to send the TV back, but then I stumbled upon this post and the FourCC trick works wonders.

I processed about 3000 avi files in just a few minutes with FourCC changer app - it uses "search and replace" approach, so I just put all my files in the queue (search in Total commander for "*.avi" and drag&drop the result) and went through them a few times, altering the match criteria each time (DIVX/FMP4; XVID/FMP4; DIV5/FMP4; DIV3/MP43). Now all the files play just fine.

So..thanks again! :)
 

VA1DER

Member
It's not that the new Samsung TVs don't support MPEG4-part 2, they do and quite well. It's that they have limited support for AVI at all and there have been legal issues for commercial entities to support DivX 4CC codes due to trademark problems. They don't want to pay DivX royalties and I don't blame them. Why XviD got caught in that I have no idea.

Whatever you think about transcoding, fair enough, but you should at the very least remux your content. A 4CC change is really just a bandaid. Next time around AVI support will just go away. It really is a terrible file format. Better to use mp4 or mkv. Remuxing is relatively painless and far faster than transcoding.
 

mysiakm

Novice Member
Remuxing doesn't fix anything (it was the first thing I tried). AVI isn't a problem at all, it's codec - as soon as the TV tries to play DivX/Xvid, it fails to do so. However thumbnails and other info loads properly. With changed 4CC, all AVI files play properly.

Btw. it seems that Samsung and Divx renewed their license agreement, but I couldn't get any info from Samsung support if it concerns already released TV models - Samsung Electronics Renews Licensing Agreement with DivX for its Consumer Electronics Devices
 

VA1DER

Member
Remuxing doesn't fix anything (it was the first thing I tried). AVI isn't a problem at all, it's codec - as soon as the TV tries to play DivX/Xvid, it fails to do so. However thumbnails and other info loads properly. With changed 4CC, all AVI files play properly.

My bad, I thought ffmpeg changed the vtag for ASP codecs on a remux to .mp4 automatically, but I see now that it doesn't. I think it might have used to. In any case, I suppose the remux doesn't matter much for you personally, though it will still give better compatibility with other devices. My ROKU devices, for example, have relegated all AVI to the dustbin.

To remux and retag the command is, of course:
Code:
$ ffmpeg -y -i OLD.avi -c copy -vtag FMP4 NEW.mp4

Other vtags that might work:
  • SEDG (Identifies Samsung's own MPEG4 codec)
  • MPG4/MP42/MP43 (Identifies Microsoft's MPEG 4 v1, v2, and v3 codecs respectively)
I would actually suggest sticking with one of the Microsoft ones if they work on your TV, that will have the widest compatibility with other devices without re-encoding.

Btw. it seems that Samsung and Divx renewed their license agreement, but I couldn't get any info from Samsung support if it concerns already released TV models - Samsung Electronics Renews Licensing Agreement with DivX for its Consumer Electronics Devices

Yes, I had heard that. That is a DivX press release, not a Samsung one though. My understanding is that the old deal was a flat rate Samsung paid DivX for unlimited distribution, and word on the street is that the new one is based on per-unit. I suspect Samsung told DivX that they weren't renewing, and since DivX as a company is becoming increasingly irrelevant they begged for a face-saving renewal that would let them announce that a deal was in place without much (if any) money actually having to change hands. After all, if Samsung doesn't put DivX into any of their units they pay nothing.

I myself recently bit the bullet and re-encoded all my old MPEG4 ASP stuff to HEVC. Any computer with a recent-ish Nvidia video card will do hardware encoding and it transcodes on my two -year old Nvidia card at up to 30+ times playback speed.

Code:
$ ffmpeg -y -i "OLDavi" -c:v hevc_nvenc -2pass true -b:v 800k -minrate 0 -maxrate 1600k -bufsize 60000k -preset slow -c:a aac -b:a 96k "NEW.mp4"

BTW it's not a true two-pass. The Nvidia encoder just looks ahead a bunch of frames for better VBR selection. But I get videos basically indistinguishable from the original at 2/3rds the original ASP video's bitrate. You can do the same thing with the built-in Intel video card to accelerate encoding too, just not quite as fast. Just change hevc_nvenc to hevc_qsv.

Just food for thought.
 

parvares

Novice Member
Please note: AVI DivX4 has to be set to DivX (not DIV4) and changed to FMP4.
 
Last edited:

michoopro

Novice Member
Thanks for great tip. It is really a shame that Samsung remove Xvid/DivX playback from new TV's, it just doesn't make any sense ...

Anyhow, here is a powershell script you can put in root of USB stick and it will fix all AVI files on whole USB.

Will this script save the original file modification date? I have thousands AVI files from years 2001-2021, I need to repair them but with original modified date - it's important for me.
 

The latest video from AVForums

Panasonic LZ2000, LZ1500 & LZ980 Hands-on Launch Event | No QD-OLED for 2022, new 77-inch for LZ2000
Subscribe to our YouTube channel
Support AVForums with Patreon

Top Bottom