Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 23 Dec 2014, 01:18
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
HowTo: Convert mov,avi,mkv to mpeg1,or mp4,or avchd?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 5 [69 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
Author Message
Bruce B


Joined: 18 May 2005
Posts: 11131
Location: The Peoples Republic of California

PostPosted: Sun 02 Jan 2011, 21:41    Post subject:  

RetroTechGuy wrote:
Sylvander wrote:
1. @Bruce B
None of the files I'm interested in converting are .flv files.
mov,avi,mkv files as in title.


I'm not sure that ffmpeg cares about that, it seems like it can convert most anything to your desired format.


Pretty much, but my script cared, that's why Sylvander had a problem, which I corrected with the above batch processing script.

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
RetroTechGuy


Joined: 15 Dec 2009
Posts: 2673
Location: USA

PostPosted: Sun 02 Jan 2011, 21:48    Post subject:  

Bruce B wrote:
Sylvander wrote:
1. @Bruce B
None of the files I'm interested in converting are .flv files.
mov,avi,mkv files as in title.


Makes sense, the first script was made explicitly for .flv input files

With this one run it link this:

filename .mov
filename .avi

Running without the .ext won't work, but it will process all files in the directory.

Code:
#!/bin/bash

[ ! $1 ] && echo missing argument && exit

for i in *$1
do
   fn=`basename $i $1`
   ffmpeg -i ${fn}$1  -target vcd -y ${fn}.mpg
done



Still getting errors in 4.3.1

Quote:

# bruce .flv
BusyBox v1.15.0.svn (2009-07-25 18:23:53 GMT-Cool multi-call binary

Usage: basename FILE [SUFFIX]

Strip directory path and suffixes from FILE.
If specified, also remove any trailing SUFFIX.

FFmpeg version SVN-r22815, Copyright (c) 2000-2010 the FFmpeg developers
built on Apr 8 2010 21:20:40 with gcc 4.2.2
configuration: --prefix=/usr --enable-runtime-cpudetect --enable-pthreads --enable-sram --enable-shared --disable-debug --enable-ffplay --enable-postproc --enable-libmp3lame --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libvorbis --enable-libspeex --enable-avfilter --enable-avfilter-lavf --enable-x11grab --enable-libx264 --enable-libxvid --enable-libtheora --enable-gpl --enable-nonfree
libavutil 50.14. 0 / 50.14. 0
libavcodec 52.66. 0 / 52.66. 0
libavformat 52.61. 0 / 52.61. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.18. 0 / 1.18. 0
libswscale 0.10. 0 / 0.10. 0
libpostproc 51. 2. 0 / 51. 2. 0
.flv: No such file or directory



Also didn't work with "*", "*.flv", ".flv" or as "bruce * .flv"

Update: OK, it has trouble with filenames that contain spaces. This is the same problem I had with my multi-file script attempt. Is there a way to quote the files identified in the directory, so as to avoid this?

Example: "Always Look On The Bright Side of Life.flv"
(yes, I was playing with a bit of Monty Python)

I think that the code needs to delimit on line feeds, not spaces to solve this...

BTW, a buddy wrote me a perl script, but I can't read perl yet, so I can't crib it to make other similar tools (conversely, once I get a working bash/ash/csh/tcsh script, I can reuse it)...

_________________
Add swapfile
Back to top
View user's profile Send private message 
RetroTechGuy


Joined: 15 Dec 2009
Posts: 2673
Location: USA

PostPosted: Sun 02 Jan 2011, 21:59    Post subject:  

Whoops -- didn't refresh the directory
Back to top
View user's profile Send private message 
Makoto


Joined: 03 Sep 2009
Posts: 1820
Location: Out wandering... maybe.

PostPosted: Sun 02 Jan 2011, 22:44    Post subject:  

Sylvander wrote:
Did that and wrote down the [short] list, hence the list in the title = AVCHD,MP4(AVC),MPEG1.


That isn't entirely what I meant - usually, the instruction manuals are a little more specific about the specifications each of the above filetypes should contain (how they're encoded). AVCHD can be a pain, for example, as everyone seems to want to create it their own different ways.

...or at least, they SHOULD be a little more specific. One can hope, right? Smile I've seen reports of players (even from big-name manufacturers) that just give you that list of file types it plays, and leave you to figure out what else you need to do to the files in order to get them to play. Rolling Eyes

_________________
[ Puppy 4.3.1 JP, Frugal install | 1GB RAM | 1.3GB swap ] * My Pidgin Builds for Puppy 4.3.1+
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11131
Location: The Peoples Republic of California

PostPosted: Sun 02 Jan 2011, 23:07    Post subject:  

RetroTechGuy wrote:


Also didn't work with "*", "*.flv", ".flv" or as "bruce * .flv"

Update: OK, it has trouble with filenames that contain spaces. This is the
same problem I had with my multi-file script attempt. Is there a way to
quote the files identified in the directory, so as to avoid this?


Spaces are very easy to work around in the script. The characters I would
have to test would be things like ' and a couple others. I'll post a
modification for spaces when Sylvander reports back.

To add space support one does like this:

from ${fn}.mpg to \"${fn}.mpg\"

Another thing that is hard to pass on the CLI in this case * , that's why it
is in the script and not to be entered on the CLI

Primarily I'm interested in seeing if Sylvander will get the file quality he
wants, later I'll dress up the script, after I get complaints.

My computer practices are very different than others. Not Sylvander in
particular. One thing I do is make files for a low common denominator.
This way I can move them from system to program to program and
system with no porting problems.

For example, if I want rich text and formatting, I do it in HTML. Video files
and sound files should play on anything, and etc.

As for spaces in filenames, some years ago I donated spacereplace
to Puppy. (I didn't write it, I borrowed it) Is it still included in new
releases?

~

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
RetroTechGuy


Joined: 15 Dec 2009
Posts: 2673
Location: USA

PostPosted: Sun 02 Jan 2011, 23:46    Post subject:  

Bruce B wrote:
Spaces are very easy to work around in the script. The characters I would have to test would be things like ' and a couple others. I'll post a modification for spaces when Sylvander reports back.

Thanks man!

Quote:
To add space support one does like this:

from ${fn}.mpg to \"${fn}.mpg\"

Another thing that is hard to pass on the CLI in this case * , that's why it is in the script and not to be entered on the CLI


That patch didn't seem to work, but I'll play with it some more (or just wait for the next version)

Quote:
Primarily I'm interested in seeing if Sylvander will get the file quality he wants, later I'll dress up the script, after I get complaints.


Incidentally, I tried my old script, and the new one. Briefly, the output sizes:

Original .flv = 13MB

My older conversion parameters:
ffmpeg -i "$1" -y -f avi -vtag divx -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k "$1".avi
results in a 22MB file (and I think the quality is comparable, or perhaps slightly better than below)

And the version "fmpeg -target vcd -y" = 33 MB

Of course, once a script works, it's easy enough to change this around.

Quote:
As for spaces in filenames, some years ago I donated spacereplace
to Puppy. (I didn't write it, I borrowed it) Is it still included in new releases?

Years ago I had written a widget to do that, but support for spaces has greatly improved since then, so I prefer to just leave them (in my code, I actually removed all of the troublesome characters).

_________________
Add swapfile
Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 3557
Location: West Lothian, Scotland, UK

PostPosted: Tue 04 Jan 2011, 08:49    Post subject:  

1. Whew, managed to get some time to make some kind of reply.

2. @Trapster
Being a noob, reluctant to attempt the command line method.
May attempt that later.
Greater knowledge and understanding needed.
I can only hope.

3. @bodbozzle
Installed AVIDemux using the lupusave on my Flash Drive, and now at Lupu-519.
Took a look at that and couldn't understand how to do anything with it [not very obvious/intuitive].
Will try to find instructions for use; 1st attempt to find was unsuccessful.

4. @Bruce B
"I've written [th]is simple script for you to try"
No expert and not good with command line scripts.
I see it uses ffmpeg, and converts flv to mpg.
Is mpg the same as mpeg1? Confused

5. @Makoto
(a) OK, think I now understand "Remuxing", if not in detail.

(b) "check the instructions for a list of exactly what can play on the Bravia"
See "Playback via USB".
Which says:
# Files from a USB device need to be compatible with the following file formats.
# - Still images: JPEG format or RAW format (preview only)
# - Music: MP3 format
# - Video: AVCHD, MP4 (AVC) or MPEG1 format (not playable in some cases)


6. @Bruce B
(a) "Makes sense, the first script was made explicitly for .flv input files
With this one run it like this:
filename .mov
filename .avi
"
Clear as mud to me. Confused
How do I include the filename and extension, so the code entered at the terminal command prompt is applied to the file to be converted?
And the code is like Greek to me.

(b) "With this one run it like this according to the input file extension.
scriptname .mov
scriptname .avi
"
Still confused. Confused Sad
We dummies like GUI's.
I'm getting on in years, and may be dead before I ever learn about coding.
Should I want to waste my remaining years learning such stuff?
All I want to do is play some [video etc] files on my TV using the USB socket and a [Flash or Hard Disk] drive!
With all the assistance being given you'd think I'd eventually manage to learn how, eh?

(c) "my script cared, that's why Sylvander had a problem"
I haven't yet tried using any of your scripts.
Have you misunderstood my reply about not needing to convert flv files, because I don't have any?

7. @Makoto
"usually, the instruction manuals are a little more specific about the specifications each of the above filetypes should contain (how they're encoded)....
...or at least, they SHOULD be a little more specific. One can hope, right
"
Unfortunately, the Sony online i-Manual is NOT very detailed, as you will see using the link above in 5(b).
Here's the 1st page of the manual, from which you can go to all the other pages.
The i-Manual can be viewed on the TV using the remote control [not sure if it needs to go out onto the web to fetch].
Rather crazy way of doing things methinks.
You need a separate/independent [printed?] manual when attempting to follow its instructions to make TV configurations. Sad

8. @Bruce B
"One thing I do is make files for a low common denominator"
Sounds good to me...
I'm your typical "low common"...er...."denominator".
If I can do it, almost anyone can do it. Very Happy
Back to top
View user's profile Send private message 
RetroTechGuy


Joined: 15 Dec 2009
Posts: 2673
Location: USA

PostPosted: Tue 04 Jan 2011, 12:45    Post subject:  

Sylvander wrote:
1. Whew, managed to get some time to make some kind of reply.

2. @Trapster
Being a noob, reluctant to attempt the command line method.
May attempt that later.


It's often easier (i.e. faster) to get results from the command line. Otherwise you have to wait until someone kludges together a GUI...

For example, I took Bruce's script and created a file in "~/my-applications/bin", and pasted the text in (I called it "bruce", to keep track of which one it is).

Now (assuming that permissions are correctly set to "x" = "execute") you have a command "bruce" that will process the files given in the list.

Navigate to your file location, e.g.:
Code:
cd /mnt/sdc1/myvids/

Then run the program:
Code:
bruce .flv


(IIRC, Bruce's script needs to be told the extension, .flv, but then polls its own list from the current directory).

Quote:
Greater knowledge and understanding needed.
I can only hope.


Here's where I found the ffmpeg parameters that I used above (thanks Neurino):

http://www.murga-linux.com/puppy/viewtopic.php?p=444325#444325

Here's another thread, and Lobster has a link to using ffmpeg:

http://www.murga-linux.com/puppy/viewtopic.php?p=235969#235969

So let's assume that you now have a working script, but don't like the original parameters. Just edit the script (open as text) and paste in the new parameters...

_________________
Add swapfile
Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 3557
Location: West Lothian, Scotland, UK

PostPosted: Tue 04 Jan 2011, 13:38    Post subject:  

1. Tried another look at Avidemux, but it was no better 2nd time around; I don't see any way to do anything with it. Confused Sad
Next job [when there's some time to spare] is to look for instructions/manual.

2. @RetroTechGuy
Your instructions make sense to me, so I'll have a go as soon as I have time to spare.
One doubt/uncertainty:
Why .flv in...
Code:
bruce .flv

When I don't have any .flv files?
Shouldn't I specify the extension of the file I wish to convert?
Or doesn't it matter because the program will convert any/all video files held in the folder within which the console->program is run?
Back to top
View user's profile Send private message 
RetroTechGuy


Joined: 15 Dec 2009
Posts: 2673
Location: USA

PostPosted: Tue 04 Jan 2011, 13:41    Post subject:  

Sylvander wrote:
1. Tried another look at Avidemux, but it was no better 2nd time around; I don't see any way to do anything with it. Confused Sad
Next job [when there's some time to spare] is to look for instructions/manual.

2. @RetroTechGuy
Your instructions make sense to me, so I'll have a go as soon as I have time to spare.
One doubt/uncertainty:
Why .flv in...
Code:
bruce .flv

When I don't have any .flv files?
Shouldn't I specify the extension of the file I wish to convert?
Or doesn't it matter because the program will convert any/all video files held in the folder within which the console->program is run?


Well, yes. If you extension is mp4, you enter that, and so forth (.flv seem to be the most common -- especially if you grab things from Youtube).

_________________
Add swapfile
Back to top
View user's profile Send private message 
Makoto


Joined: 03 Sep 2009
Posts: 1820
Location: Out wandering... maybe.

PostPosted: Tue 04 Jan 2011, 14:34    Post subject:  

Open some of the videos that do work on the Bravia in MediaInfo, in Tree View. You should be able to cut and paste the information that you get from those videos; they'll give some indication as to what the Bravia expects from a video. Theoretically, any video you convert will probably have to match most or all of those details.

Yes, AVIDemux does tend to require a bit of a learning curve. Neutral You might take a look at the user guides in the "Guides and How to's:" section on this page: http://www.videohelp.com/tools/AviDemux#download. Here's a direct link to the "How to get started with avidemux, edit and convert any video format" guide listed on that page - though I'm not sure Baldrick's guide is specific enough for someone completely new to AVIDemux. Embarassed

Edit: Hmm... wonder if Handbrake (http://handbrake.fr/downloads.php) might work/help, in this case. (I don't use it, so I tend to forget about it.) Unfortunately, the few specific topics I found on this forum, with .pet packages, reportedly have dead links.

_________________
[ Puppy 4.3.1 JP, Frugal install | 1GB RAM | 1.3GB swap ] * My Pidgin Builds for Puppy 4.3.1+
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11131
Location: The Peoples Republic of California

PostPosted: Wed 05 Jan 2011, 08:03    Post subject:  

Sylvander (et al),

My idea in using ffmpeg presets was primarily to make getting started
easy for you.

The presets are optimized to keep quality high. They are easy to use.
They are not, however, optimized for small output files.

RetroTechGuy noted he could get smaller file sizes using his user defined
parameters to .avi format. And the quality was as good or better than the
preset.

What I think is the primary problem. Our video files are compressed files.
The compression type is lossy, meaning we lose information in making
even the original file. When we convert from one compression format to
another it is very easy to introduce even more losses in the output file.

With computers, a copy operation produces an identical copied file.
Multimedia format conversion is different. Care must be taken to keep
losses to a minimum, if minimal losses are desired effect.

We can for example, tell ffmpeg to sample abc at 4000, but the orginal
only sampled abc at 1000. We keep loses down by overkill, but we end up
with a larger output file.

If the original sampled abc at 1000 and we only sample it at 500, we
introduce losses.

Quote:

Still confused. Confused Sad
We dummies like GUI's.
I'm getting on in years, and may be dead before I ever learn about coding.
Should I want to waste my remaining years learning such stuff?


Scripts are for lazy people. Suppose I want to play Celtic Woman songs. I
simply type 'celtic' on the CLI and the rest is done for me.

I took interest in this topic AFTER learning the GUI didn't work right for
you. And because the GUI didn't work right for you.

BTW - after reading the posts in this topic, I installed WinFF, another GUI
for ffmpeg. It looks great, but I have to figure out somethings about how
it uses presets.

In the meantime, I recommend anyone to install it. I got mine from a
Debian archive. I opened the archive and manually installed it.

I'm thinking what to do next.

Bruce

~

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 3557
Location: West Lothian, Scotland, UK

PostPosted: Wed 05 Jan 2011, 14:20    Post subject:  

1. For a moment there I thought I'd succeeded.
Managed to [use FFConvert to] convert a mov file to an mp4, with no sign of reduced quality, but...
When played on the Sony TV...
Only the sound could be heard [codec = libfaac]...
No images [codec = mpeg4].
See 3 below.

2. Previous to this, I'd used Avidemux to "Open" a file [ra.mp4] that plays OK on TV, and looked at its "Properties" as follows:
Video:
codec 4cc: H264
Image size: 1920x800
Aspect ratio: 1:1
Frame rate: 23.976 fps
Frame count: 158972 frames
Total duration: 01:50:30.463
---------------------------------
Global motion compensation: no
Packed bitstream: no
Quarter pixel: no
---------------------------------
Sound:
Codec: AAC
Channels: Stereo
Bitrate: 16000bps/128kbps
Variable bitrate: no
Frequency: 48000 Hz
Total duration: 02:18:10.759
File size 126.51 MB
---------------------------------

3. Using FFConvert:
To convert mov to mp4.
Config choices made [right or wrong?]
-------------------------------------------
Preset = mpeg4-avc
Video:
Codec: mpeg4[didn't play on Sony], H263[complained of error]
Quality: Same as source [sas]
Bitrate (kbps) = 16000
Screensize = sas
Aspect ratio = 16;9
Frame rate = sas
--------------------------
Audio:
Codec = AAC[error], libfaac [suggested by error message, and worked]
Bitrate (kbps) = 128
Sampling (Hz) = same
Channels = sas
--------------------------
File format = mp4
Processing = 1-pass
--------------------------

4. More to follow when time permits.
Back to top
View user's profile Send private message 
RetroTechGuy


Joined: 15 Dec 2009
Posts: 2673
Location: USA

PostPosted: Wed 05 Jan 2011, 15:23    Post subject:  

Sylvander wrote:
1. For a moment there I thought I'd succeeded.
Managed to [use FFConvert to] convert a mov file to an mp4, with no sign of reduced quality, but...
When played on the Sony TV...
Only the sound could be heard [codec = libfaac]...
No images [codec = mpeg4].
See 3 below.


[...snip...]

Do you know what codec the Sony TV is looking for?

For example, this guy pulled them from his manual:

http://avidemux.org/admForum/viewtopic.php?id=7979

It is my understanding the ".mp4" is simply a wrapper (as is ".avi"), and the contents/codecs are what matter for playback.

_________________
Add swapfile
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11131
Location: The Peoples Republic of California

PostPosted: Wed 05 Jan 2011, 16:22    Post subject:  

Sylvander,

For output to Television maybe the dvd preset is
the one to use. I don't know.

replace vcd and try various others, e.g:

dvd dv dv50 pal-vcd ntsc-svcd


ffmpeg -i ${fn}$1 -target vcd -y ${fn}.mpg

Then use ffplay to test the output file. Learn what target types work.

ffplay filename.mpg

If it looks good send it to the television, see what happens.

Report back

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 5 [69 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1337s ][ Queries: 12 (0.0047s) ][ GZIP on ]