Post Sat Jun 06, 2020 2:00 am

Universal ffmpeg parameters?

I've had a lot of problems streaming to a PS3. I figured it wasn't worth trying to understand why or waste anyone's time with it; I'd just reencode everything for the PS3 and that would be that. The PS3 seems happiest with mp4s with h264/aac. With any other format, even if the PS3 doesn't choke, it won't handle forward/reverse well. So I use a very simple script, and reencode everything to my Serviio share.

"ffmpeg -i \"$infile\" -y -vcodec libx264 -acodec aac \"$outfile\""

I've used that for maybe a year or more with no problems at all. Then a couple of weeks ago I tried to reencode an anime that was an avi. The operation seemed to work fine (and I've done it often with other anime avis), but the PS3 claims "the data is corrupted." I've poked around at the mp4 with ffprobe and see nothing radically different from any of the functioning videos. (Different bitrate/framerate/image size, but all matching or within bounds of other working videos).

Then a few days ago I reencoded some 1080 mkvs with the same script. This time I was watching them on a LG 4K TV with its own DLNA client which has worked well so far. It played the first mp4, then failed with the next two. It's (mostly) happy with the original mkvs, which the PS3 won't touch.

What I'd like to do is refine my script to give explicit encoding parameters that will work everywhere. Is that wishful thinking? Or are there particular parameters that are likely to work in most cases?