Encoding Videos for a NWZ-E345 Sony Walkman (codecs already found)
Linux - SoftwareThis 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.
Encoding Videos for a NWZ-E345 Sony Walkman (codecs already found)
I have a Sony Walkman NWZ-E345.
Right now I'm trying to figure out what kind of encoding I can use to watch videos on it.
From Amazon:
Supports MP3, WMA (DRM), AAC, and Linear PCM audio formats; AVC, MPEG-4, and WMV (DRM) video formats; JPEG image files
From Sony:
The E340 supports multiple high-quality video formats (AVC (H.264/AVC), MPEG-4, and WMV), as well as a variety of audio codecs (MP3, WMA, AAC-LC (.mp4), and L-PCM (.wav), giving you more freedom to download the kind of music and video that you want.
WMV playback limited to Simple Profile, QVGA resolution (320x240) at a bitrate no higher than 768 kpbs. MPEG-4 playback limited to Simple Profile, QVGA resolution (320x240), at a bitrate no higher than 1024 kpbs. AVC playback limited to Baseline Profile, QVGA resolution (320x240), at a bitrate no higher than 768 kpbs.
ok. So to summarize:
Video: wmv, mp4, avc
audio: wma, mp3, aac
Resolution: 320x240
bitrate< 768
From the example file that does work:
Video:
Dimensions: 320x240
Codec: Microsoft Windows Media 9
Framerate: 30
Bitrate: 774 kbps
Audio:
Codec: WMA version 8
Chanels: Stereo
Sample rate: 44100 Hz
Bitrate: 55 kbps
I found someplace that x264 = mp4, so I tried this:
The file didn't show up. I tried both the suffix avi, and mp4.
Checking the file with nautilus properties, showed that the video bitrate was "N/A". Maybe that's the problem?
I would be fine with encoding in anything that works.
Does anyone have any ideas on how to either encode in the DRM, Windows format? Or how to Properly encode in mp4?
Note: As this model has an "external" that allows copying any data onto it, the only way to know if the video is in the wrong format is copying it on, and searching for it. This is what I mean when I say the "file didn't show up."
In your example you create an AVI-file. This container format is not supported by your "Sony Walkman". Also just renaming avi to mp4 does not change the format!
Mencoder can create mpeg4-files in principle, but then you must set the output format to lavf and select mpeg4 for -lavfopts. But as far as I know the video files created by mencoder using lavf are not always standard conform, in the presence of b-frames. Most times they can be played back with mplayer or similar players, but devices like your walkman are very prone to litte errors. ffmpeg is able to create video files that can be played back on such devices (provided ffmpeg is built with aac and h264 support):
Code:
ffmpeg -i in.avi out.mp4
ffmpeg at least supports wmv7 and wmv8 video format for encoding. But I do not recommend using wmv/asf, since this is a proprietary video/audio/container format (similar to MPEG-4 though, but nevertheless different). Also MPEG* is patented, but is at least a standard.
While wmv supports drm I would not recommend to use it, unless you want to restrict yourself
In your example you create an AVI-file. This container format is not supported by your "Sony Walkman". Also just renaming avi to mp4 does not change the format!
Yeah, I know. I was just confused because I was unsure if the foramt I used was mp4 (I don't recall where I was told that it was mp4... but then nautilus told me it was avi, so I thought I'd try both).
Quote:
Originally Posted by irmin
Mencoder can create mpeg4-files in principle, but then you must set the output format to lavf and select mpeg4 for -lavfopts. But as far as I know the video files created by mencoder using lavf are not always standard conform, in the presence of b-frames. Most times they can be played back with mplayer or similar players, but devices like your walkman are very prone to litte errors.
And it didn't work. But as you said, it's prone to fail.
Quote:
Originally Posted by irmin
ffmpeg is able to create video files that can be played back on such devices (provided ffmpeg is built with aac and h264 support):
Code:
ffmpeg -i in.avi out.mp4
ffmpeg at least supports wmv7 and wmv8 video format for encoding. But I do not recommend using wmv/asf, since this is a proprietary video/audio/container format (similar to MPEG-4 though, but nevertheless different). Also MPEG* is patented, but is at least a standard.
While wmv supports drm I would not recommend to use it, unless you want to restrict yourself
Well, honestly, I'm all for open formats, but stuff like "ogg" doesn't work when I can't play it on my mp3 player (read: If it plays I'm happy).
Ok. So what you're advising is to build ffmpeg with aac and h264, and then run the command you listed?
Sorry, while I like to think I know what I'm talking about I couldn't really follow you...
Also keep in mind that ffmpeg has a lot of different options to tune the audio and video codification. Some of your options might not work on your device.
It took me a while to figure out what were the optimal options for an iPhone 3G ...
The bitrate options -b and -ab in ffmpeg are now read as bits-per-second, so your values are too low, particularly the audio value. You can add "k" to the values for them to be read correctly.
Note that this changed only a couple of years ago, so there's still a lot of outdated information out there.
Watch the output carefully when you run the command. If you look at the output in the post above, you'll see that it gave you a warning about this.
Also, you can check that you're using the proper values for -f, -vcodec, and -acodec by using the commands "ffmpeg -formats" and ffmpeg -codecs". These will give you a list of all the formats and codecs available to you.
Last edited by David the H.; 06-21-2010 at 09:21 AM.
Ok. this didn't work (Unknown encoder 'libx264'), but 'libxvid' allowed ffmpeg to finish without errors.
But it still didn't show up...
Quote:
Originally Posted by Hammett
Also keep in mind that ffmpeg has a lot of different options to tune the audio and video codification. Some of your options might not work on your device.
Are there any options I can cut out? or anything I missed?
requirements:
codecs: check
bitrate: check (-b 768000)
framerate: check (-r 30)
size: check
That leaves only the option for audio bitrate, which if I don't specify it throws the error:
Code:
[libfaac @ 0x9403140]libfaac doesn't support this output format!
I've tried dropping the bitrate...
These videos all seem to follow the requirements that sony outlined, and I'm honestly not sure what other options to try.
Any ideas on the wmv route? ffmpeg doesn't have options for wmv 9.
Ok. this didn't work (Unknown encoder 'libx264'), but 'libxvid' allowed ffmpeg to finish without errors.
That means that ffmpeg was built without H264 support. Try to get a version built with that codec or built it from source (enabling the option, of course)
Quote:
Originally Posted by isaaclw
Are there any options I can cut out? or anything I missed?
requirements:
codecs: check
bitrate: check (-b 768000)
framerate: check (-r 30)
size: check
There are numerous options, google around a bit for more specific options, but I can tell there are a lot of options. For example, these are the options I found to work best for iPhone:
I guess you guys are referring to Linux systems only. Can you use SONY's Content Transfer application on Linux? Apparently this application can convert any video to wmv format that will work on NWZ-E345.
Adjust parameters are necessary, -g should be 10 times the frame rate. The lower the qscale the better the quality, but don't go too low because it will have too high bitrate, and the thing won't play it.
I had seen it before but for some strange reason I was under the impression that h264 wouldn't need separate installation.
Then I'll test h264 as a codec (since xvid is failing).
However, it'll take a while to actually download all the parts.
Thanks David the H, irmin and Hammett. I'll be back once I've tried.
mikeleko: that's something I've been very tempted to do. Unfortunately I have no windows computers to test on, and the Sony software isn't installing in wine.
H_TeXMeX_H: Unfortunately, I'm fairly certain that avi doesn't work :/
Anyway, thanks, and I'll be back. I'll get this working somehow...
But, I can't believe it won't play avi, that's ridiculous, most DVD players that you can buy can play avi with mpeg4 + mp3, so that thing is quite lame (no pun intended).
As a side note, you're not encoding the audio. It should not be a problem because the audio input is the same as the audio output and ffmpeg does not complain about that, but just for you to take into consideration for further uses.
It could be as well that ffmpeg is not compiled properly. Those instructions you followed are 2 years old and on the same thread there are people with the same issues as you, i haven't found any straight solution though...
Nothing :/
It'd be nice if the mp3 player would actually give an error of some kind so I knew what was wrong...
Quote:
Originally Posted by Hammett
As a side note, you're not encoding the audio. It should not be a problem because the audio input is the same as the audio output and ffmpeg does not complain about that, but just for you to take into consideration for further uses.
I threw audio in too. Didn't seem to do much, but that's a good point anyway. Who knows how many different things I'm missing... (I recall errors with libfaac before, so I think it defaults to that encoder?)
Quote:
Originally Posted by Hammett
It could be as well that ffmpeg is not compiled properly. Those instructions you followed are 2 years old and on the same thread there are people with the same issues as you, i haven't found any straight solution though...
Well, actually it was initially posted then, but it's been updated since April this year since the current post is for Lucid Lynx (which is 10.04 meaning released April this year)
I think I might have to go two pass. I'm worried how after I encode it shows "N/A" for the bitrate...
At least I'm learning, sometimes I think that's what linux is for.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.