Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-12-2009, 08:22 AM
|
#1
|
Member
Registered: Jun 2003
Location: Brasil
Distribution: Slackware 13.1_64 Gold Edition
Posts: 209
Rep:
|
To experts on transcode, mencoder, ffmpeg, avidemux
Hello guys!
I have a mp4 player that plays avi files.
Whenever I try to convert a video do play on this device I fail,
and I don't know why........
The source file, that comes shipped within the player, is the file src.avi,
and here is its spec:
erickfis@darkstar:~/tmp$ tcprobe -i src.avi
[tcprobe] RIFF data, AVI video
[tcprobe] summary for src.avi, (*) = not default, 0 = not detected
import frame size: -g 320x240 [720x576] (*)
aspect ratio: 4:3 (*)
frame rate: -f 20.000 [25.000] frc=0 (*)
audio track: -a 0 [0] -e 44100,0,2 [48000,16,2] -n 0x50 [0x2000] (*)
bitrate=128 kbps
length: 1085 frames, frame_time=50 msec, duration=0:00:54.250
erickfis@darkstar:~/tmp$ file src.avi
src.avi: RIFF (little-endian) data, AVI, 320 x 240, 20.00 fps, video:
XviD, audio: MPEG-1 Layer 1 or 2 (stereo, 44100 Hz)
erickfis@darkstar:~/tmp$ mplayer -identify src.avi
Playing src.avi.
AVI file format detected.
ID_VIDEO_ID=0
[aviheader] Video stream found, -vid 0
ID_AUDIO_ID=1
[aviheader] Audio stream found, -aid 1
VIDEO: [XVID] 320x240 12bpp 20.000 fps 612.3 kbps (74.7 kbyte/s)
Clip info:
Software: MEncoder Sherpya-MinGW-20060312-4.1.0
ID_CLIP_INFO_NAME0=Software
ID_CLIP_INFO_VALUE0=MEncoder Sherpya-MinGW-20060312-4.1.0
ID_CLIP_INFO_N=1
ID_FILENAME=src.avi
ID_DEMUXER=avi
ID_VIDEO_FORMAT=XVID
ID_VIDEO_BITRATE=612328
ID_VIDEO_WIDTH=320
ID_VIDEO_HEIGHT=240
ID_VIDEO_FPS=20.000
ID_VIDEO_ASPECT=1.3333
ID_AUDIO_FORMAT=80
ID_AUDIO_BITRATE=128008
ID_AUDIO_RATE=0
ID_AUDIO_NCH=0
ID_LENGTH=54.25
ID_SEEKABLE=1
ID_CHAPTERS=0
I've tried transcode, mencoder, ffmpeg and avidemux the best I could,
but the device keeps saying the the output is not a valid file.
Can u help me?
|
|
|
08-12-2009, 01:00 PM
|
#2
|
Bash Guru
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852
|
1) Please put your output inside [noparse][code][\code][\noparse] tags. It makes the formatting easier to read.
2) You really haven't told us enough. I'm still not very clear about where your problems lie.
I take it the src.avi is a sample video that shows the specs your player handles? So does that video work? Is there any other documentation provided with your player, or found on the web, that details what the video parameters should be?
So what have you tried so far? Give us some examples of what commands you've attempted. What are your input files like? Have you succeeded in creating a video with similar specs to the above?
According to your output above (all 3 programs have essentially the same info), the sample video is in the following format:
Video:
AVI container
xvid codec
4:3 aspect ratio
320x240 frame size
framerate of 20 frames per second
bitrate of approximately 600kb
Audio:
mp2 codec
44100khz sampling frequency
stereo (2 channels)
bitrate 128kbs
I'm sure that there's some flexibility possible, particularly the bitrate, but you should try to get your output to be close to this. These are really very generic settings, so it should be a snap to produce something similar.
Apparently src.avi was produced using a Windows-based version of mencoder, so it should be possible to produce a playable file. Unfortunately from what I've seen on the web, it looks like some players require some precise advanced options settings. But without more info I can't say (and is beyond my ability anyway).
|
|
|
08-13-2009, 09:39 AM
|
#3
|
Member
Registered: Jun 2003
Location: Brasil
Distribution: Slackware 13.1_64 Gold Edition
Posts: 209
Original Poster
Rep:
|
Hello David!
Thanks for replying!
Here we go:
- src.avi is the file that comes shipped inside the player. Is the only video that I can play on it.
- there is no documentation. It is a mp4 that I bought from China/ebay
- no brand nor warranties.
- the last time I tried, I did:
Code:
ffmpeg -i input.avi -b 613000 -r 20.000 -s 320x240 -aspect 4:3 -vcodec libx264 -ab 128k -ar 44100 -acodec mp2 -ac 2 output.avi
It didn't work as well....
The specs of output.avi:
Code:
erickfis@darkstar:~/tmp/sandra$ file output.avi
output.avi: RIFF (little-endian) data, AVI, 320 x 240, 20.00 fps, video: X.264, audio: MPEG-1 Layer 1 or 2 (stereo, 44100 Hz)
erickfis@darkstar:~/tmp/sandra$ tcprobe -i output.avi
[tcprobe] RIFF data, AVI video
[tcprobe] summary for output.avi, (*) = not default, 0 = not detected
import frame size: -g 320x240 [720x576] (*)
aspect ratio: 4:3 (*)
frame rate: -f 20.000 [25.000] frc=0 (*)
audio track: -a 0 [0] -e 44100,0,2 [48000,16,2] -n 0x50 [0x2000] (*)
bitrate=128 kbps
length: 958 frames, frame_time=50 msec, duration=0:00:47.900
erickfis@darkstar:~/tmp/sandra$ mplayer -identify output.avi
MPlayer dev-SVN-r28306-4.2.4 (C) 2000-2009 MPlayer Team
CPU: AMD Sempron(tm) Processor 2800+ (Family: 15, Model: 44, Stepping: 2)
CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Playing output.avi.
AVI file format detected.
ID_VIDEO_ID=0
[aviheader] Video stream found, -vid 0
ID_AUDIO_ID=1
[aviheader] Audio stream found, -aid 1
VIDEO: [H264] 320x240 24bpp 20.000 fps 723.8 kbps (88.4 kbyte/s)
Clip info:
Software: Lavf52.25.0
ID_CLIP_INFO_NAME0=Software
ID_CLIP_INFO_VALUE0=Lavf52.25.0
ID_CLIP_INFO_N=1
ID_FILENAME=output.avi
ID_DEMUXER=avi
ID_VIDEO_FORMAT=H264
ID_VIDEO_BITRATE=723792
ID_VIDEO_WIDTH=320
ID_VIDEO_HEIGHT=240
ID_VIDEO_FPS=20.000
ID_VIDEO_ASPECT=1.3333
ID_AUDIO_FORMAT=80
ID_AUDIO_BITRATE=127992
ID_AUDIO_RATE=0
ID_AUDIO_NCH=0
ID_LENGTH=47.90
ID_SEEKABLE=1
ID_CHAPTERS=0
Reading theese specs, I can only conclude that the difference between src.avi and output.avi is the bpp parameter: 12 bpp in src.avi while 24 bpp in output.avi.
I'd already tried mencoder before, but just now I can't remember the parameters I used.
Any thoughts?
|
|
|
09-18-2009, 12:32 PM
|
#4
|
Member
Registered: Mar 2004
Distribution: Fedora 10
Posts: 85
Rep:
|
There is also another difference between src.avi and output.avi. src.avi uses the xvid codec and output.avi uses h264 codec. Are you sure your player plays h264 vids?
|
|
|
09-18-2009, 02:11 PM
|
#5
|
Member
Registered: Jun 2003
Location: Brasil
Distribution: Slackware 13.1_64 Gold Edition
Posts: 209
Original Poster
Rep:
|
To be honest I don't know.
But it's a clever idea to try xvid codec (x264, right?) to see what happens.
Thanks!
|
|
|
09-18-2009, 08:41 PM
|
#6
|
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
|
avi is a container. It can contain any number of video codecs(mjpeg / msmpeg4v2 / xvid / ???) and audio codecs (pcm / mp2 / mp3 / ac3 / aac / ???). It's best to match the src.avi that works on the player. xvid is much older than x264, they are not always interchangeable.
mediainfo might better help you / us identify what the source file that works is. You should match that source. Portable players are generally stripped down to make room for content, not abilities. ffmpeg -i is another option to ID the source material. ffprobe, mplayer -identify, and many others...
Based on the provided info.
ffmpeg -i source.video -s 320x240 -r 20 -aspect 4:3 -ac 2 -ar 44100 -ab 128k -vcodec libxvid -b 600k -y output.avi
Although it looks like your source file was encoded with mencoder. Perhaps a little googling could identify a working encoding method.
|
|
|
09-20-2009, 04:20 AM
|
#7
|
LQ Newbie
Registered: May 2009
Posts: 6
Rep:
|
Its highly likely your player only plays xvid files with mp3 audio
Yet, you're trying to play an x264 encoded file
No wonder it doesnt work
|
|
|
09-23-2009, 07:45 AM
|
#8
|
Member
Registered: Jun 2003
Location: Brasil
Distribution: Slackware 13.1_64 Gold Edition
Posts: 209
Original Poster
Rep:
|
Hello everyone!
Thanks for replying!
But I'll have to wait until next week to try the new encoded videos,
because a friend of mine lend the mp4 player for a travel....
|
|
|
09-23-2009, 08:06 AM
|
#9
|
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
|
For a while I had the same problem, I couldn't encode any videos to make them work with a Divx player. But, I found that something like this works every time:
Code:
ffmpeg -i input.avi -vcodec libxvid -qscale 5 -s 320x240 -r 23.976 -aspect 4:3 -g 240 -bf 2 -acodec libmp3lame -ab 128k -ar 44100 -async 44100 -ac 2 -pass 1 -an -f rawvideo -y /dev/null
ffmpeg -i input.avi -vcodec libxvid -qscale 5 -s 320x240 -r 23.976 -aspect 4:3 -g 240 -bf 2 -acodec libmp3lame -ab 128k -ar 44100 -async 44100 -ac 2 -pass 2 -f avi output.avi
|
|
|
09-28-2009, 02:55 PM
|
#10
|
Member
Registered: Jun 2003
Location: Brasil
Distribution: Slackware 13.1_64 Gold Edition
Posts: 209
Original Poster
Rep:
|
Quote:
Originally Posted by LightUnsigned
Its highly likely your player only plays xvid files with mp3 audio
Yet, you're trying to play an x264 encoded file
No wonder it doesnt work
|
today I tried libxvid,
but I get the same error on my player
|
|
|
09-28-2009, 02:56 PM
|
#11
|
Member
Registered: Jun 2003
Location: Brasil
Distribution: Slackware 13.1_64 Gold Edition
Posts: 209
Original Poster
Rep:
|
Quote:
Originally Posted by H_TeXMeX_H
For a while I had the same problem, I couldn't encode any videos to make them work with a Divx player. But, I found that something like this works every time:
Code:
ffmpeg -i input.avi -vcodec libxvid -qscale 5 -s 320x240 -r 23.976 -aspect 4:3 -g 240 -bf 2 -acodec libmp3lame -ab 128k -ar 44100 -async 44100 -ac 2 -pass 1 -an -f rawvideo -y /dev/null
ffmpeg -i input.avi -vcodec libxvid -qscale 5 -s 320x240 -r 23.976 -aspect 4:3 -g 240 -bf 2 -acodec libmp3lame -ab 128k -ar 44100 -async 44100 -ac 2 -pass 2 -f avi output.avi
|
Thanks for helping,
but yet no success....
this (my mp4 player) is a really tough guy!
|
|
|
09-28-2009, 03:00 PM
|
#12
|
Member
Registered: Jun 2003
Location: Brasil
Distribution: Slackware 13.1_64 Gold Edition
Posts: 209
Original Poster
Rep:
|
well, whenever I try libmp3lame I get
[libmp3lame @ 0x808e0f0]lame: output buffer too small (buffer index: 9195, free bytes: 597)
Audio encoding failed
Code:
erickfis@darkstar:~/tmp/sandra$ ffmpeg -i input.avi -b 613000 -r 20.000 -s 320x240 -aspect 4:3 -vcodec libxvid -ab 128k -ar 44100 -acodec libmp3lame -ac 2 output3.avi
FFmpeg version SVN-r16702, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/usr --mandir=/usr/man --disable-static --enable-shared --enable-gpl --enable-nonfree --enable-postproc --enable-swscale --enable-avfilter --enable-avfilter-lavf --enable-pthreads --enable-x11grab --enable-bzlib --enable-libamr-nb --enable-libamr-wb --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-zlib --arch=i686
libavutil 49.14. 0 / 49.14. 0
libavcodec 52.11. 0 / 52.11. 0
libavformat 52.25. 0 / 52.25. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 2. 0 / 0. 2. 0
libswscale 0. 6. 1 / 0. 6. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Jan 20 2009 20:28:40, gcc: 4.2.4
Input #0, avi, from 'input.avi':
Duration: 00:00:47.80, start: 0.000000, bitrate: 259 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 24.96 tb(r)
Stream #0.1: Audio: mp2, 22050 Hz, mono, s16, 128 kb/s
Output #0, avi, to 'output3.avi':
Stream #0.0: Video: libxvid, yuv420p, 320x240 [PAR 1:1 DAR 4:3], q=2-31, 613 kb/s, 20.00 tb(c)
Stream #0.1: Audio: libmp3lame, 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
[libmp3lame @ 0x808e0f0]lame: output buffer too small (buffer index: 9195, free bytes: 597)
Audio encoding failed
|
|
|
09-28-2009, 03:01 PM
|
#13
|
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
|
I say you try with a different video, maybe that one is corrupt or something.
As for the lame error, I recommend you use lame version 3.97, newer versions seem to have this bug. Maybe there a patch somewhere ? Either way I use version 3.97 and there is no such bug.
Last edited by H_TeXMeX_H; 09-28-2009 at 03:02 PM.
|
|
|
All times are GMT -5. The time now is 10:09 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|