How to determine the codec used in mp4 file

*nix specific usage questions
draca
Blank Cone
Blank Cone
Posts: 19
Joined: 05 Aug 2012 21:46

How to determine the codec used in mp4 file

Postby draca » 25 Aug 2012 23:30

I have an mp4 file that will not play on my linux VLC (it stutters & freezes) but it plays fine on windows. A different mp4 plays fine in linux. So the problem must be in the linux vlc support for the codec of this particular file. How can I find out what codec is used in this mp4 file?

bat999
Cone that earned his stripes
Cone that earned his stripes
Posts: 200
Joined: 19 Dec 2007 02:35

Re: How to determine the codec used in mp4 file

Postby bat999 » 25 Aug 2012 23:46

How can I find out what codec is used in this mp4 file?
Use MediaInfo ---> http://mediainfo.sourceforge.net/en

draca
Blank Cone
Blank Cone
Posts: 19
Joined: 05 Aug 2012 21:46

Re: How to determine the codec used in mp4 file

Postby draca » 26 Aug 2012 02:17

Great! Ok so I ran mediainfo on each of the 2 files. Now how do I identify the codec that is not working right on my linux machine?

Here is the output of mediainfo: http://i653.photobucket.com/albums/uu25 ... odbad2.jpg

bat999
Cone that earned his stripes
Cone that earned his stripes
Posts: 200
Joined: 19 Dec 2007 02:35

Re: How to determine the codec used in mp4 file

Postby bat999 » 26 Aug 2012 02:43

Now how do I identify the codec that is not working right on my linux machine?
Hi
It looks like both those files use the same codecs. 8)

"AVC" means MPEG-4 Part 10. For example, x264.
(If you use MediaInfo View > Text it shows more detail).

The two files are different Width/Height with different bitrates (Kbps) and framerates (fps) and they have different level settings (L3.0/L4.0).

draca
Blank Cone
Blank Cone
Posts: 19
Joined: 05 Aug 2012 21:46

Re: How to determine the codec used in mp4 file

Postby draca » 26 Aug 2012 03:33

Thanks for the reply. I compared the text output of the 2 files and saw other differences such as the codec ID and format and encoding settings (the file that won't play is AVI (not mpeg-4), H264 not avcl, and has encoding setting of 12 threads not 6.

The ultimate question is what can I do to get the broken file to play on linux vlc? I've tried changing some settings to no avail. Do I need to update a video codec or do I need to find a magic setting that needs to be tweaked?

Here is the text output:

file that doesn't play:

Code: Select all

General Complete name : C:\m\titanictest.mp4 Format : AVI Format/Info : Audio Video Interleave File size : 3.26 MiB Duration : 20s 360ms Overall bit rate : 1 345 Kbps Video ID : 0 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4.0 Format settings, CABAC : Yes Format settings, ReFrames : 5 frames Codec ID : H264 Duration : 20s 360ms Bit rate : 1 267 Kbps Nominal bit rate : 1 545 Kbps Width : 1 920 pixels Height : 836 pixels Display aspect ratio : 2.25:1 Frame rate : 25.000 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.032 Stream size : 3.08 MiB (94%) Writing library : x264 core 120 r2164 da19765 Encoding settings : cabac=1 / ref=5 / deblock=1:-2:-1 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=1545 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00
file that does play:

Code: Select all

General Complete name : C:\m\Barbie in a Mermaid Tale 2 2012 DVDRip Srkfan Silver RG\Barbie in a Mermaid Tale 2 2012 DVDRip Srkfan Silver RG.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom File size : 210 MiB Duration : 1h 12mn Overall bit rate mode : Variable Overall bit rate : 402 Kbps Encoded date : UTC 2012-03-09 10:01:19 Tagged date : UTC 2012-03-09 10:01:19 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L3.0 Format settings, CABAC : Yes Format settings, ReFrames : 5 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 1h 12mn Bit rate : 369 Kbps Maximum bit rate : 1 065 Kbps Width : 720 pixels Height : 400 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 23.976 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.053 Stream size : 192 MiB (92%) Title : àïo Writing library : x264 core 120 r2164 da19765 Encoding settings : cabac=1 / ref=5 / deblock=1:-2:-1 / analyse=0x3:0x113 / me=umh / subme=5 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=6 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=16 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc=2pass / mbtree=0 / bitrate=369 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=2:1.00 Encoded date : UTC 2012-03-09 10:01:19 Tagged date : UTC 2012-03-09 10:01:26

bat999
Cone that earned his stripes
Cone that earned his stripes
Posts: 200
Joined: 19 Dec 2007 02:35

Re: How to determine the codec used in mp4 file

Postby bat999 » 26 Aug 2012 04:14

The ultimate question is what can I do to get the broken file to play on linux vlc?
Hi
It looks suspicious that the troublesome file is AVI.
That's unusual (but not impossible) for files with AVC video and AAC audio.
Maybe that's why Linux VLC doesn't like it. :(

If I had this problem I would try to fix it with FFmpeg:-

Code: Select all

ffmpeg -i titanictest.mp4 -vcodec copy -acodec copy new_titanictest.mp4
I would then expect MediaInfo to show "new_titanictest.mp4" as MPEG-4 instead of AVI.

draca
Blank Cone
Blank Cone
Posts: 19
Joined: 05 Aug 2012 21:46

Re: How to determine the codec used in mp4 file

Postby draca » 26 Aug 2012 05:06

Thanks again. Well I downloaded ffmpeg and converted the file per your syntax, however linux vlc still choked on the file (even though mediainfo now shows it as MPEG-4 instead of AVI).

What else can I try?

By the way I put the file out here if anybody wants to download and duplicate the error in linux (I'm running ubuntu 10.04):
http://krissbrown.net/titanictest.mp4

kmf31
Cone that earned his stripes
Cone that earned his stripes
Posts: 308
Joined: 11 Mar 2007 21:47

Re: How to determine the codec used in mp4 file

Postby kmf31 » 26 Aug 2012 11:08

Avi is the encapsulation of the file, not to be confused with the codec. Typically avi files have the codec divx which is a certain mpeg4 variant. Other encapsulations are PS (typically for mpeg2 files) or TS (for files obtained from dvb records, with mpeg2 or mpeg4).

Rémi Denis-Courmont
Developer
Developer
Posts: 15280
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How to determine the codec used in mp4 file

Postby Rémi Denis-Courmont » 26 Aug 2012 15:39

Stating the obvious maybe, but make sure you use the same versions of VLC and FFmpeg/libav on Linux as on Windows, if it works on Windows...
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: How to determine the codec used in mp4 file

Postby Jean-Baptiste Kempf » 27 Aug 2012 10:03

H.264 High in AVI, is wrong in every way possible.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

draca
Blank Cone
Blank Cone
Posts: 19
Joined: 05 Aug 2012 21:46

Re: How to determine the codec used in mp4 file

Postby draca » 27 Aug 2012 15:08

Wrong in every way possible? You lost me. Would I have better luck if I update the codec for h.264 in my linux vlc?

Lotesdelere
Cone Master
Cone Master
Posts: 10005
Joined: 08 Sep 2006 04:39
Location: Europe

Re: How to determine the codec used in mp4 file

Postby Lotesdelere » 28 Aug 2012 09:18

This is one of the worst sample files I've ever seen.

This is an AVI with an MP4 extension.
In this case AVI is bad because the video stream is H.264 encoded and AVI can't properly handle B-frames. It also gives some error messages like this:

Code: Select all

avi warning: cannot get packet header, track disabled
The video stream is strange. It is very jerky at the beginning untill around 0:09 and then seems to become quite stable. According to the resolution, it seems to be a BD rip but it is 25 FPS. There is no BD at 25p, it's not in the specs, and a quick search shows that there is no 50i version of Titanic. So why has it been encoded at 25 FPS rather than the original FPS ? Anyway, muxing it at 23.976 or 24 FPS or playing it at 25 FPS still gives a bunch of errors like these:

Code: Select all

main debug: picture might be displayed late (missing 2 ms) main debug: picture might be displayed late (missing 7 ms) main debug: picture might be displayed late (missing 0 ms)
The audio stream is just broken. It appears to be HE-AAC at 128 kbps and 48kHz. There is no reason to use HE rather than LC at this resolution. I wasn't able to find anything that would play it and VLC gives a load of error messages:

Code: Select all

faad warning: Array index out of range faad warning: Maximum number of scalefactor bands exceeded faad warning: Scalefactor out of range faad warning: Maximum number of bitstream elements exceeded faad warning: Bitstream value not allowed by specification faad warning: Unexpected channel configuration change faad warning: Channel coupling not yet implemented faad warning: PCE shall be the first element in a frame faad warning: Gain control not yet implemented
So to sum it up, this file is broken at every stage. The rip must be done again with the proper FPS for the video, a standard audio and an MP4 or MKV container for the H.264 video.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: How to determine the codec used in mp4 file

Postby Jean-Baptiste Kempf » 28 Aug 2012 10:37

So to sum it up, this file is broken at every stage.
Thank you! :)
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

draca
Blank Cone
Blank Cone
Posts: 19
Joined: 05 Aug 2012 21:46

Re: How to determine the codec used in mp4 file

Postby draca » 28 Aug 2012 14:14

Lotesdelere , thank you for the technical analysis. I take no responsibility for the file's shortcomings since I didn't create the file.

Nevertheless, the point is that windows VLC managed to play the file whereas Linux VLC choked on the file. So windows VLC is somehow using code that is more fault tolerant, which is a very huge benefit. Just think, if your web browser were not fault tolerant, you wouldn't be able to view a lot of websites because of incorrect html/javascript. Likewise, I'd like to maximize the fault tolerance of Linux VLC for whenever I want to view "faulty" movies.

Or alternatively, is there a utilty to enable me to easily repair the file? I unsuccessfully tried fixing with ffmpeg already but maybe I need to pass it special command options.

kmf31
Cone that earned his stripes
Cone that earned his stripes
Posts: 308
Joined: 11 Mar 2007 21:47

Re: How to determine the codec used in mp4 file

Postby kmf31 » 28 Aug 2012 15:45

Nevertheless, the point is that windows VLC managed to play the file whereas Linux VLC choked on the file. So windows VLC is somehow using code that is more fault tolerant, which is a very huge benefit.
In the vlc preferences (just for ffmpeg and h264 I believe) there is an option how vlc treats faulty files. If you chose for your linux vlc version the same setting of the option as in the windows vlc version (and if both vlc versions are identical with same ffmpeg versions) it should work in both cases.

draca
Blank Cone
Blank Cone
Posts: 19
Joined: 05 Aug 2012 21:46

Re: How to determine the codec used in mp4 file

Postby draca » 28 Aug 2012 16:29

Thanks! But I'm having trouble finding this option. I dont see anything about "faulty" files under INPUT/CODECS -> x264. What would the setting be called and where is it?

kmf31
Cone that earned his stripes
Cone that earned his stripes
Posts: 308
Joined: 11 Mar 2007 21:47

Re: How to determine the codec used in mp4 file

Postby kmf31 » 28 Aug 2012 19:06

For vlc-2.0.x the option is:

preferences => all => Input/Codecs => Video Codecs => FFmpeg

and here the option is: "Error resilience" with values between 0 and 4.
when you move the mouse-pointer over this option it shows a small text with some explanations (at least with me). They actually say that there is a buggy M$ encoder creating some trouble and probably if your file comes from this encoder it is better to chose "0" (no error resilience). Actually to my understanding error resilience refers first to transmission error (e.g. antenne reception of DVB-T with mpeg4 etc.) but using a high error resilience may create problemes with buggy files.

In any case you can try all the values of this option and see what it does.

I am not sure but it may be possible that the differences you observed between windows vlc and linux vlc may simply be due to a different setting of this option.


PS: in vlc x264 is to my understanding used to "encode" h264. For decoding of h264 vlc uses FFmpeg.

draca
Blank Cone
Blank Cone
Posts: 19
Joined: 05 Aug 2012 21:46

Re: How to determine the codec used in mp4 file

Postby draca » 28 Aug 2012 20:36

Thanks again. This is VLC 1.0.6 for Linux, but I found error resilience under input/codecs => other codecs => FFmpeg.

Unfortunately, vlc still choked on the file using all values from 0 to 4.

Might any of the other settings make a difference?

Also is it possible to compare the version of the FFmpeg library module between Linux and Windows?

Lotesdelere
Cone Master
Cone Master
Posts: 10005
Joined: 08 Sep 2006 04:39
Location: Europe

Re: How to determine the codec used in mp4 file

Postby Lotesdelere » 29 Aug 2012 09:51

So windows VLC is somehow using code that is more fault tolerant, which is a very huge benefit.

Or alternatively, is there a utilty to enable me to easily repair the file? I unsuccessfully tried fixing with ffmpeg already but maybe I need to pass it special command options.
VLC for Windows is showing some of the images but many are dropped. No audio is heard, at all, by any player I've tried. VLC for Windows is not playing the file, it's just running it, more or less.

As I said this file has been badly encoded for both the video and the audio streams. Nothing can repair it, it must be reencoded again from the source. Once again, this file is broken, deal with it.

draca
Blank Cone
Blank Cone
Posts: 19
Joined: 05 Aug 2012 21:46

Re: How to determine the codec used in mp4 file

Postby draca » 29 Aug 2012 23:16

Ok everybody, please bear with me. I've found out some more info.

First of all, that file titanictest.mp4 was created by me using a program called avidemux. All I did was trim the movie so that I'd have a short sample clip. Both the complete movie and the sample clip stuttered and pixelated on my Linux system. I wonder if avidemux butchered the file?

I see that mediainfo shows different info on the original titanic move file (shows it as MPEG-4 not AVI)

Code: Select all

General Complete name : C:\m\titanic.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom File size : 2.09 GiB Duration : 3h 6mn Overall bit rate mode : Variable Overall bit rate : 1 600 Kbps Encoded date : UTC 2012-03-15 15:07:37 Tagged date : UTC 2012-03-15 15:07:37 Writing application : Yamb 2.1.0.0 [http://yamb.unite-video.com] Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4.0 Format settings, CABAC : Yes Format settings, ReFrames : 5 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 3h 6mn Bit rate : 1 545 Kbps Maximum bit rate : 8 131 Kbps Width : 1 920 pixels Height : 836 pixels Display aspect ratio : 2.25:1 Frame rate mode : Constant Frame rate : 25.000 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.039 Stream size : 2.00 GiB (96%) Writing library : x264 core 120 r2164 da19765 Encoding settings : cabac=1 / ref=5 / deblock=1:-2:-1 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=1545 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00 Encoded date : UTC 2012-03-15 17:35:10 Tagged date : UTC 2012-03-15 15:10:45 Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format profile : HE-AAC / LC Codec ID : 40 Duration : 3h 6mn Bit rate mode : Variable Bit rate : 64.0 Kbps Maximum bit rate : 74.9 Kbps Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 KHz / 24.0 KHz Compression mode : Lossy Stream size : 85.5 MiB (4%) Encoded date : UTC 2012-03-15 15:09:55 Tagged date : UTC 2012-03-15 15:10:45
The original movie that I created the clip from plays apparently flawlessly on windows vlc. And not only that, but I discovered it plays apparently flawlessly on a DIFFERENT computer running the same exact live usb version of ubuntu linux with the same exact version of VLC (1.0.6 goldeneye).

The only difference is that other computer has twice as much ram (2 gigs), and is duo core. The computer with the stuttering/pixelating is a 2.4 MHz computer with 1 gig ram, more than enough horsepower to play other movie files.

So WHY would VLC have a problem playing the same file on a different computer?

Lotesdelere
Cone Master
Cone Master
Posts: 10005
Joined: 08 Sep 2006 04:39
Location: Europe

Re: How to determine the codec used in mp4 file

Postby Lotesdelere » 31 Aug 2012 11:22

First of all, that file titanictest.mp4 was created by me using a program called avidemux. All I did was trim the movie so that I'd have a short sample clip.
OK, so what we need is a sample of the original file.

Use DGsplit and read here about how to do it:
viewtopic.php?f=14&t=57724&p=193335#p193335
It's a Windows program but it should run fine through WINE.
50 MB max should be enough.

draca
Blank Cone
Blank Cone
Posts: 19
Joined: 05 Aug 2012 21:46

Re: How to determine the codec used in mp4 file

Postby draca » 31 Aug 2012 14:02

Ok I used dgsplit to create a new 51 Meg sample file:
http://www.krissbrown.net/titanictest3_0.mp4

This file plays fine on not only windows but also one 2.4 GHz laptop running ubuntu 10.04 live USB distro, VLC 1.0.6, but pixelates/stutters on a similar machine running same exact live usb version of linux/VLC 1.0.6 which is able to play other video files flawlessly. That machine also did the same thing when I tried a more recent VLC 1.1.13.

I'm wondering what the hardware would have to do with it. Any ideas?


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 41 guests