PDA

View Full Version : PS3, blu-ray cli help


juGGaKNot
3rd May 2009, 22:08
I finally finished my cli and i want to add support for muxing to other formats

right now i mux to avi mkv and mp4 and i just downloaded tsmuxer to setup for m2ts ( default ps3 format no ? )

What other formats ( containers ) can i mux to ? do xbox and wii have support for such things ? is mkv enough for standalone players ( with mkv suport )

And the other thing, right now i only use mp3 for the "pc" files

For ps3 i have to use ac3 ?
For blu-ray ?
For others ?

Links would be great if possible.

THNX, cheers.

juGGaKNot
4th May 2009, 10:08
Got tsmuxer working :

To make the .meta file i use :

echo V_MPEG4/ISO/AVC, %mypath%\temp\%mymovie%.264, fps=%myfps% >> "%mypath%\temp\%mymovie%.meta"
echo A_AC3, %mypath%\temp\%mymovie%.ac3 >> "%mypath%\temp\%mymovie%.meta"

To mux i use :

"%mypath%\bin\tsmuxer\tsmuxer.exe" %mypath%\temp\%mymovie%.meta %mypath%\%myts%.ts
"%mypath%\bin\tsmuxer\tsmuxer.exe" %mypath%\temp\%mymovie%.meta %mypath%\%mym2ts%.m2ts

Muxes fine but the sound does not "sound" right :

"%mypath%\bin\eac3to\eac3to.exe" %mypath%\%mymovie%.mp3 %mypath%\temp\%mymovie%.ac3 -448

Should i use wav ? will this make it sound like the original ?

The music is k but the "ingame sound" is not.

Also in the cli i get another thing

SmartLabs tsMuxeR. Version 1.8.4(b) http://www.smlabs.net
Decoding H264 stream (track 1): Profile: High@4.0 Resolution: 1024:576p Frame
rate: 30
0.0% complete
H264 bitstream changed: insert nal unit delimiters
Decoding AC3 stream (track 2): Bitrate: 448Kbps Sample Rate: 44KHz Channels: 2
Processed 899 video frames
100.0% complete
Mux successful complete.

Is this a problem ?

LE : fixed, sample deleted.

juGGaKNot
4th May 2009, 10:29
Got tsmuxer working :

To make the .meta file i use :

echo V_MPEG4/ISO/AVC, %mypath%\temp\%mymovie%.264, fps=%myfps% >> "%mypath%\temp\%mymovie%.meta"
echo A_AC3, %mypath%\temp\%mymovie%.ac3 >> "%mypath%\temp\%mymovie%.meta"

To mux i use :

"%mypath%\bin\tsmuxer\tsmuxer.exe" %mypath%\temp\%mymovie%.meta %mypath%\%myts%.ts
"%mypath%\bin\tsmuxer\tsmuxer.exe" %mypath%\temp\%mymovie%.meta %mypath%\%mym2ts%.m2ts

Muxes fine but the sound does not "sound" right :

"%mypath%\bin\eac3to\eac3to.exe" %mypath%\%mymovie%.mp3 %mypath%\temp\%mymovie%.ac3 -448

Should i use wav ? will this make it sound like the original ?

The music is k but the "ingame sound" is not.

Also in the cli i get another thing



Is this a problem ?

Nevermind, wav works great, searched the "insert nal unit delimiters" and saw that it is needed for ts, all fixed.

To move on :

What other formats ( containers ) can i mux to ? do xbox and wii have support for such things ? is mkv enough for standalone players ( with mkv suport )

And the other thing, right now i only use mp3 for the "pc" files

For ps3 i have to use ac3 ?
For blu-ray ?
For others ?

Links would be great if possible.

dat720
6th May 2009, 04:50
M2TS is not the default PS3 video container (no real such thing) it is in fact the official container for Bluray

Bluray supports AC3
PS3 supports multichannel AC3 in M2TS and AVI containers and multichannel AAC audio in MP4
Xbox 360 does not support MKV/M2TS, you can playback MP4's on Xbox 360 but they can't have multichannel audio they can only have stereo audio, to get multichannel audio you are pretty much limited to AVI using Divx/Xvid with AC3 or MP3 audio.

Others is pretty generic, every device is different, using different hardware/software.

juGGaKNot
6th May 2009, 12:04
M2TS is not the default PS3 video container (no real such thing) it is in fact the official container for Bluray

Bluray supports AC3
PS3 supports multichannel AC3 in M2TS and AVI containers and multichannel AAC audio in MP4
Xbox 360 does not support MKV/M2TS, you can playback MP4's on Xbox 360 but they can't have multichannel audio they can only have stereo audio, to get multichannel audio you are pretty much limited to AVI using Divx/Xvid with AC3 or MP3 audio.

Others is pretty generic, every device is different, using different hardware/software.

So MP4 with aac lc 2 channel audio will play k on ps3 and xbox right ?

thnx

buzzqw
6th May 2009, 12:28
yes, but must be NOT HE-SBR

BHH

juGGaKNot
6th May 2009, 14:23
yes, but must be NOT HE-SBR

BHH

Yes

"%mypath%\bin\eac3to\eac3to.exe" %mypath%\%mymovie%.wav %mypath%\bin\@temp\%mymovie%.m4a -quality=0.5

"%mypath%\bin\mkvtoolnix\mkvmerge.exe" --title "Encoded With AdvancedFX.org CLI By juGGaKNot" --attachment-description "Movie For XboX 360, PS3 And StandAlone Players" --attachment-mime-type txt --attach-file "%mypath%\bin\logo.txt" --default-duration %mykfps% --default-language eng --aac-is-sbr 0 -o %mypath%\Final_Movie.mp4 "%mypath%\bin\@temp\%mymovie%.264" "%mypath%\bin\@temp\%mymovie%.m4a"

-quality=0.5 > under 0.3 is HE right ?
--aac-is-sbr 0 > its lc so this must be 0 right ?

THNX, cheers

LE : btw i moved on to mp4 only because i have 2 ch audio only and it works on all of them, first try was a mess, MKV, MP4, AVI, M2TS and blu-ray output :

@echo off
:
: Change This :
:
set mypath=D:\matroska
set myvideocrf=22
set myfps=40
:
: DO NOT CHANGE THIS :
:
set mymovie=movie
set finalname=Da_Movie_Final
set mykfps=0:%myfps%fps
set myafps=%myfps%
rmdir /S /Q %mypath%\bin\@temp
mkdir %mypath%\bin\@temp
cls
echo Encoding Audio ( AC3, AAC And MP3 )
echo.
"%mypath%\bin\eac3to\eac3to.exe" %mypath%\%mymovie%.wav %mypath%\bin\@temp\%mymovie%.ac3 -448
"%mypath%\bin\eac3to\eac3to.exe" %mypath%\%mymovie%.wav %mypath%\bin\@temp\%mymovie%.m4a -quality=0.5
"%mypath%\bin\faac\faac.exe" -b 320 -o "%mypath%\bin\@temp\%mymovie%.mp3" "%mypath%\%mymovie%.wav"
echo.
echo Encoding X264 :
echo.
echo AVIsource("%mypath%\%mymovie%.avi") >> "%mypath%\bin\@temp\%mymovie%.avs"
echo Crop(0,0,-0,-0) >> "%mypath%\bin\@temp\%mymovie%.avs"
echo ConvertToYV12() >> "%mypath%\bin\@temp\%mymovie%.avs"
echo.
"%mypath%\bin\x264\x264.exe" --crf %myvideocrf% --stats "%mypath%\bin\@temp\%mymovie%.stats" --level 4.0 --ref 3 --bframes 3 --subme 6 --weightb --analyse all --8x8dct --qpmin 4 --qpstep 6 --merange 24 --me umh --progress --no-psnr --output "%mypath%\bin\@temp\%mymovie%.264" "%mypath%\bin\@temp\%mymovie%.avs"
echo.
echo Done, Muxing To MKV, MP4, AVI, M2TS Containers.
echo.
echo V_MPEG4/ISO/AVC, %mypath%\bin\@temp\%mymovie%.264, fps=%myfps%, insertSEI, contSPS, track=1, lang=eng >> "%mypath%\bin\@temp\%mymovie%.meta"
echo A_AC3, %mypath%\bin\@temp\%mymovie%.ac3, timeshift=0, lang=eng >> "%mypath%\bin\@temp\%mymovie%.meta"
echo MUXOPT --no-pcr-on-video-pid --new-audio-pes --blu-ray --vbr --auto-chapters=5 --vbv-len=500 >> "%mypath%\bin\@temp\%mymovie%2.meta"
echo V_MPEG4/ISO/AVC, %mypath%\bin\@temp\%mymovie%.264, fps=%myfps%, insertSEI, contSPS, track=1, lang=eng >> "%mypath%\bin\@temp\%mymovie%2.meta"
echo A_AC3, %mypath%\bin\@temp\%mymovie%.ac3, timeshift=0, lang=eng >> "%mypath%\bin\@temp\%mymovie%2.meta"
echo.
"%mypath%\bin\MP4Box\MP4Box.exe" -new -add "%mypath%\bin\@temp\%mymovie%.264#video" -add "%mypath%\bin\@temp\%mymovie%.m4a#audio" -fps %myfps% "%mypath%\%finalname%.mkv"
"%mypath%\bin\MP4Box\MP4Box.exe" -new -add "%mypath%\bin\@temp\%mymovie%.264#video" -add "%mypath%\bin\@temp\%mymovie%.m4a#audio" -fps %myfps% "%mypath%\%finalname%.mp4"
"%mypath%\bin\tsmuxer\tsmuxer.exe" %mypath%\bin\@temp\%mymovie%.meta %mypath%\%finalname%.m2ts
"%mypath%\bin\tsmuxer\tsmuxer.exe" %mypath%\bin\@temp\%mymovie%2.meta %mypath%\%finalname%.movie.bluray
"%mypath%\bin\avc2avi\avc2avi.exe" -f %myafps% -i %mypath%\bin\@temp\%mymovie%.264 -o %mypath%\bin\@temp\%mymovie%.avi
"%mypath%\bin\mkvtoolnix\mkvmerge.exe" --default-duration %mykfps% -o %mypath%\%finalname%.avi %mypath%\bin\@temp\%mymovie%.avi %mypath%\bin\@temp\%mymovie%.mp3

buzzqw
6th May 2009, 14:25
under 0.3 is HE right

Yes :)

BHH

juGGaKNot
6th May 2009, 14:55
Yes :)

BHH

THNX

Close.

buzzqw
6th May 2009, 15:12
since you are developing a cmd/batch application
you can mutuate some idea from my hdconverttox, since it work by command line too

BHH

juGGaKNot
6th May 2009, 17:27
since you are developing a cmd/batch application
you can mutuate some idea from my hdconverttox, since it work by command line too

BHH

Yes thnx, i will check out the "fps autodetect" part from your cfg because i need it for muxing.

Chech out http://forum.doom9.org/showthread.php?p=1282283 if you have time

cheers.

buzzqw
6th May 2009, 17:36
fps autodetect
i force analysis on input selection, so both parsing eac3to output and avisynth analysis i can "detect" framerate (check analyze.avs)

about "profile", again check "HDConvertToX_profile.txt", just for idea

BHH

juGGaKNot
6th May 2009, 19:33
i force analysis on input selection, so both parsing eac3to output and avisynth analysis i can "detect" framerate (check analyze.avs)

about "profile", again check "HDConvertToX_profile.txt", just for idea

BHH

I took a look but its a bit to advanced for now ( i write the analyze.avs on the hdd but i do not know how to execute it so that is writes the .txt with the fps ), i'm looking into a alternative as so :

"D:\x264\bin\ffmpeg\ffmpeg.exe" -y -i "D:\x264\movie.avi" > D:\x264\fps.txt
FINDSTR .00 > D:\x264\fps2.txt

1 thing left to do now, the BOLD part, i have to check out the ffmpeg documentation too see how can i output the console to a .txt file

I see that eac3to can also do it, looks easyer than ffmpeg, great.

buzzqw
6th May 2009, 19:47
ok... try ffmpeg.exe -i analyze.avs

BHH

juGGaKNot
6th May 2009, 21:41
ok... try ffmpeg.exe -i analyze.avs

BHH

echo AVIsource("%mypath%\%mymovie%.avi",audio=false) >> "%mypath%\bin\@temp\%mymovie%2.avs"
echo WriteFile("%mypath%\bin\@temp\info.txt", "Framerate") >> "%mypath%\bin\@temp\%mymovie%2.avs"
"%mypath%\bin\ffmpeg\ffmpeg.exe" -i "%mypath%\bin\@temp\%mymovie%2.avs"

lol, stupid me

LE : now i have to test what crf to use for some resolutions and write a autodetection script "if resolution <800 then crf=18" etc etc

works, close, i'm sure you have other important stuff to do.

buzzqw
6th May 2009, 22:35
LE : now i have to test what crf to use for some resolutions and write a autodetection script "if resolution <800 then crf=18" etc etc

why this ?

please, remember that resolution and bitrate don't have strinct relation

no, i don't understand your assumption

BHH

rack04
6th May 2009, 22:54
Using ffmpeg.exe -i analyze.avs I get a framrate of "23.976025". Is there a way to output the framerate to something more universal, i.e. 24000/1001 or 23.976? I'm asking because the framerate is then passed to mkvmerge which is expecting 24000/1001, tsMuxer which is expecting 23.976, or avisynth which is expecting 24000,1001.

juGGaKNot
6th May 2009, 23:05
why this ?

please, remember that resolution and bitrate don't have strinct relation

no, i don't understand your assumption

BHH

Well for CQ not for bitrate, lower resolution will need lower crf and higher res higher crf

so i'm thinking that :

if w <=640 then crf=18
if w <=800 then crf=19
if w <=1024 then crf = 20
if w <=1280 then crf = 21
if w <=1920 then crf =22

Will make good results, will see after i test the resolutons.

For the detection i use

echo AVIsource("%mypath%\%mymovie%.avi",audio=false) >> "%mypath%\bin\@temp\%mymovie%3.avs"
echo WriteFile("%mypath%\bin\@temp\res.txt", "WIDTH") >> "%mypath%\bin\@temp\%mymovie%3.avs"

BTW, found autocrop.dll in you setup, looks great

echo AVIsource("%mypath%\%mymovie%.avi") >> "%mypath%\bin\@temp\%mymovie%.avs"
echo ConvertToYV12() >> "%mypath%\bin\@temp\%mymovie%.avs"
echo LoadPlugin("%mypath%\bin\filters\autocrop.dll") >> "%mypath%\bin\@temp\%mymovie%.avs"
echo AutoCrop(0,16,16) >> "%mypath%\bin\@temp\%mymovie%.avs"

AutoCrop(0,16,16) will ensure that the video is mod 16 no ?

for ex if i have 800x600 it will crop to 800x592 right ?

LE : noob question : now that i have the .txt file with the fps how do i port it to mkvmerge ?

set my1fps=0:
set my2fps= << "%mypath%\bin\@temp\fps.txt"
set my3fps=fps
set mykfps=%my1fps%%my2fps%%my3fps%

Does not work

buzzqw
7th May 2009, 08:06
AutoCrop(0,16,16) will ensure a mod16 crop , but will crop only if needed, AND will not resize

i suppose you want use another filter "GripCrop" -> http://www.64k.it/andres/data/avisynth/GripFit_YV12.zip

about fps.. better to read the file and store the value on variable....

BHH

juGGaKNot
7th May 2009, 10:02
AutoCrop(0,16,16) will ensure a mod16 crop , but will crop only if needed, AND will not resize

i suppose you want use another filter "GripCrop" -> http://www.64k.it/andres/data/avisynth/GripFit_YV12.zip

about fps.. better to read the file and store the value on variable....

BHH

Perfect, i never want to resize or crop and i want automatic mod 16

thnx.

LE : yes,

set my1fps=0:
set /p my2fps=<"%mypath%\bin\@temp\fps.txt"
set my3fps=fps
set mykfps=%my1fps%%my2fps%%my3fps%

works fine for mkvmerge.

Well one more thing : auto detection of partition, how can i do it, some links ? now i use

set mypaths=d
set mypath=%mypaths%:\x264

so it needs the partition from the user.

buzzqw
7th May 2009, 17:06
you can force to use the CURRENT partition ... ?
or ask for it

BHH

juGGaKNot
7th May 2009, 17:22
you can force to use the CURRENT partition ... ?
or ask for it

BHH

Well how can i force it to use CURRENT director ?

example might help, i will look up CURRENT cvar.

thnx.

buzzqw
7th May 2009, 20:05
just analyze to "cd" what return

BHH

juGGaKNot
8th May 2009, 09:54
just analyze to "cd" what return

BHH

cd > "dir.txt"
set /p mypath=<"dir.txt"

Works fine, testing.

J_Darnley
8th May 2009, 12:17
Why set another environment variable when %CD% already exists?

buzzqw
8th May 2009, 13:45
@J_Darnley
juGGaKNot don't set a variable.. just launch "cd" , pipe output to file, then read file and store the value

so its application know where is working

BHH

juGGaKNot
8th May 2009, 16:02
Why set another environment variable when %CD% already exists?

@J_Darnley
juGGaKNot don't set a variable.. just launch "cd" , pipe output to file, then read file and store the value

so its application know where is working

BHH

Yes, and it works fine as long as i use "" on all the programs ( if there is no "" and the path has spaces ( x:\new folder ) it will not work ).

J_Darnley
8th May 2009, 16:12
@J_Darnley
juGGaKNot don't set a variable.. just launch "cd" , pipe output to file, then read file and store the value

so its application know where is working

BHH
Yeah he does. He sets the environment variable %mypath% to the output from cd via dir.txt. Okay, if you want to store the current directory and then move you would want to create another var. but that could done with simply: set mypath=%CD%

juGGaKNot
9th May 2009, 22:28
It is almost done.

echo AVIsource("%mypath%\%mymovie%.avi",audio=false) >> "%mypath%\bin\@temp\%mymovie%3.avs"
echo WriteFile("%mypath%\bin\@temp\res.txt", "WIDTH") >> "%mypath%\bin\@temp\%mymovie%3.avs"
"%mypath%\bin\ffmpeg\ffmpeg.exe" -i "%mypath%\bin\@temp\%mymovie%3.avs"
pause
cls
set /p myres=<"%mypath%\bin\@temp\res.txt"
if %myres% GEQ 640 GOTO A1
:A1
if %myres% LEQ 799 GOTO A2
if %myres% GEQ 800 GOTO B1
:B1
if %myres% LEQ 1023 GOTO B2
if %myres% GEQ 1024 GOTO C1
:C1
if %myres% LEQ 1279 GOTO C2
if %myres% GEQ 1280 GOTO D1
:D1
if %myres% LEQ 1919 GOTO D2
if %myres% GEQ 1920 GOTO E1
:E1
if %myres% LEQ 2560 GOTO E2
:A2
SET CQ=19
GOTO END
:B2:
SET CQ=20
GOTO END
:C2
SET CQ=21
GOTO END
:D2
SET CQ=23
GOTO END
:E2
SET CQ=24
ECHO CQ
:END

What do you think ?

If WIDTH range is 640-800 then x264 cq 19 / xvid 2
If WIDTH range is 800-1024 then x264 cq 20 / xvid 2.5
If WIDTH range is 1024-1280 then x264 cq 21 / xvid 3
If WIDTH range is 1280-1920 then x264 cq 23 / xvid 3.5
If WIDTH range is 1920-2560 then x264 cq 24 / xvid 4

The final result will be one .exe file, you just add your uncompressed video and wav ( 1 or 2 tracks ), press it and magic.

juGGaKNot
10th May 2009, 22:59
What do you think ?

If WIDTH range is 640-800 then x264 cq 19 / xvid 2
If WIDTH range is 800-1024 then x264 cq 20 / xvid 2.5
If WIDTH range is 1024-1280 then x264 cq 21 / xvid 3
If WIDTH range is 1280-1920 then x264 cq 23 / xvid 3.5
If WIDTH range is 1920-2560 then x264 cq 24 / xvid 4


I also need to do a script for auto cpu detection, for xvid threads, auto does not work so ...

What program should i use, same syntax, read, write to file, write to variable.

BHH ? :P

dat720
11th May 2009, 11:05
Deleted previous post as it is unnessecary.... Found a easier way.

Go to a command prompt and do the following:
echo %NUMBER_OF_PROCESSORS%

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administrator>echo %NUMBER_OF_PROCESSORS%
1

C:\Documents and Settings\Administrator>

^^^ Running under a virtual machine, this PC is actually a quad core... so I assume it would display 4 if I wasn't running in a virtual environment....


Under VB.Net you could simply do this:
Dim ProcessorCount = Environment.ProcessorCount

If your looking at making a program you should be using a programing language, not a batch script converted to a EXE....

juGGaKNot
12th May 2009, 07:22
Deleted previous post as it is unnessecary.... Found a easier way.

Go to a command prompt and do the following:
echo %NUMBER_OF_PROCESSORS%

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administrator>echo %NUMBER_OF_PROCESSORS%
1

C:\Documents and Settings\Administrator>

^^^ Running under a virtual machine, this PC is actually a quad core... so I assume it would display 4 if I wasn't running in a virtual environment....


Under VB.Net you could simply do this:
Dim ProcessorCount = Environment.ProcessorCount

If your looking at making a program you should be using a programing language, not a batch script converted to a EXE....

I will not be making it because i do not know where to start, i want to get it final and that is it for my part.

THNX.

Close!