die PIPE klemmt

Yoda

[Linux|FreeBSD] - User
Hallo Leute,

seit vielen Monaten habe ich hin und wieder dieses Problem.
Ich kann nicht mal sagen was ich geändert habe, möglicherweise ein Update oder so, alles ist möglich... in der Vergangenheit hatte ich nichtmal ne Ahnung was das sein könnte.

Aber jetzt erstmal die Symptome:

Gelegentlich transcodiere ich meine vom TV aufgenommenen Filme
und da gibts dann diese Probleme:

Code:
mencoder SHOGUN.mpg -ovc raw -really-quiet -noskip -fps 25 -lavcopts threads=1 -lavdopts threads=1 -vfm ffmpeg -vf pp=ci,scale,softskip,harddup,format=i420 -oac copy -of rawvideo -rawvideo fps=25 -o - | x264 --fps 25 --crf 23  --profile high --threads 1 --b-adapt 2 --direct auto --slow-firstpass --no-fast-pskip --me tesa --merange 24 --partitions all --rc-lookahead 60 --ref 5 --subme 10 --trellis 2 --nr  0  --weightp 0 --bframes 3 --nal-hrd vbr --vbv-maxrate 12500 --vbv-bufsize 12500 --level 3.0 --keyint 24 --min-keyint 2 --b-pyramid strict --slices 1 --aud --colorprim bt709 --transfer bt709 --colormatrix bt709 --sar  16:15 -o SHOGUN_-_AVC_AAC_SD_Profilhigh_level30_720x576_videospur.mkv - 720x576
  
  raw [error]: raw input requires a resolution.
  x264 [error]: could not open input file `-'

Das Problem tritt auch auf, wenn ich die beiden Prozesse auseinander nehme:
Code:
mencoder SHOGUN.mpg -ovc raw -really-quiet -noskip -fps 25 -lavcopts threads=1 -lavdopts threads=1 -vfm ffmpeg -vf pp=ci,scale,softskip,harddup,format=i420 -oac copy -of rawvideo -rawvideo fps=25 -o SHOGUN_-_AVC_AAC_SD_Profilhigh_level30_720x576_videospur.yuv

cat SHOGUN_-_AVC_AAC_SD_Profilhigh_level30_720x576_videospur.yuv | x264 --fps 25 --crf 23  --profile high --threads 1 --b-adapt 2 --direct auto --slow-firstpass --no-fast-pskip --me tesa --merange 24 --partitions all --rc-lookahead 60 --ref 5 --subme 10 --trellis 2 --nr  0  --weightp 0 --bframes 3 --nal-hrd vbr --vbv-maxrate 12500 --vbv-bufsize 12500 --level 3.0 --keyint 24 --min-keyint 2 --b-pyramid strict --slices 1 --aud --colorprim bt709 --transfer bt709 --colormatrix bt709 --sar  16:15 -o SHOGUN_-_AVC_AAC_SD_Profilhigh_level30_720x576_videospur.mkv - 720x576

  raw [error]: raw input requires a resolution.
  x264 [error]: could not open input file `-'

Allerdings tritt der Fehler nicht auf, wenn ich die korrekte Syntax ohne Pipe anwende:
Code:
x264 --fps 25 --crf 23  --profile high --threads 1 --b-adapt 2 --direct auto --slow-firstpass --no-fast-pskip --me tesa --merange 24 --partitions all --rc-lookahead 60 --ref 5 --subme 10 --trellis 2 --nr  0  --weightp 0 --bframes 3 --nal-hrd vbr --vbv-maxrate 12500 --vbv-bufsize 12500 --level 3.0 --keyint 24 --min-keyint 2 --b-pyramid strict --slices 1 --aud --colorprim bt709 --transfer bt709 --colormatrix bt709 --sar  16:15 -o SHOGUN_-_AVC_AAC_SD_Profilhigh_level30_720x576_videospur.mkv SHOGUN_-_AVC_AAC_SD_Profilhigh_level30_720x576_videospur.yuv 720x576

Kann mir das mal einer erklären?

Wäre schön, wenn ich den Fehler beseitigen könnte.

Mit FIFO könnte ich das umgehen, allerdings zickt das immer rum, der mencoder bleibt immer stehen und der x264 bekommt dann keine Daten und beendet sich. Deshalb will ich keinen FIFO einsetzen.

Gruß
Yoda
 
Ich vermutete, dass diese PIPE's von der SHELL gehändelt werden, so habe ich die BASH neu gebaut, auch statisch gebaut...

Hat nix gebracht, hab dann mencoder neu gebaut und x264 neu gebaut... alles ohne Ergebnis.

EDIT:
In meiner Verzweiflung habe ich Ubuntu in einer VirtualBox installiert und den Transcodiervorgang dort laufen lassen.
Das ging, nur stürzte der FreeBSD-Rechner nach ca. 12-14 Stunden ab...
 
Zuletzt bearbeitet:
Code:
cat SHOGUN_-_AVC_AAC_SD_Profilhigh_level30_720x576_videospur.yuv | x264 --fps 25 --crf 23  --profile high --threads 1 --b-adapt 2 --direct auto --slow-firstpass --no-fast-pskip --me tesa --merange 24 --partitions all --rc-lookahead 60 --ref 5 --subme 10 --trellis 2 --nr  0  --weightp 0 --bframes 3 --nal-hrd vbr --vbv-maxrate 12500 --vbv-bufsize 12500 --level 3.0 --keyint 24 --min-keyint 2 --b-pyramid strict --slices 1 --aud --colorprim bt709 --transfer bt709 --colormatrix bt709 --sar  16:15 -o SHOGUN_-_AVC_AAC_SD_Profilhigh_level30_720x576_videospur.mkv - 720x576
Ist nicht sicher, cat kann da durchaus Probleme verursachen und ist hier sowieso überflüssig:
Code:
< _AVC_AAC_SD_Profilhigh_level30_720x576_videospur.yuv x264 --fps 25 --crf 23  --profile high --threads 1 --b-adapt 2 --direct auto --slow-firstpass --no-fast-pskip --me tesa --merange 24 --partitions all --rc-lookahead 60 --ref 5 --subme 10 --trellis 2 --nr  0  --weightp 0 --bframes 3 --nal-hrd vbr --vbv-maxrate 12500 --vbv-bufsize 12500 --level 3.0 --keyint 24 --min-keyint 2 --b-pyramid strict --slices 1 --aud --colorprim bt709 --transfer bt709 --colormatrix bt709 --sar  16:15 -o SHOGUN_-_AVC_AAC_SD_Profilhigh_level30_720x576_videospur.mkv - 720x576
 
Code:
cat SHOGUN_-_AVC_AAC_SD_Profilhigh_level30_720x576_videospur.yuv | x264 --fps 25 --crf 23  --profile high --threads 1 --b-adapt 2 --direct auto --slow-firstpass --no-fast-pskip --me tesa --merange 24 --partitions all --rc-lookahead 60 --ref 5 --subme 10 --trellis 2 --nr  0  --weightp 0 --bframes 3 --nal-hrd vbr --vbv-maxrate 12500 --vbv-bufsize 12500 --level 3.0 --keyint 24 --min-keyint 2 --b-pyramid strict --slices 1 --aud --colorprim bt709 --transfer bt709 --colormatrix bt709 --sar  16:15 -o SHOGUN_-_AVC_AAC_SD_Profilhigh_level30_720x576_videospur.mkv - 720x576
Ist nicht sicher, cat kann da durchaus Probleme verursachen und ist hier sowieso überflüssig:
Code:
< _AVC_AAC_SD_Profilhigh_level30_720x576_videospur.yuv x264 --fps 25 --crf 23  --profile high --threads 1 --b-adapt 2 --direct auto --slow-firstpass --no-fast-pskip --me tesa --merange 24 --partitions all --rc-lookahead 60 --ref 5 --subme 10 --trellis 2 --nr  0  --weightp 0 --bframes 3 --nal-hrd vbr --vbv-maxrate 12500 --vbv-bufsize 12500 --level 3.0 --keyint 24 --min-keyint 2 --b-pyramid strict --slices 1 --aud --colorprim bt709 --transfer bt709 --colormatrix bt709 --sar  16:15 -o SHOGUN_-_AVC_AAC_SD_Profilhigh_level30_720x576_videospur.mkv - 720x576

Danke für die Antwort!
Um es so zu machen wie du vorschlägst, muss ich den Film erst mal RAW auf die Platte schreiben (geschätzt mind. 600-800GB je Film) und kann erst dann weiter machen... soviel Platz hat man nicht mal eben so rum liegen, deshalb macht man das gewöhnlich mit ner PIPE...

Das war ja nur mal so nen Beispiel, ich wollte damit nur zeigen, dass das Problem beim "-"
Code:
... | PROGRAMM Option [B]-[/B] Option
liegt.

Für mich sieht es so aus, als wenn auf einmal mein FreeBSD-Rechner das "-" nicht mehr als [StdIn] verwenden kann.

Woran kann das liegen?

Gruß
Yoda
 
Um ehrlich zu sein, keine Ahnung. Wenn es gar nicht geht, kannst du aber einfach /dev/stdin als Dateiname angeben, dann liest er aus der Pipe.

Was schief gehen kann ist, wenn das Programm ein seek in der Datei zu machen, das funktioniert bei Pipes nicht.
 
Um ehrlich zu sein, keine Ahnung. Wenn es gar nicht geht, kannst du aber einfach /dev/stdin als Dateiname angeben, dann liest er aus der Pipe.

Was schief gehen kann ist, wenn das Programm ein seek in der Datei zu machen, das funktioniert bei Pipes nicht.

Danke,
das werde ich heute Abend mal ausprobieren.

Einen Seek sollte er nicht machen, er soll denn Datenstrom einfach nur in ein BluRay-Format übersetzen und nicht drin rumsurfen. ;-)

Gruß
Yoda
 
such mal bei google nach "x264 stdin", dort wird ab und zu --stdin erwähnt und dass man das Minus als ersten Parameter angeben soll.

Rob

Ich hab da mal gerade gegoogelt...

das ist ja ein starkes Stück!
Es gibt seit 2006 Optionen, die bis heute nicht in der ManPage bzw. "--fullhelp" drin stehen.

Ich hab mich genau an die Anweisungen in "--fullhelp" gehalten! :confused:

Soeine Schlamperei, wäre das sauber dokumentiert worden, hätte ich den Fehler schon letztes Jahr aus meinem Script entfernen können. :grumble:

Naja, ich probier es gleich heute Abend aus, aber nachdem was ich gerade gelesen habe, sollte das genau die Lösung sein, die ich gesucht habe. :D

Code:
mencoder film.mpg ...Optionen... -o - | x264 - 720x576 --stdin yuv ...Optionen... -o film.mkv

Danke nochmal für den Tip!

Gruß
Yoda
 
gelöst

Die Lösung ist die Option "--input-res":

Code:
mencoder film.mpg ...Optionen... -o - | x264 - --input-res 720x576 ...Optionen... -o film.mkv

Die Option "--stdin" kennt meiner nicht...

Gruß
Yoda
 
Zurück
Oben