0

I'm converting some old videos to play on my Roku via a dlna server. I'm trying to understand the MP4 container better to optimize conversions. I have an ogm video:

Duration: 01:00:38.22, start: 0.000000, bitrate: 1056 kb/s
Stream #0:0: Video: mpeg4 (XVID / 0x44495658), yuv420p, 576x324 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
Stream #0:1(English): Audio: aac, 48000 Hz, stereo, fltp, 74 kb/s
Stream #0:2(Japanese): Audio: aac, 48000 Hz, stereo, fltp, 73 kb/s
Stream #0:3(English): Subtitle: text

From what I understand, MP4 container can contain MP4 video and aac audio. I used

-c:a copy -c:v copy

And it worked, but the video won't play. Obviously something's wrong. What I don't understand is why, the video looks like it's MP4 and the audio is aac. My guess is it's the Xvid but why?

Thank you. Todd

maddogandnoriko
  • 980
  • 2
  • 13
  • 31
  • Show the complete output: you omitted the line that shows what format ffmpeg detects the input is. – llogan Aug 07 '20 at 22:44
  • It is detected as an ogm...I mentioned that. I just converted the file.istead of copying the streams over. I was just curious as to why it didn't work as XVID appears to be a valid MP4 format...but thanks for... – maddogandnoriko Aug 09 '20 at 22:43

1 Answers1

0

MP4 is only the container but your right MP4 usually contain AAC audio and MPEG4 video. Your input file seems to be mpeg4 Xvid which is a mpeg4 derived codec but might not be supported by Roku.

Try change -c:v copy to -c:v h264 to use a more common MPEG4 based video codec.

Mattias Wadman
  • 11,172
  • 2
  • 42
  • 57
  • Thank you. Probably doesn't make any difference but it didn't play on my Android phone. Actually never made it to Roku. So it does seem like a valid MP4? – maddogandnoriko Aug 07 '20 at 22:33
  • By the way also, I was trying to save time by just copying the streams over since they seemed like valid MP4 streams. – maddogandnoriko Aug 07 '20 at 22:35
  • Yeap understood that. Sorry i don't know if it possible to convert xvid to h264 in any efficient or quality preserving way. If it does not work with standard mp4 i would guess you either have to tweak some mp4 container flags or you have to tweak which h264 profile/level etc that is used. When i googled there seem to be ppl using `-preset slow -profile:v high -level 4 -crf 20` successfully – Mattias Wadman Aug 08 '20 at 10:11
  • So to you, with the info you have, it seems like a valid MP4 file, probably just some compatibility issue with my hardware? Seems possible as I think XVID is not free, royalty fees possibly. – maddogandnoriko Aug 09 '20 at 22:46
  • 1
    Yes think so. If https://developer.roku.com/en-gb/docs/specs/streaming.md is the supported container and codecs then MP4 only supports AVC (aka H264) as MPEG4 codec. – Mattias Wadman Aug 10 '20 at 22:32