Page 1 of 1

AV-Converter for Puppy

Posted: Sat Jul 10, 2021 12:19 am
by rcrsn51

This is AV-Converter v2.4. The instructions are here.

[Edit] Removed due to lack of testing and feedback.


Re: AV-Converter for Puppy

Posted: Tue Jul 13, 2021 8:52 am
by greengeek

Just tried this in Tahr32 6.0.6 and it worked fine converting an mp3 to ogg, and also converting a sample wav file (downloaded from the web) to mp3.
(I also tried this against one of the MS adpcm files i had problems in another thread but it did not convert them - just flashed a window briefly but did not produce an output file)

Will give it a further test when i do some more cd ripping and video conversions (probably over the weekend).

Looks very useful and straightforward.


Re: AV-Converter for Puppy

Posted: Tue Jul 13, 2021 10:43 am
by rcrsn51
greengeek wrote: Tue Jul 13, 2021 8:52 am

(I also tried this against one of the MS adpcm files i had problems in another thread but it did not convert them - just flashed a window briefly but did not produce an output file)

Those tests were in Bionic64. It may be that the ffmpeg in Tahr32 cannot make the conversion.

Put AV-Converter in Debug mode. In the Config, set DEBUG="-hold". Run the test again. Select ADPCM from the From list.


Re: AV-Converter for Puppy

Posted: Tue Jul 13, 2021 6:35 pm
by greengeek
rcrsn51 wrote: Tue Jul 13, 2021 10:43 am

Put AV-Converter in Debug mode. In the Config, set DEBUG="-hold". Run the test again. Select ADPCM from the From list.

Thanks - this was successful.
I will attach one of the files here. It is from a pocket voice recorder which a hospital patient was using to amuse themselves during a long stay and I was asked to archive the files.

Question: The input selection field in the gui seems to suggest that a directory may be selected. Does this mean that a batch conversion can be done?


Re: AV-Converter for Puppy

Posted: Tue Jul 13, 2021 6:47 pm
by rcrsn51
greengeek wrote: Tue Jul 13, 2021 6:35 pm

Thanks - this was successful.

Excellent.

Question: The input selection field in the gui seems to suggest that a directory may be selected. Does this mean that a batch conversion can be done?

Yes. Drag a folder into the box. But this feature has not received much testing.

[Edit] I have posted v2.3 above that addresses some problems with batch converting.


Re: AV-Converter for Puppy

Posted: Wed Jul 14, 2021 4:26 am
by MochiMoppel

"This file is not MKV type!"

Yes, they are.
They play fine with ffplay.


Re: AV-Converter for Puppy

Posted: Wed Jul 14, 2021 7:16 am
by rcrsn51
MochiMoppel wrote: Wed Jul 14, 2021 4:26 am

"This file is not MKV type!"

Yes, they are.
They play fine with ffplay.

Please post the results of running the "file" command on the file. Also your Puppy version.

Older Puppies will simply identify it as "data". Newer Linuxes like the Starter Kit correctly identify it as "Matroska".


Re: AV-Converter for Puppy

Posted: Wed Jul 14, 2021 8:47 am
by MochiMoppel

sample_640x360.mkv: data
Slacko5.6


Re: AV-Converter for Puppy

Posted: Wed Jul 14, 2021 10:29 am
by rcrsn51
MochiMoppel wrote: Wed Jul 14, 2021 8:47 am

sample_640x360.mkv: data
Slacko5.6

I have posted v2.3.1 above that handles this. Please test.


Re: AV-Converter for Puppy

Posted: Thu Jul 15, 2021 3:29 am
by MochiMoppel

MKV => VOB OK
MKV => MP4 no file created
MKV => MP3 "Wrong conversion choice!"
Frankly I find this dialog a bit offensive. Puts the blame on the user and sounds like "You made a mistake, you idiot!". It *could* say "Sorry, this conversion is not yet supported". You may avoid this guessing game altogether and, depending on what was selected as source format, present only supported target formats in the dropdown box. This would require to change the deprecated (!) combobox widget to a comboboxtext widget.

Testfile /root/puppy-reference/audio/goodluck.m4a
M4A => MP3 "This file is not M4A type!"

Code: Select all

# file /root/puppy-reference/audio/goodluck.m4a
/root/puppy-reference/audio/goodluck.m4a: ISO Media, MPEG v4 system, version 2

Testfile /root/puppy-reference/audio/2barks.au
AU => MP3 debug:"unsupported audio format"
AU => WAV "Wrong conversion choice!"
Both conversions work fine when ignoring the "not AU type!" dialog and choosing MP4 as source.


Re: AV-Converter for Puppy

Posted: Thu Jul 15, 2021 11:03 am
by rcrsn51

Thanks for testing.

Here is some history. AV-Converter started out in the Starter Kit as an audio-only converter where every combination was supported and ffmpeg was not used at all (since it is not builtin). As I started to add some video conversions that required ffmpeg, vastly more combinations became possible. So I just selected ones that were useful to me and worked with my suite of test files.

Using the "file" tool to identify the codec is definitely problematic. The simpler approach would be to scrap everything and let ffmpeg figure out the codec. I may withdraw the program and rethink the whole thing.

"Wrong conversion choice!"

Point taken. I will change this if I decide to keep working on this version.

Code: Select all

MKV => MP4 no file created

That works with my examples. But MKV is a container format. What's inside may not always be compatible with MP4.

MKV => MP3 "Wrong conversion choice!"

That is fixable.

You may avoid this guessing game altogether and, depending on what was selected as source format, present only supported target formats in the dropdown box. This would require to change the deprecated (!) combobox widget to a comboboxtext widget.

That's more than I care to do with this version of the project.

Testfile /root/puppy-reference/audio/goodluck.m4a
M4A => MP3 "This file is not M4A type!"

M4A files are usually identified as "Apple iTunes". But this one is a valid M4A, so this is fixable.

Testfile /root/puppy-reference/audio/2barks.au
AU => MP3 debug:"unsupported audio format"
AU => WAV "Wrong conversion choice!"
Both conversions work fine when ignoring the "not AU type!" dialog and choosing MP4 as source.

In the old Audio-Converter, AU files were handled OK by lame. But it appears that some codec variations need ffmpeg. This is fixable. Although I don't think that AU is sufficiently common to make the effort under the current program structure.

I can see now where this is heading. It will be impossible to keep adding patches for each variation that appears. The only general-purpose tool has to be all-ffmpeg. Barring any more feedback, I will withdraw the project shortly.


Re: AV-Converter for Puppy

Posted: Thu Jul 15, 2021 11:40 am
by MochiMoppel
rcrsn51 wrote: Thu Jul 15, 2021 11:03 am

Here is some history. AV-Converter started out in the Starter Kit as an audio-only converter where every combination was supported and ffmpeg was not used at all (since it is not builtin).

Is this the reason why shinobar's FFConvert is not included in recent Puppies? It comes with my Slacko5.6, does a decent job and I assumed that it was present in all Puppies. Converts MKV => MP4 without problems (among other things).

That's more than I care to do with this version of the project.

Should you ever care to do that with future versions, here is a small demo:

Code: Select all

#!/bin/bash
echo '
<window>
<hbox>
	<comboboxtext>
		<variable>FROM</variable>
		<input>echo -e "WAV\nAU\nAVI\nMP3"</input>
		<action>refresh:TO</action>
	</comboboxtext>
	<comboboxtext>
		<variable>TO</variable>
		<input>[[ $FROM = WAV ]] && echo -e "MP3\nOGG\nFLAC"</input>
		<input>[[ $FROM = AU  ]] && echo -e "WAV"</input>
		<input>[[ $FROM = AVI ]] && echo -e "MP4\nMTS\nVOB"</input>
		<input>[[ $FROM = MP3 ]] && echo -e "MP4\nOGG\nAU"</input>
	</comboboxtext>
	<button label="Convert">
		<action>Xdialog -msg "Send \$FROM\$TO (=$FROM$TO) to function\nand do stuff" x</action>
	</button>
	<button></button>
</hbox>
<action signal="show">refresh:TO</action>
</window>' | gtkdialog -cs

Re: AV-Converter for Puppy

Posted: Thu Jul 15, 2021 11:51 am
by rcrsn51

Thanks.

Regarding your MKV conversion: Did you try DEBUG mode? I suspect that the ffmpeg in your slacko needs to use the older libfaac codec.


Re: AV-Converter for Puppy

Posted: Thu Jul 15, 2021 11:59 am
by MochiMoppel

Yes, I did, but I'm not masochist enough to decipher this stuff:

ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers
built on Jul 16 2013 10:17:34 with gcc 4.7.1 (GCC)
configuration: --prefix=/usr --cpu=i686 --enable-libmp3lame --enable-libx264 --enable-libfaac --enable-pthreads --enable-small --enable-postproc --enable-libvorbis --enable-gpl --enable-shared --enable-nonfree --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-debug --enable-bzlib --enable-zlib --enable-libspeex --enable-version3 --enable-runtime-cpudetect --enable-x11grab --enable-libdc1394 --enable-libschroedinger --enable-libtheora --enable-libxvid --enable-swscale --enable-libvpx
libavutil 52. 38.100 / 52. 38.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.100 / 55. 12.100
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 79.101 / 3. 79.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
[matroska,webm @ 0x807fd80] Unknown entry 0x55B0
Input #0, matroska,webm, from '/abc/sample_960x400_ocean_with_audio.mkv':
Metadata:
MAJOR_BRAND : isom
MINOR_VERSION : 1
COMPATIBLE_BRANDS: isomavc1
ENCODER : Lavf58.45.100
Duration: 00:00:46.62, start: 0.000000, bitrate: 2976 kb/s
Stream #0:0: Video: h264, yuv420p, 960x400 [SAR 1:1 DAR 12:5], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Metadata:
HANDLER_NAME : GPAC ISO Video Handler
ENCODER : Lavc58.91.100 libx264
DURATION : 00:00:46.550000000
Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp (default)
Metadata:
HANDLER_NAME : GPAC ISO Audio Handler
ENCODER : Lavc58.91.100 libvorbis
DURATION : 00:00:46.616000000
[libx264 @ 0x80bc800] using SAR=1/1
[libx264 @ 0x80bc800] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowCTZ SlowAtom
[libx264 @ 0x80bc800] profile High, level 3.0
[libx264 @ 0x80bc800] 264 - core 125 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=6 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=30 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[aac @ 0x80bd200] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.
[aac @ 0x80bd200] Alternatively use the non experimental encoder 'libfaac'.


Re: AV-Converter for Puppy

Posted: Thu Jul 15, 2021 12:11 pm
by rcrsn51
MochiMoppel wrote: Thu Jul 15, 2021 11:59 am

[aac @ 0x80bd200] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.
[aac @ 0x80bd200] Alternatively use the non experimental encoder 'libfaac'.

AV-Converter is hard-coded to use the modern aac codec with MP4s. In old Puppies, you could try adding "-strict -2" to the MP4OPTS config variable. But I have not tested this.


Re: AV-Converter for Puppy

Posted: Thu Jul 15, 2021 12:28 pm
by MochiMoppel
rcrsn51 wrote: Thu Jul 15, 2021 12:11 pm

In old Puppies, you could try adding "-strict -2" to the MP4OPTS config variable.

Yes, this works.


Re: AV-Converter for Puppy

Posted: Thu Jul 15, 2021 2:13 pm
by rcrsn51

FWIW, I have posted v2.3.2 above using the current structure, but with some changes.

In particular, there is now a message suggesting that some conversions could be done in two steps. For example, extracting the audio stream of an MP4 video to OGG format could be handled by first changing it to an MP3.

This is certainly not the most efficient procedure, but it avoids a major rewrite.

In many cases, you can do an unsupported conversion with the ANY-ANY method. For example, you could extract the audio from any video file by setting the ANYOPTS variable to "-vn -acodec copy".

But some conversions, like MP3 to MP4, make no sense. The end user should recognize this, so I can't see any great need for the program to shield them from making that selection. However, the latest version can now do the sane conversion of MP3 to M4A.

I will leave this version posted for a while.


Re: AV-Converter for Puppy

Posted: Fri Jul 16, 2021 9:27 am
by greengeek
MochiMoppel wrote: Thu Jul 15, 2021 11:40 am

here is a small demo:

Code: Select all

#!/bin/bash
echo '
<window>
<hbox>
	<comboboxtext>
		<variable>FROM</variable>
		<input>echo -e "WAV\nAU\nAVI\nMP3"</input>
		<action>refresh:TO</action>
	</comboboxtext>
	<comboboxtext>
		<variable>TO</variable>
		<input>[[ $FROM = WAV ]] && echo -e "MP3\nOGG\nFLAC"</input>
		<input>[[ $FROM = AU  ]] && echo -e "WAV"</input>
		<input>[[ $FROM = AVI ]] && echo -e "MP4\nMTS\nVOB"</input>
		<input>[[ $FROM = MP3 ]] && echo -e "MP4\nOGG\nAU"</input>
	</comboboxtext>
	<button label="Convert">
		<action>Xdialog -msg "Send \$FROM\$TO (=$FROM$TO) to function\nand do stuff" x</action>
	</button>
	<button></button>
</hbox>
<action signal="show">refresh:TO</action>
</window>' | gtkdialog -cs

I would like to use this as a template to rebuild some utilities I made on older puppies where combobox no longer works on newer puppies - is there any way to add extra informative text that illuminates the functions?

eg the word "to" between wav and mp3?

to.jpg
to.jpg (8.98 KiB) Viewed 828 times

or "input=" before or above wav and "output=" before or above MP3?
(hope that makes sense)

inputoutput.jpg
inputoutput.jpg (10.87 KiB) Viewed 828 times

Re: AV-Converter for Puppy

Posted: Fri Jul 16, 2021 10:01 am
by rcrsn51

I have posted V2.3.3 above.


Re: AV-Converter for Puppy

Posted: Fri Jul 30, 2021 12:43 pm
by rcrsn51

I have posted v2.4 above.


Re: AV-Converter for Puppy

Posted: Sun Oct 03, 2021 7:17 pm
by greengeek

Deleted. Should I be able to use v2.4 to convert a whole directory of wavs?
When I navigate to my wav directory and click OK in the chooser dialogue it insists on looking inside the directory and highlighting an individual file instead of allowing me to select the actual directory itself.

This is on a Tahr32 (6.0.6) derivative which has an old ffmpeg grafted into it as well as its inbuilt avconv (not that i would expect that to affect the chooser dialogue)

EDIT: now that i look back in the thread I see that you mentioned dragging a directory into the box (sorry my memory is bad) but I am wondering why the chooser won't allow selection of the directory directly? Is that easy to correct?