Sponsored Content
Top Forums Programming problem with playing a song using mplayer Post 302229206 by Danny.Chouinard on Tuesday 26th of August 2008 11:40:57 AM
Old 08-26-2008
When mplayer can't find a proper mp3 block header where it expects it to be, it tries to "rewind" back in the data stream to try to get its footing. Sometimes that fails and it then has to walk over the data until it finds a header's signature again.

It's no big deal, and indicative of a sloppily-made mp3.

However, I see in your code that you're not checking how much data fread() returns, and then blindly write 60000 bytes on the socket. Think about the last chunk of data, it's not going to be exactly 60000 bytes. So you're writing extra garbage at the end of your streams.

You should use the value returned by fread() and use that as an argument to fwrite and sendto.
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

playing multimedia content under openbsd with Xvid and mplayer

hello. I just installed OpenBSD3.5 and now am using gnome2.4. i've installed mplayer from the openbsd.org packages directory and it seems to work with all kinds of media. The trouble is, it plays all videos too fast. The picture rate is too high and sound is too fast, too. I wonder if anyone... (1 Reply)
Discussion started by: sablot
1 Replies

2. UNIX for Dummies Questions & Answers

sound card and audio song

Hello, How can i install the sound card on solaris 9.00 and also, how can i play MP3 and audio songs on solaris.... pls provide me the complete steps.... thnks (4 Replies)
Discussion started by: taurian1234
4 Replies

3. UNIX for Dummies Questions & Answers

Problem with mplayer

Can someone help with following problem? I'm trying to watch the stream video. mplayer SRTV - Main Air MPlayer SVN-r24130 (C) 2000-2007 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... (1 Reply)
Discussion started by: mirusnet
1 Replies

4. What is on Your Mind?

Merry Christmas! & UNIX Song

Merry Christmas to the Greatest UNIX Forum on Earth! This "UNIX Christmas Song" song has been around a while but it's still fun. :-) #UNIX Christmas Song better !pout !cry better watchout lpr why santa claus <north pole >town cat /etc/passwd >list ncheck list ncheck list cat list... (5 Replies)
Discussion started by: cassj
5 Replies

5. Shell Programming and Scripting

mplayer problem

I have this problem using a script that uses mplayer. This is the error messages. INFO: Mplayer Log LOG: MPlayer SVN-r1.0~rc3+svn20090426-4.4.3 (C) 2000-2009 MPlayer Team LOG: mplayer: could not connect to socket LOG: mplayer: No such file or directory LOG: Failed to open LIRC support. You... (1 Reply)
Discussion started by: locoroco
1 Replies

6. BSD

How to play a song in terminal app in os x?

Just wondering -- is there a way to play a song in iTunes from the terminal app? (1 Reply)
Discussion started by: Straitsfan
1 Replies

7. UNIX for Beginners Questions & Answers

Problem compiling Mplayer with file pngdec.c

Hello, I was trying to compile Mplayer 1.3 using gcc 4.4, but I am getting LOTS of error messages when make reaches the pngdec.c file. These are the error messages. libavcodec/pngdec.c:37:18: warning: zlib.h: No such file or directory libavcodec/pngdec.c:82: error: expected... (12 Replies)
Discussion started by: colt
12 Replies
aviindex(1)						      General Commands Manual						       aviindex(1)

NAME
aviindex - Write and read text files describing the index of an AVI file SYNOPSIS
aviindex [ -o ofile -i ifile -f -n -x -v -h ] COPYRIGHT
aviindex is Copyright (C) 2003,2004 by Tilmann Bitterberg DESCRIPTION
aviindex writes a text file describing the index of an AVI file. It analyses the content or index if available of the AVI file and prints this information in a human readable form. An AVI file can have an optional chunk called "idx1" which contains information about keyframes (syncpoints) and locations of video frames resp. audio chunks. Though larger AVI files (>2-4GB), so-called OpenDML AVI or also AVI 2 files, have a more complicated indexing system, which consists of a superindex referring to (possibly) several "standard" indexes, the "indexing principle" is the same. Movie players use such indexes to seek in files. aviindex reads the AVI file ifile and writes the index into ofile. This can either happen in "dumb" mode where aviindex looks for an exist- ing index (and trusts this index!) in the file and dumps this index into a human readable form. The "dumb" mode is used, when -n is NOT specified or when the filesize of the input file is smaller than 2 GB. In "smart" mode, aviindex scans through the complete AVI file and searches for chunks (may that video or audio) and reconstructs the index based on the information found. If an index chunk is found accidently, aviindex will use the information in this index to recover the keyframe information, which is important. aviindex will use smart mode, if given the -n option OR if the AVI file is larger than 2 GB. If the file is large, the index chunk cannot be found the usual way so one must use -n but it is possible that there is an index chunk in this file. Cross fingers. Also in smart mode, aviindex analyzes the content of the video frame and tries to detect keyframes by looking at the data depending on the video codec. The generated index file serves different purposes. * The library which handles AVI files in transcode(1) can read such index files and use this file to rebuild the index instead of scanning through the whole AVI file over and over again. Reading the index from the index file is much faster than scan- ning through the AVI. * It can be used as a seeking file. When given to transcode via the --nav_seek switch, transcode will use the file to seek directly to the position you specified via -c. This also works for multiple -c ranges. * Its nice to have for debugging. OPTIONS
-o ofile Specify the name of the output file. -i ifile Specify the name of the input file. -f force the use of the existing index. -n force generating the index by scanning the file. -x (implies -n) don't use any existing index to generate keyframes. -v show version. -h show help text. MPLAYER
aviindex can convert from and to mplayer-generated index files. Since mplayer-1.0pre3 mplayer has the ability to save the index via -saveidx FILE and load it again through -loadidx FILE. aviindex is able to convert an mplayer index file to a transcode index file and vice visa. It is not able to directly write an mplayer file, though. Example of a toolchain mplayer -frames 0 -saveidx mpidx broken.avi aviindex -i mpidx -o tcindex avimerge -x tcindex -i broken.avi -o fixed.avi Or the other way round aviindex -i broken.avi -n -o broken.idx aviindex -i broken.idx -o mpidx mplayer -loadidx mpidx broken.avi The major differences between the two index file formats is that the mplayer one is a binary format which is an exact copy of an index in the AVI file. aviindex 's format is text based. See FORMAT for details. EXAMPLES
The command aviindex -i 3GBfile.avi -o 3GB.index generates and index of the large file 3GBfile.avi. You can use the file 3GB.index to tell transcode to read the index from this file and not from the avi. This leads to much faster startup time. Suppose 3GBfile.avi has DivX video and PCM sound and you want to encode several ranges. transcode -V -i 3GBfile.avi --nav_seek 3GB.index -x xvid,avi -c 5000-6000,0:20:00-0:21:00,100000-100001 -y xvid --lame_preset standard -o out.avi FORMAT
The format of the index file. The first 7 bytes in this file are "AVIIDX1" for easy detection and a comment of who created the file. The second line is a comment and describes the fields. Do not delete it. Each line (except the first 2) consists of exactly 8 fields all seper- ated by one space and describing one particular chunk of the AVI file. Here is an example of an AVI file with two audio tracks. AVIIDX1 # Generated by aviindex (transcode-0.6.8) TAG TYPE CHUNK CHUNK/TYPE POS LEN KEY MS 00db 1 0 0 2048 8335 1 0.00 01wb 2 1 0 10392 847 1 0.00 01wb 2 2 1 11248 847 1 0.00 02wb 3 3 0 12104 847 1 0.00 02wb 3 4 1 12960 847 1 0.00 00db 1 5 1 13816 5263 0 0.00 00db 1 6 2 19088 3435 0 0.00 01wb 2 7 2 22532 834 1 0.00 The field TAG is the chunk descriptor. Its "00d*" for the video, "01wb" for the first audio track, "02wb" for the second audio track and so on. The field TYPE is the type of the chunk. This is redundant because the type is also embedded into the TAG field but its a convenient thing to have. Its 1 for video, 2 for first audio track and 3 for second audio track. The field CHUNK is the absolute chunk number in the AVI file. If you read the CHUNK field in the last line of the index file, you know how many chunks this AVI file has. The field CHUNK/TYPE holds information about how many chunks of this type were previously found in the AVI file. The field POS is the absolute byte position in the AVI file where this chunk can be found. Note this field can hold really large numbers if you are dealing with large AVIs. The field LEN is the length of this chunk. The field KEY holds information if this chunk is a keyframe. In the example above, all audio chunks are key-chunks, but only the first video frame is a key frame. This field is either 0 or 1. The field MS holds information about how many milliseconds have passed. This field may be 0.00 if unknown. AUTHORS
aviindex was written by Tilmann Bitterberg <transcode at tibit.org> and is part of transcode. SEE ALSO
avifix(1), avisync(1), avimerge(1), avisplit(1), tccat(1), tcdecode(1), tcdemux(1), tcextract(1), tcprobe(1), tcscan(1), transcode(1), mplayer(1) aviindex(1) 29th February 2004 aviindex(1)
All times are GMT -4. The time now is 01:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy