Log in

View Full Version : h264enc for Linux


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 [14] 15

microchip8
4th February 2014, 20:06
Shouldn't they do different things?
"-ao null" = should dump the audio output to null, but still do audio processing (scanning for audio streams)
"-nosound" = disable all audio processing
since '-ao null' is an mplayer only option, don't you also use mencoder?

Current SVN mplayer, when used with -nosound, seems to process the whole input even though I told it to just process 1 frame (-frames 1). I accidentally found this while trying to "unlock" a DVD disc. It was trying to process the whole disc while the intended behavior should be to just process 1 frame. Replacing -nosound with -ao null brought back the intended behavior

-ao null is only used in the mplayer code, not mencoder

Selur
5th February 2014, 04:51
Yeah, latest mplayer is broken in a lot of place, see: https://trac.mplayerhq.hu/ticket/2172#comment:5 (seems like trac.mplayerhq.hu is down atm.)
-ao null is only used in the mplayer code, not mencoder
ah okay, if you find a way in mencoder to avoid -nosound and still disable audio processing, please let me know.

microchip8
13th February 2014, 03:04
ChangeLog for version 9.8.0
* Bugfix: dumping subs did not work when input is a VIDEO_TS DVD folder. Patch by Harry Gunnarsson

Selur
28th February 2014, 21:35
Stumbled over https://sourceforge.net/p/opencore-amr/mailman/message/31945744/ (I'm also interested to include aac-enc into Hybrid on MacOSX and would also require pipe support) and read:
This means that you're trying to write a 32 bit float wav. It only supports 16 bit integer wav files. I'm not sure how to specify this in mplayer syntax though.
If you add "-af format=s16le" to your mplayer call the output should be 16bit.

microchip8
28th February 2014, 21:59
Stumbled over https://sourceforge.net/p/opencore-amr/mailman/message/31945744/ (I'm also interested to include aac-enc into Hybrid on MacOSX and would also require pipe support) and read:

If you add "-af format=s16le" to your mplayer call the output should be 16bit.

Ah, thanks! But I'm waiting until the named pipe support is available in upstream before I add support for fdk-aac, so users don't have to compile a "special" branch from git

Selur
1st March 2014, 09:22
Did it work for you?
I just tested:
1. created fifo:
mkfifo -m 777 /Users/selur/Desktop/temp/HybridTempPipe_08_04_53_9610_02_audio.wav
2. connected main process to pipe:
"/Users/selur/aac-enc" -r 128000 -t 2 "/Users/selur/TempPipe_08_04_53_9610_02_audio.wav" "/Users/selur/Desktop/temp/iId_1_aid_0_DELAY_-43ms_08_04_53_9610_02.aac"
3. feed pipe:
"/Users/selur/ ffmpeg" -y -threads 2 -v -10 -i "/Users/selur/Desktop/temp/iId_1_aid_0_DELAY_-43ms_08_04_53_9610_01.aac" -ac 2 -ar 44100 -f sox - | "/Users/selur/sox" --multi-threaded --ignore-length --temp "/Users/selur/Desktop/temp" --buffer 524288 -S -t sox - -b 16 -t wav "/Users/selur/Desktop/temp/TempPipe_08_04_53_9610_02_audio.wav" rate 48k
problem is that the output is only 682 byte large.
(the sox part is used to make sure the output is 16 bit wav)

My guess is that something like 'ignore length' might be needed. (since the header of the wave sox will output, will have a wrong length)
If I don't use the named pipe but simply use intermediate files everything works, so seems to me that the pipe support isn't working. :(

Cu Selur

Ps.: open an issue in the bug tracker

microchip8
1st March 2014, 10:32
Doesn't work here either, get a 512 bytes output and a message "Could not seek to start, WAV size headers not updated!"

Selur
1st March 2014, 19:03
Got some feedback to the issue in the bug tracker and sox seems to use slightly other wav headers than ffmpeg -> I'll have to wait for sox wave header support ;)
Update:
-> sox problem got fixed by using normal and not named pipes :)
But now I found a new problem, aac-enc doesn't like wav files with more than 2 channels. :(

microchip8
12th March 2014, 17:12
Martin told me to pull the latest from this branch https://github.com/mstorsjo/fdk-aac/commits/read-streamed-wav
So I did and compiled it. It now works when encoding from a named pipe

mkfifo audio.wav
/usr/local/bin/aac-enc -r 96000 -t 2 -a 1 audio.wav output.aac &
mplayer Sample720p60.ts -vo null -vc dummy -af format=s16le -ao pcm:fast:file=audio.wav

This produces a file that can be played by both mplayer and vlc (didn't test others)

So when these changes land in the stable branch, I'll add support for this encoder in h264enc :)

Selur
12th March 2014, 18:54
Yup, now multi-channel input works fine. :)

microchip8
21st March 2014, 00:49
ChangeLog for version 9.8.1

* Set the default crop rounding value to 4 for more accurate cropping
* Initial support for the FDK AAC audio encoder. Requires latest git from https://github.com/mstorsjo/fdk-aac/commits/read-streamed-wav

microchip8
22nd March 2014, 19:39
ChangeLog for version 9.8.2

* Bugfix: for subsequent audio tracks, when using neroAacEnc as encoder, the value of --aac-is-sbr used for HE-AAC by mkvmerge was set to 1:1. It should be 0:1
* Use the AACTYPE variable instead of the aacprof variable to check which type of AAC the user wants in the neroaac_audio_func() function
* In VBR mode for audio encoders that support it, indicate which values result in better quality, ie based on the encoder a lower value results in higher quality or the reverse

microchip8
23rd March 2014, 19:04
ChangeLog for version 9.8.3

* Bugfix: If using nosound and dumping subsequent subs, the audio option for MEncoder was set to -ao null which is not recognized by MEncoder.
Change it to -nosound instead

microchip8
24th March 2014, 17:54
ChangeLog for version 9.4.8

* Add audio encoder info to the MKV global tags
* Renamed the mencoder_opts() function to mencoder_opts_func() for consistency reasons
* Fixed subtitles metadata info in the MKV global tags

microchip8
28th March 2014, 18:48
ChangeLog for version 9.8.5

* Use a single variable for keyint for the Blu-ray/AVCHD presets. Reduces a bit of duplication
* Reduced some duplication in the check_audio_codec_func() function by moving some of the error messages into a new audio_codec_exit_func() function
* Allow muxing to TS when using neroAacEnc and/or FDKAAC in LC-AAC mode
* Merged the NEROAAC/FDKAAC parts in the mkvmerge code as they're identical, thus we reduce a bit of duplication
* Updated the man page

microchip8
28th March 2014, 19:41
ChangeLog for version 9.8.6

* Fix a syntax error

microchip8
29th March 2014, 13:42
ChangeLog for version 9.8.7

* Merged the neroaac/fdkaac part of the MP4Box code as they're identical
* Use a case statement to decide between --bluray and --avchd for tsMuxeR
* A few more function renaming to carry the _func at the end

microchip8
7th April 2014, 20:06
ChangeLog for version 9.9.0

* Initial, basic support for encoding from Blu-ray discs/ISOs/directories. Requires MPlayer to be compiled with libbluray. As libbluray doesn't support encrypted Blu-rays,
it is not possible to encode such Blu-rays. Encryption must first be stripped before encoding with h264enc
* Reduced some duplication in the audio code for the first track for MKV
* Adjusted the vbv_maxrate and vbv_bufsize for the bd40 and bdhq40 presets to comply with the level limits

microchip8
8th April 2014, 08:25
ChangeLog for version 9.9.1

* Fixed not being able to calculate video bitrate for target file size when input is Blu-ray, due to missing $demuxer variable when calling MPlayer
* Fixed DVD scanning in the -scan option
* Support Blu-ray scanning in the -scan option
* Display in the -sc option if MEncoder has Blu-ray support
* Warn and exit if user chooses Blu-ray as input but MEncoder doesn't support it
* Placed the $device and $vid variables after the $MPLAYEROPTS one in order for the custom MPlayer options not to possibly overwrite these variables
* Modified the get_devices_func() function to allow files/folders as input so that a user can scan a DVD ISO or VIDEO_TS directory, not just discs
* Fixed the colorprim code. $device and $vid variables were missing when calling MPlayer to get the resolution height

microchip8
9th April 2014, 16:25
ChangeLog for version 9.9.2

* Allow importing of mks (Matroska stream) subtitles into MKV. Such files are usually created when dumping subs with the GUI version of mkvmerge
* Add -nosub when importing external subtitles into MKV/MP4/OGM to prevent auto-loading of any embedded subs in the input file
* Use case statements to check the values of the $MAX_AMOUNT_AUD_TRACKS and $MAX_AMOUNT_SUBS variables
* Auto-cropping was not possible when input is Blu-ray due to missing bd param in the case statement
* Set default audio channels decode option to 6 when input is Blu-ray

microchip8
10th April 2014, 19:50
ChangeLog for version 9.9.3

* Display the length in seconds and minutes for every found Blu-ray title
* Implemented basic chapters encoding support for Blu-rays
* Rewrote the code for subtitles imports for MKV/MP4/OGM
* For DVDs/BDs, set default channels value to 6 when using other than copy for audio

microchip8
12th April 2014, 00:08
ChangeLog for version 9.9.4

* Cosmetics: add an echo between the total found titles for Blu-ray and the info about each title
* Cosmetics: remove double-quotes in empty echo's
* Display full seconds value for each found Blu-ray title
* Small code optimization to Blu-ray chapters info. Use a single variable that holds the title we need to scan for chapters
* Warn and fallback to 8 channels in case user provides more than 8 channels
* Added support for PCM audio for subsequent audio tracks

microchip8
12th April 2014, 14:56
ChangeLog for version 9.9.5

* Improved resolution detection for Blu-rays
* Improved the nlq preset
* Don't call the audio_channels_decode_func when copying the audio as audio is copied 1:1 thus we don't need to set any channels
* Insert the channels filter in case the user wishes to have 4 or 5 audio channels when decoding higher or lower amount of channels
* Various small code improvements

microchip8
13th April 2014, 12:37
ChangeLog for version 9.9.6

* Rewrote the audio_channels_decode_func() function. It is now possible to output channels different that the decoded
channels amount. Note that this filter is very basic which means it will output silent channels if the decoded channels
are less than the output channels
* Added chanfilter variable to the aac_hev2_func() function
* Support all supported channels in the PCM bitrate code for target file size calculation
* Removed channels variable for MEncoder when copying audio for subsequent tracks as it has no effect
* Display an informative message if the user has set a default audio codec in the config file. Also check if we support it
or print an error message and exit
* Updated the channels metadata info code due to changes in the audio_channels_decode_func() function
* Modifications to the audio_filters_func() and audio_filters_var_func() functions
* Some small code cleanups

lib3rty1
14th April 2014, 22:16
hi,
is there chance to set up hardcoded subtitles size ?

microchip8
14th April 2014, 22:39
hi,
is there chance to set up hardcoded subtitles size ?

What do you mean? You want to scale subs in size? Like make them bigger or smaller? If so, I looked at the manpage of MPlayer and could only find the subfont-text-scale but it did not work as expected. If you do find out, drop me a message and I can add it to the script

lib3rty1
14th April 2014, 22:47
What do you mean? You want to scale subs in size? Like make them bigger or smaller? If so, I looked at the manpage of MPlayer and could only find the subfont-text-scale but it did not work as expected. If you do find out, drop me a message and I can add it to the script

Yes I wish to make them bigger as autoscale makes them too small.

I know that there is only subfont-text-scale,
It didn`t work as you expected ? what do you mean by that ?
have you used true type fonts ?
maybe it was font problem ?

microchip8
14th April 2014, 22:53
Yes I wish to make them bigger as autoscale makes them too small.

I know that there is only subfont-text-scale,
It didn`t work as you expected ? what do you mean by that ?
have you used true type fonts ?
maybe it was font problem ?

Yes, used true type fonts. That said, I'm not very good with subs (barely use them) so if you know how to do it, post the parameters and I'll add it to the script

microchip8
15th April 2014, 12:00
ChangeLog for version 9.9.7

* Allow the channels filter for the portable device presets
* Reorder the audio filters positions
* Placed the $MENCOPTS variable in front in MEncoder in order for it to not overwrite the options already set
* For AC-3 audio, default to 384 kbps instead of 192 kbps and default to "Film Standard" as DRC profile
* For MP3 audio, default to 192 kbps instead of 128 kbps when doing CBR encodes and to "standard" when using a preset
* For NEROAAC and FDKAAC, default to 128 kbps instead of 96 kbps when using LC-AAC mode
* Better wording in what the Output option does in the audio_channels_decode_func() function
* Modification to the audio_codec_exit_func() function. Use this function also to exit in case of an unsupported audio codec.
By using this function, some repeatability is removed
* Fixed a bug in the PCM audio code for the calculation of video bitrate for a target file size. Variable $AUDIO_BITRATE should
be an array variable instead of a normal one
* Added support for Blu-ray angle encoding
* Reduced some duplication by placing the message into a single variable when we exit in case an audio encoder is missing
* MEncoder currently has issues with copying audio. Work it around by using -mc 0 -msglevel demuxer=-1 options which disable
its automatic A/V sync. With this, MEncoder may report 0 or some large random number on some files for the audio but one can
safely ignore it. Audio is still being copied
* If the user chooses audio copy and selects to remux the encode to MKV, the global tags did not contain the audio encoder string.
Fix this by adding "Unknown (Stream Copy)" since we don't know which program was used to encode the audio
* In case we try to copy AAC audio from the input, we need to pass the correct format to MEncoder or it will error out. Thus, use
-fafmttag 0x706d if we detect AAC
* Fixed a bug where copying AAC audio as as subsequent track did not result in that track being added when remuxing to MP4 due
to a missing ffaac param in the case statement
* When doing video bitrate calculations for a target file size and copying the audio, try to better detect the audio bitrate. If we
can't detect it or it's reported as 0 kbps, default to 0 kbps
* Small improvements and cleanups here and there

microchip8
16th April 2014, 09:47
ChangeLog for version 9.9.8

* Use proper extensions when copying the audio as MP4Box has a problem with recognizing the .raw extension
* Renamed the named pipe from audio.wav to audio.pipe. Also placed it in a variable to reduce some minor duplication
* Added support for subtitle scaling for when hardcoding an external sub or hardcoding an embedded one. Requested by
lib3rty1 from the the Doom9.org forum
* Added --no-chapters option to mkvmerge for when encoding with neroAacEnc in order not to auto-copy chapters
info from the container
* Instead of defaulting to 0 kbps if we can't detect the audio bitrate when copying audio and needing to calculate the
video bitrate for a target file size , ask the user to provide it in case he knows it or can figure it out
* Set the default exponent strategy value for AC-3 to 16
* Placed frequently used MPlayer options into a single variable, $MPOPTS, in order not to write them over and over
again when we need them. These options are not used everywhere as sometimes we need other specific ones when detecting something
* Improved priority level checks for regular users if the PRIORITY variable is set in the config file
* Bugfix: audio resampling was not possible for Blu-rays due to missing bd param in the case statement
* Merge the Blu-ray output code with that of the file/vcd as it's identical
* Some minor code optimizations

microchip8
17th April 2014, 19:04
ChangeLog for version 10.0.0

* Allow the video_subtitles_align_func() function for mks matroska subtitles
* Display the warning message in red for when something goes wrong when importing/hardcoding subs.
Do the same for when checking support for a sub format for MKV/MP4/OGM
* Added support for subtitles for Blu-ray encodings. Note that only hardcoding of external sub or importing
of external subs into the MKV/MP4/OGM containers is supported
* Removed some duplication by placing the code for hardcoding an external sub or importing external subs
into its own video_subtitles_option_func() function
* Increased the rc_lookahead value for the ehq, uhq and ihq presets to 80, 90 and 100, respectively
* When copying audio and using some of the portable device presets, also add the -mc 0 -msglevel demuxer=-1
options to MEncoder
* More code optimizations and minor fixes

microchip8
22nd April 2014, 07:41
ChangeLog for version 10.0.1

* Bugfix: wrong var used, $chanuse instead of $chandec, for setting the decode channels
* Only call the video_subtitles_scale_func() function if the user actually provides an external sub for hardcoding

microchip8
23rd April 2014, 08:08
ChangeLog for version 10.0.2

* Bugfix: in case user chooses audio copy, the metadata info for tagging always defaulted to "Stereo".
Fix this by running MPlayer to detect the proper amount of channels

microchip8
26th April 2014, 08:49
ChangeLog for version 10.0.3

* Removed unused $AUDFIFO variable
* Small bugfix: audio language for metadata tagging wasn't added to the global tags for MKV when input is Blu-ray due to missing 'bd' param in the case statement

microchip8
22nd May 2014, 18:02
ChangeLog for version 10.0.4

* Bugfix: $demuxer var was missing in the AUDCH array var which resulted in incorrect channel info being added to the tags when copying audio.
DVD input was not affected by this bug, but file/dir/bd input was as they all use the $demuxer var

microchip8
24th May 2014, 13:20
ChangeLog for version 10.0.5

* Fixed the detect_fps_func() function for detecting the NTSC type
* Lowered the spugauss (variance param for gauss subtitle scaling) from 0.7 to 0.4 as 0.7 does too much blurring in my opinion

microchip8
12th June 2014, 07:13
ChangeLog for version 10.0.6

* Added support for dumping chapters info from MKV/MP4 input files. This updates the config file version to 30 as mkvextract is needed
* Made the audiofmt variable an array variable
* Moved asking for sample encoding before asking to inspect or save the options to a file

microchip8
15th June 2014, 13:25
ChangeLog for version 10.0.7

* Use an if instead of a case when dumping chapters from files
* Also export chapter extraction commands to the batch file
* Display mkvextract availability when using the sanity check option (-sc)
* Add the path and name to the comment block of the batch file. Makes it easy to focus on the comment block to know for which file the commands are instead of needing to inspect the code itself to find out

microchip8
16th June 2014, 20:15
ChangeLog for version 10.0.8

* New method to detect and display audio info when input is file or blu-ray. In comparison to the previous basic method, the new one will display for each found audio track the codec, channels, language, bitrate and sample rate info. It does take slightly longer to detect in case there are many audio tracks, but it is more descriptive and accurate

microchip8
17th June 2014, 13:44
ChangeLog for version 10.0.9

* Bugfix: only call audio filters on subsequent tracks when running MPlayer to decode since for the first track we already pass these filters to MEncoder, thus if we also use them when running MPlayer we'll get a double effect
* Add a ^ (caret) at the beginning of grep when trying to get the [lavf] text to make sure we only grep the correct instances
* Set default CRF/QP value to 19 and for bitrate based encodes to 2000 kbps
* For the volume audio filter, set the default value to 3 as 5 is a bit high

microchip8
18th June 2014, 08:53
ChangeLog for version 10.1.0

* When scanning for audio tracks when input is file or blu-ray, rename DCA (as reported by lavf) to DTS to not confuse the user. Also rename AC3 to AC-3 for consistency
* In case audio encoder is fdkaac, add to the MKV tags the audio format used (eg, Signed 16-bit little endian)
* When dumping chapters from files, use the file extension .chaps for MKV. Also test to see if there's already a chapters file with the same name and rename it to .chaps.old
* aac-enc name in the MKV tags is not very descriptive, so add (fdkaac) to it
* Cosmetics

microchip8
19th June 2014, 11:18
ChangeLog for version 10.1.1

* Added support for the internal lavc AC-3 audio encoder. Now one can choose between the lavc encoder (default) and the aften encoder. The lavc encoder is set to default as aften has seen very little development in the past years and is not as good as the lavc one which is actively developed by the ffmpeg devs
* Fine-tune the volume filter by setting it to 4 after some tests
* Delete the file stored in the $AUDINFO variable
* When storing the MKV global tags while operating in batch mode, test the variable $DIRTAGS for not being empty
* Cosmetics: add a few echo's at specific places to separate the cmd lines in the batch file for better readability. Also add a comment block for the start of the MKV, MP4, TS and/or OGM muxing
* Bugfix in the MKV/MP4 tags: do not add channel info when using MP3. If we add channel info, it could result in "MP3 5.1" being added to the audio tags, which is obviously wrong as MP3 only supports stereo and mono channels
* Opus supports sampling rates from 8 kHz to 48 kHz. Support this in the resampling code

microchip8
20th June 2014, 08:42
ChangeLog for version 10.1.2

* Fix a possible problem when detecting audio tracks when input is file or blu-ray. We only grep for the generic word 'audio' which could result in also printing lines that are not audio tracks but somehow carry the 'audio' word in their tags. Fix it by using 'awk' before 'grep' to only print the fourth column where lavf reports what type of track it is
* Set default DTS bitrate to 755 kbps. Also check if we don't exceed the highest legal bitrate of 1509 kbps
* Due to a bug in the dcaenc encoder, floating-point WAV files get wrongly interpreted as 32-bit integer ones. Work around this by adding the format=s16le filter
* The 1536 kbps bitrate reported by MPlayer on some DTS files is technically 1509 kbps, if we have to be accurate. Account for this by substracting 27 kbps from the reported bitrate. Do the same for the reported 768 kbps bitrate which is actually 755 kbps
* Report the kHz in addition to the Hz when displaying audio info for found tracks
* When remuxing to MKV/MP4/OGM, instead of checking if a file is created to make a decision if it was successful or not, use return codes from the remuxing applications. Should be more reliable in telling the user if it really succeeded or not. Unfortunately tsMuxeR doesn't return anything so there's no other way than checking if there's an output file.
* Lowered the scale factor in the calcbits() function from 3 to 2. Also use | instead of @ as delimiter
* Tune a bit the subq values of the ani & anihq presets. Also turn on trellis on all decisions (trellis=2) for the anihq preset

microchip8
23rd June 2014, 21:05
ChangeLog for version 10.1.3

* Set the DRC profile for Aften to none
* Allow the volume filter to be used even if the volnorm one is used
* Added support for setting the DRC when using lavc for AC-3
* Added support for encoding to E-AC-3 audio through lavc

microchip8
24th June 2014, 18:49
ChangeLog for version 10.1.4

* Removed -mc 0 when encoding to E-AC-3 audio. It is not needed after some tests and A/V sync will be better in some cases
* Use a case statement instead of an if conditional when checking if audio encoder is fkdaac or dcaenc in order to insert the format filter
* Encode to AAC through MEncoder instead of using faac directly
* Renamed the aac_audio_func() function to faac_audio_func(). Also renamed the $MENCIN var to $MENCINPUT

microchip8
25th June 2014, 14:51
ChangeLog for version 10.1.5

* Updated the info on audio codecs supported by containers
* Updated the set_audio_codec_func() function
* Set the default IVTC filter to filmdint
* Accept floating point values for CRF/QP ratecontrol in the config file

microchip8
29th June 2014, 11:09
ChangeLog for version 10.1.6

* Add -mc 0, after some testing, for when encoding to E-AC-3 audio
* A lot of the supported audio codecs do not support more than 6 channels so limit the channels to a maximum of 6
* If aften is missing and user has selected it as encoder to use, fall back to the lavc encoder instead of exiting

microchip8
30th June 2014, 08:22
ChangeLog for version 10.1.7

* Renamed the variable priority_level to nicelevel
* Be more clear about the language code the user may use by mentioning that it's used for tagging
* Be more clear on the channels filter by stating it is very basic and it will create empty channels in case the output channels are higher than the input ones
* Add a 0 to the counter_func() function
* mkvmerge version 7.0.0 and higher automatically adds statistics tags to the created file. Offer an option in the config file to disable this. Updates the config file version to 31
* Add a note to the skeleton presets.cfg file that one must start the params with a : (colon)

microchip8
1st July 2014, 00:13
ChangeLog for version 10.1.8

* Fix syntax error in the ratio_and_pixels_func() function

microchip8
2nd July 2014, 00:04
ChangeLog for version 10.1.9

* Add -noskip to where -mc 0 is used
* Document the exit values used by the exit_func() function
* Made the sed syntax consistent
* Currently, we calculate the ratio and pixels in two places. One for when we don't scale and one for when we scale. Merge the code into the ratio_and_pixels_func() function to reduce some duplication
* When printing info on files/bd, increase the -channels to 8
* Tune the higher quality presets and the anime ones by tweaking the adaptive quants, psy and inloop deblocker for better quality
* Bugfix: in case we skip the audio channels filter when the provided channels is higher than 6, the array var audchannels was not reset