You are not logged in.

#1 2009-02-16 13:39:31

kelnoky
Member
Registered: 2007-11-20
Posts: 134

[SOLVED] Encoding *.avi to smartphone compatible *.mp4

Hey there. smile

Sometimes I convert some of my videos into the mp4 format in order to watch it on my smartphone (Nokia E71). Until now this command always worked like a charm:

ffmpeg -i xyz.avi -acodec libfaac -ab 128k -s 320x176 -vcodec libx264 -b 400kb -threads 2 xyz.mp4

Pretty basic conversion with aac and x264. Now I have a few episodes of a series here and I applied that command to all of them and some of the resulting *.mp4 won't be played by the phone (no real error message, just "Unable to play clip"). What could be the problem here?
Some data about the episodes:

This one works:

zsh/3 3529 % hachoir-metadata Stargate.Atlantis.S05E11.HDTV.XviD-FQM.avi 
Common:
- Duration: 42 min 15 sec 32 ms
- Image width: 624
- Image height: 352
- Frame rate: 24.0 fps
- Bit rate: 1.1 Mbit/sec
- Producer: VirtualDubMod 1.5.10.1 (build 2439/release)
- Comment: Has audio/video index (2.5 MB)
- MIME type: video/x-msvideo
- Endian: Little endian
Video stream:
- Duration: 42 min 15 sec 32 ms
- Image width: 624
- Image height: 352
- Bits/pixel: 12
- Compression: XviD MPEG-4 (fourcc:"xvid")
- Frame rate: 24.0 fps
Audio stream:
- Duration: 42 min 15 sec 24 ms
- Channel: stereo
- Sample rate: 48.0 kHz
- Compression: MPEG Layer 3
- Bit rate: 149.7 Kbit/sec

This one doesn't:

zsh/3 3530 % hachoir-metadata stargate.atlantis.s05e10.hdtv.xvid-0tv.avi 
Common:
- Duration: 42 min 17 sec 821 ms
- Image width: 624
- Image height: 352
- Frame rate: 24.0 fps
- Bit rate: 1.1 Mbit/sec
- Producer: transcode-1.0.2
- Comment: Has audio/video index (2.5 MB)
- MIME type: video/x-msvideo
- Endian: Little endian
Video stream:
- Duration: 42 min 17 sec 821 ms
- Image width: 624
- Image height: 352
- Bits/pixel: 24
- Compression: XviD MPEG-4 (fourcc:"XVID")
- Frame rate: 24.0 fps
Audio stream:
- Duration: 42 min 17 sec 832 ms
- Channel: stereo
- Sample rate: 48.0 kHz
- Compression: MPEG Layer 3
- Bit rate: 128.0 Kbit/sec

Looks pretty similar to me, just the software used is different. neutral

Last edited by kelnoky (2009-02-26 22:06:23)

Offline

#2 2009-02-18 21:28:30

kelnoky
Member
Registered: 2007-11-20
Posts: 134

Re: [SOLVED] Encoding *.avi to smartphone compatible *.mp4

No one has any idea? sad

Offline

#3 2009-02-19 04:18:03

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: [SOLVED] Encoding *.avi to smartphone compatible *.mp4

Try running MediaInfo (#1 video/audio info tool) on two different sources, one working one not, and the MP4 output of the working one and the not working one. Post all four text infos. smile
Also, make sure the problem isn't because of a new version of ffmpeg. (Try re-encoding an AVI that worked before).

Last edited by Ranguvar (2009-02-19 04:18:51)

Offline

#4 2009-02-19 23:51:57

kelnoky
Member
Registered: 2007-11-20
Posts: 134

Re: [SOLVED] Encoding *.avi to smartphone compatible *.mp4

Alright. Number 13 doesnt work, number 14 does work:

Source file for not working number 13:

zsh/4 3851 % mediainfo Stargate.Atlantis.S05E13.HDTV.XviD-FQM.avi 
General
Complete name                    : Stargate.Atlantis.S05E13.HDTV.XviD-FQM.avi
Format                           : AVI
Format/Info                      : Audio Video Interleave
File size                        : 350 MiB
Duration                         : 42mn 14s
Overall bit rate                 : 1 158 Kbps
Writing application              : transcode-1.0.4

Video
Format                           : MPEG-4 Visual
Format profile                   : Streaming Video@L1
Format settings, BVOP            : Yes
Format settings, QPel            : No
Format settings, GMC             : No warppoints
Format settings, Matrix          : Default
Codec ID                         : XVID
Codec ID/Hint                    : XviD
Duration                         : 42mn 14s
Bit rate                         : 997 Kbps
Width                            : 624 pixels
Height                           : 352 pixels
Display aspect ratio             : 16/9
Frame rate                       : 23.976 fps
Resolution                       : 24 bits
Colorimetry                      : 4:2:0
Scan type                        : Progressive
Bits/(Pixel*Frame)               : 0.189
Stream size                      : 301 MiB (86%)
Writing library                  : XviD 1.2.0SMP (UTC 2006-01-08)

Audio
Format                           : MPEG Audio
Format version                   : Version 1
Format profile                   : Layer 3
Codec ID                         : 55
Codec ID/Hint                    : MP3
Duration                         : 42mn 14s
Bit rate mode                    : Variable
Bit rate                         : 149 Kbps
Minimum bit rate                 : 32.0 Kbps
Channel(s)                       : 2 channels
Sampling rate                    : 48.0 KHz
Resolution                       : 16 bits
Stream size                      : 45.0 MiB (13%)
Alignment                        : Aligned on interleaves
Interleave, duration             : 24 ms (0.58 video frame)
Writing library                  : LAME3.97 
Encoding settings                : VBR (mtrh)

Source file for working number 14:

zsh/4 3852 % mediainfo Stargate.Atlantis.S05E14.HDTV.XviD.avi 
General
Complete name                    : Stargate.Atlantis.S05E14.HDTV.XviD.avi
Format                           : AVI
Format/Info                      : Audio Video Interleave
File size                        : 350 MiB
Duration                         : 42mn 35s
Overall bit rate                 : 1 149 Kbps
Writing application              : VirtualDubMod 1.5.4.1 (build 2178/release)
Writing library                  : VirtualDubMod build 2178/release

Video
Format                           : MPEG-4 Visual
Format settings, BVOP            : No
Format settings, QPel            : No
Format settings, GMC             : No warppoints
Format settings, Matrix          : Default
Codec ID                         : XVID
Codec ID/Hint                    : XviD
Duration                         : 42mn 35s
Bit rate                         : 1 021 Kbps
Width                            : 624 pixels
Height                           : 352 pixels
Display aspect ratio             : 16/9
Frame rate                       : 23.976 fps
Resolution                       : 24 bits
Colorimetry                      : 4:2:0
Scan type                        : Progressive
Bits/(Pixel*Frame)               : 0.194
Stream size                      : 311 MiB (89%)
Writing library                  : XviD 1.0.1 (UTC 2004-06-05)

Audio
Format                           : MPEG Audio
Format version                   : Version 1
Format profile                   : Layer 3
Codec ID                         : 55
Codec ID/Hint                    : MP3
Duration                         : 42mn 35s
Bit rate mode                    : Variable
Bit rate                         : 116 Kbps
Minimum bit rate                 : 128 Kbps
Channel(s)                       : 2 channels
Sampling rate                    : 48.0 KHz
Resolution                       : 16 bits
Stream size                      : 35.2 MiB (10%)
Alignment                        : Aligned on interleaves
Interleave, duration             : 24 ms (0.58 video frame)
Interleave, preload duration     : 561 ms
Writing library                  : LAME3.97 
Encoding settings                : ABR

Resulting mp4 for not working 13:

zsh/4 3853 % mediainfo SGA13.mp4 
General
Complete name                    : SGA13.mp4
Format                           : MPEG-4
Format profile                   : Base Media
Codec ID                         : isom
File size                        : 169 MiB
Duration                         : 42mn 14s
Overall bit rate                 : 561 Kbps
Encoded date                     : UTC 1970-01-01 00:00:00
Tagged date                      : UTC 1970-01-01 00:00:00

Video
ID                               : 1
Format                           : AVC
Format/Info                      : Advanced Video Codec
Format profile                   : Baseline@L2.0
Format settings, CABAC           : No
Format settings, ReFrames        : 1 frame
Codec ID                         : avc1
Codec ID/Info                    : Advanced Video Coding
Duration                         : 42mn 14s
Bit rate mode                    : Variable
Bit rate                         : 428 Kbps
Width                            : 320 pixels
Height                           : 176 pixels
Display aspect ratio             : 16/9
Frame rate mode                  : Constant
Frame rate                       : 23.976 fps
Resolution                       : 24 bits
Colorimetry                      : 4:2:0
Scan type                        : Progressive
Bits/(Pixel*Frame)               : 0.317
Stream size                      : 129 MiB (76%)
Encoded date                     : UTC 1970-01-01 00:00:00
Tagged date                      : UTC 1970-01-01 00:00:00

Audio
ID                               : 2
Format                           : AAC
Format/Info                      : Advanced Audio Codec
Format version                   : Version 4
Format profile                   : LC
Format settings, SBR             : No
Codec ID                         : 40
Duration                         : 42mn 14s
Bit rate mode                    : Variable
Bit rate                         : 128 Kbps
Channel(s)                       : 2 channels
Channel positions                : L R
Sampling rate                    : 48.0 KHz
Resolution                       : 16 bits
Stream size                      : 38.7 MiB (23%)
Encoded date                     : UTC 1970-01-01 00:00:00
Tagged date                      : UTC 1970-01-01 00:00:00

Resulting mp4 for working number 14:

zsh/4 3854 % mediainfo SGA14.mp4 
General
Complete name                    : SGA14.mp4
Format                           : MPEG-4
Format profile                   : Base Media
Codec ID                         : isom
File size                        : 169 MiB
Duration                         : 42mn 35s
Overall bit rate                 : 556 Kbps
Encoded date                     : UTC 1970-01-01 00:00:00
Tagged date                      : UTC 1970-01-01 00:00:00

Video
ID                               : 1
Format                           : AVC
Format/Info                      : Advanced Video Codec
Format profile                   : Baseline@L2.0
Format settings, CABAC           : No
Format settings, ReFrames        : 1 frame
Codec ID                         : avc1
Codec ID/Info                    : Advanced Video Coding
Duration                         : 42mn 35s
Bit rate mode                    : Variable
Bit rate                         : 423 Kbps
Width                            : 320 pixels
Height                           : 176 pixels
Display aspect ratio             : 16/9
Frame rate mode                  : Constant
Frame rate                       : 23.976 fps
Resolution                       : 24 bits
Colorimetry                      : 4:2:0
Scan type                        : Progressive
Bits/(Pixel*Frame)               : 0.313
Stream size                      : 129 MiB (76%)
Encoded date                     : UTC 1970-01-01 00:00:00
Tagged date                      : UTC 1970-01-01 00:00:00

Audio
ID                               : 2
Format                           : AAC
Format/Info                      : Advanced Audio Codec
Format version                   : Version 4
Format profile                   : LC
Format settings, SBR             : No
Codec ID                         : 40
Duration                         : 42mn 35s
Bit rate mode                    : Variable
Bit rate                         : 128 Kbps
Channel(s)                       : 2 channels
Channel positions                : L R
Sampling rate                    : 48.0 KHz
Resolution                       : 16 bits
Stream size                      : 39.0 MiB (23%)
Encoded date                     : UTC 1970-01-01 00:00:00
Tagged date                      : UTC 1970-01-01 00:00:00

It shouldn't be the fault of an ffmpeg version because I did all of the encoding in one night without any updates. Thanks for trying to help. smile

Offline

#5 2009-02-23 18:30:26

kelnoky
Member
Registered: 2007-11-20
Posts: 134

Re: [SOLVED] Encoding *.avi to smartphone compatible *.mp4

I just converted a whole Dexter season and we have the same problem. Everything encoded via VirtualDub works, the episodes encoded with transcode don't work after I've applied my ffmpeg command. Nearly all the other data of the files are the same, frame rate, bit rate, codec used and the like. They all match, only the application that was used to encode them differs.
Is there maybe a way to work around this?

Offline

#6 2009-02-24 11:58:13

kelnoky
Member
Registered: 2007-11-20
Posts: 134

Re: [SOLVED] Encoding *.avi to smartphone compatible *.mp4

Ok, when I convert that non-working avi file via avidemux into mp4 (didn't even change any settings, just normal mpeg4 ipod preset that is found in avidemux) they work. But I like ffmpeg better, since I can easily batch convert with that. So what is wrong with my ffmpeg command?

Offline

#7 2009-02-24 17:28:45

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: [SOLVED] Encoding *.avi to smartphone compatible *.mp4

I don't know if this helps anything, but there's an error in your FFmpeg command. You have the bitrate set at 400kb, when it should be 400k.

Offline

#8 2009-02-26 22:04:42

kelnoky
Member
Registered: 2007-11-20
Posts: 134

Re: [SOLVED] Encoding *.avi to smartphone compatible *.mp4

Ok. The easy solution is: just change the codec. With libxvid everything works. Don't know why I haven't tried this before. I guess because every guide about converting for ipod/smartphone wanted to use h264.

Offline

#9 2009-02-27 00:01:34

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: [SOLVED] Encoding *.avi to smartphone compatible *.mp4

Well, you're then using MPEG-4 ASP (Xvid/DivX/etc.) instead of MPEG-4 AVC (H.264), which is a less efficient format by a large amount, but yeah.

Offline

Board footer

Powered by FluxBB